-
Notifications
You must be signed in to change notification settings - Fork 165
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good changes!
else: | ||
logger.info("{}: rule not found".format(rule)) | ||
temp_appliance_preconfig.appliance_console.scap_harden_appliance() | ||
assert not temp_appliance_preconfig.appliance_console.scap_check_rules() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional:
I realize this all is my mistake -- i should have done it before, but could you please make more clear that the scap_check_rules
returns some kind of iterable of failures? The best would be to rename the method to something like scap_failures
.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JaryN the return value of scap_check_rules
function itself was an iterable object, so now I done the remaining changes, please review once
@@ -80,7 +80,7 @@ def scap_harden_appliance(self): | |||
})) | |||
interaction.answer('Press any key to continue.', '', timeout=AP_WELCOME_SCREEN_TIMEOUT) | |||
|
|||
def scap_check_rules(self): | |||
def scap_failures(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc block here needs to be updated
cfme/utils/appliance/console.py
Outdated
@@ -116,14 +116,14 @@ def scap_check_rules(self): | |||
if elements: | |||
result = elements[0].findall('./{http://checklists.nist.gov/xccdf/1.1}result') | |||
if result: | |||
if result[0].text != 'pass': | |||
rules_failures.append(rule) | |||
rules_failures.append(False) if result[0].text != 'pass' else ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the functionality of the method is changing. @JaryN suggested to return a iterable list of failures (which is was doing), this is now just returning true or false. The doc block just needs to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jawatts Updated doc string
Thanks for working this @dgaikwad ! |
Fixed SCAP testcase
Purpose or Intent
PRT Run
{{pytest: ./cfme/tests/cli/test_appliance_console.py::test_appliance_console_scap ./cfme/tests/cli/test_appliance_update.py::test_update_scap_webui -v}}