allure-framework / allure-framework/allure-python

ValueError message is returned when attempting to format a behave report using a FIPS compliant system

Đang mở
#834 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug theme:core
Ngôn ngữ chính
Python
Star
814
Fork
260
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

[//]: # (
. Note: for support questions, please use Stackoverflow or Gitter**.
. This repository's issues are reserved for feature requests and bug reports.
.
. In case of any problems with Allure Jenkins plugin** please use the following repository
. to create an issue: https://github.com/jenkinsci/allure-plugin/issues
.
. Make sure you have a clear name for your issue. The name should start with a capital
. letter and no dot is required in the end of the sentence. An example of good issue names:
.
. - The report is broken in IE11
. - Add an ability to disable default plugins
. - Support emoji in test descriptions
)

#### I'm submitting a ...
- [X] bug report
- [X] feature request
- [ ] support request => Please do not submit support request here, see note at the top of this template.

#### What is the current behavior?
Running the following command returns a ValueError and points to hashlib.md5() references within the project.
```bash
behave -f allure_behave.formatter:AllureFormatter -o allure-results
```

```bash
Exception ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS
Traceback (most recent call last):
File "/usr/local/bin/behave", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/behave/__main__.py", line 183, in main
return run_behave(config)
File "/usr/local/lib/python3.10/site-packages/behave/__main__.py", line 127, in run_behave
failed = runner.run()
File "/usr/local/lib/python3.10/site-packages/behave/runner.py", line 804, in run
return self.run_with_paths()
File "/usr/local/lib/python3.10/site-packages/behave/runner.py", line 824, in run_with_paths
return self.run_model()
File "/usr/local/lib/python3.10/site-packages/behave/runner.py", line 626, in run_model
failed = feature.run(self)
File "/usr/local/lib/python3.10/site-packages/behave/model.py", line 321, in run
failed = scenario.run(runner)
File "/usr/local/lib/python3.10/site-packages/allure_commons/_allure.py", line 248, in __call__
with self:
File "/usr/local/lib/python3.10/site-packages/allure_commons/_allure.py", line 252, in __enter__
plugin_manager.hook.start_test(parent_uuid=None,
File "/usr/local/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "/usr/local/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall
raise exception.with_traceback(exception.__traceback__)
File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
res = hook_impl.function(*args)
File "/usr/local/lib/python3.10/site-packages/allure_behave/listener.py", line 71, in start_test
self.start_scenario(context['scenario'])
File "/usr/local/lib/python3.10/site-packages/allure_behave/listener.py", line 80, in start_scenario
test_case.historyId = scenario_history_id(scenario)
File "/usr/local/lib/python3.10/site-packages/allure_behave/utils.py", line 33, in scenario_history_id
return md5(*parts)
File "/usr/local/lib/python3.10/site-packages/allure_commons/utils.py", line 19, in md5
m = hashlib.md5()
ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS
```

#### What is the expected behavior?
Behave results should be generated in a Allure compatible format in the allure-results directory of the project.

#### What is the motivation / use case for changing the behavior?
To ensure FIPS compliant/restricted systems utilizing this project are able to format output using any of the Allure adapters.

#### Please tell us about your environment:
- Allure version: 2.32.0
- Test framework: behave@1.2.6
- Allure adapter: allure-behave@2.13.5

#### Other information
- The solution involves replacing MD5 with a version of SHA-2 or greater as SHA-1 has been deprecated.
- Stack Overflow post: https://stackoverflow.com/questions/67559170/paramiko-ssh-command-execution-failing-with-valueerror-digital-envelope-routi
- Approved hash functions: https://csrc.nist.gov/projects/hash-functions
- FIPS compliance FAQ: https://www.nist.gov/standardsgov/compliance-faqs-federal-information-processing-standards-fips

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu trong allure_commons/utils.py tại md5() và lần theo hàm gọi nó trong allure_behave/utils.py thông qua scenario_history_id. Tái hiện lỗi bằng lệnh behave được cung cấp trên hệ thống đã bật FIPS, sau đó xác minh rằng các kết quả được tạo trong allure-results theo định dạng tương thích với Allure.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
testing
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.