Skip to content

Commit

Permalink
add result "notfail" option
Browse files Browse the repository at this point in the history
  • Loading branch information
noursaidi committed May 19, 2021
1 parent ea1559c commit 6ec3d7a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 5 additions & 3 deletions daq/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ def _analyse_and_write_results(self):

# The device overall fails if any result is unexpected
if result_dict["result"] != required_result:
if required_result == 'notfail' and result_dict["result"] == 'fail':
if required_result == 'notfail' and result_dict["result"] != 'fail':
pass
else:
passes = False

if result_dict["result"] == 'gone':
Expand Down Expand Up @@ -336,8 +338,8 @@ def _write_category_table(self):
# TODO remove when info tests are removed
if result_dict["result"] == 'info':
result_dict["result"] = 'pass'
elif (result_dict["result"] == 'skip'
and test_info['required'] == 'notfail'):
elif (result_dict["result"] == 'skip'
and test_info['required'] == 'notfail'):
result = 'pass'
else:
result = "fail"
Expand Down
4 changes: 2 additions & 2 deletions resources/setups/common/tests_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@
},
"ntp.network.ntp_update_dhcp": {
"category": "NTP",
"required": "pass",
"required": "notfail",
"expected": "Required Pass"
},
"ntp.network.ntp_update_dns": {
"category": "NTP",
"required": "pass",
"required": "notfail",
"expected": "Required Pass"
},
"communication.network.min_send": {
Expand Down
1 change: 0 additions & 1 deletion subset/network/ntp_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ def test_ntp_update():
for test in ntp_tests:
ntp_tests[test].add_summary("Not enough NTP packets received.")
ntp_tests[test].result = test_result.SKIP
ntp_tests[test].write_results(report_filename)
else:
test_dns = ntp_configured_by_dns()
local_ntp_ip = ntp_server_from_ip(device_address)
Expand Down

0 comments on commit 6ec3d7a

Please sign in to comment.