def test_containers_smartstate_analysis(provider, test_item, soft_assert): chosen_row = navigate_and_get_rows(provider, Image, 1)[0] image_obj = Image(chosen_row.name.text, chosen_row.tag.text, provider) if test_item.is_openscap: image_obj.assign_policy_profiles('OpenSCAP profile') else: image_obj.unassign_policy_profiles('OpenSCAP profile') try: evm_tail = LogValidator('/var/www/miq/vmdb/log/evm.log', matched_patterns=LOG_VERIFICATION_VERBS) except: # TODO: Should we add a specific exception? pytest.skip( 'Cannot continue test, probably due to containerized appliance\n' 'Traceback: \n{}'.format(format_exc())) evm_tail.fix_before_start() image_obj.perform_smartstate_analysis(wait_for_finish=True) image_obj.summary.reload() for tbl, attr, verifier in test_item.tested_attr: table = getattr(image_obj.summary, tbl) if not soft_assert( hasattr(table, attr), '{} table has missing attribute \'{}\''.format(tbl, attr)): continue value = getattr(table, attr).value soft_assert( verifier(value), '{}.{} attribute has unexpected value ({})'.format( tbl, attr, value))