tests.ssg_test_suite package

tests.ssg_test_suite.combined module

tests.ssg_test_suite.common module

tests.ssg_test_suite.log module

class tests.ssg_test_suite.log.LogHelper

Bases: object

Provide focal point for logging. LOG_DIR is useful when output of script is saved into file. Log preloading is a way to log outcome before the output itself.

FORMATTER = <logging.Formatter object>
INTERMEDIATE_LOGS = {'fail': [], 'notapplicable': [], 'pass': []}
LOG_DIR = None
LOG_FILE = None
classmethod add_console_logger(logger, level)

Convenience function to set defaults for console logger

classmethod add_logging_dir(logger, _dirname)

Convenience function to set default logging into file.

Also sets LOG_DIR and LOG_FILE

static find_name(original_path, suffix='')

Find file name which is still not present in given directory

Returns path – original_path + number + suffix

classmethod log_preloaded(log_target)

Log messages preloaded in one of the named buffers. Wipe out all buffers afterwards.

classmethod preload_log(log_level, log_line, log_target=None)

Save log for later use. Fill named buffer `log_target`with the log line for later use.

Special case: If log_target is default, i.e. None, all buffers will be filled with the same log line.

tests.ssg_test_suite.oscap module

tests.ssg_test_suite.profile module

tests.ssg_test_suite.rule module

tests.ssg_test_suite.test_env module

tests.ssg_test_suite.virt module

tests.ssg_test_suite.xml_operations module

tests.ssg_test_suite.xml_operations.add_platform_to_benchmark(root, cpe_regex)
tests.ssg_test_suite.xml_operations.benchmark_get_applicable_platforms(datastream, benchmark_id, logging=None)

Returns a set of CPEs the given benchmark is applicable to.

tests.ssg_test_suite.xml_operations.datastream_root(ds_location, save_location=None)
tests.ssg_test_suite.xml_operations.find_fix_in_benchmark(datastream, benchmark_id, rule_id, fix_type='bash', logging=None)

Return fix from benchmark. None if not found.

tests.ssg_test_suite.xml_operations.find_rule_in_benchmark(datastream, benchmark_id, rule_id, logging=None)

Returns rule node from the given benchmark.

tests.ssg_test_suite.xml_operations.get_all_profiles_in_benchmark(datastream, benchmark_id, logging=None)
tests.ssg_test_suite.xml_operations.get_all_rule_ids_in_profile(datastream, benchmark_id, profile_id, logging=None)
tests.ssg_test_suite.xml_operations.get_all_rule_selections_in_profile(datastream, benchmark_id, profile_id, logging=None)
tests.ssg_test_suite.xml_operations.get_all_xccdf_ids_in_datastream(datastream)
tests.ssg_test_suite.xml_operations.get_oscap_supported_cpes()

Obtain a list of CPEs that the scanner supports

tests.ssg_test_suite.xml_operations.infer_benchmark_id_from_component_ref_id(datastream, ref_id)
tests.ssg_test_suite.xml_operations.remove_ansible_machine_remediation_condition(root)
tests.ssg_test_suite.xml_operations.remove_bash_machine_remediation_condition(root)
tests.ssg_test_suite.xml_operations.remove_machine_only_from_element(root, element_spec)
tests.ssg_test_suite.xml_operations.remove_machine_platform(root)
tests.ssg_test_suite.xml_operations.remove_machine_remediation_condition(root)

Module contents