def test_compose(self):
     expected_contents = ['failed', 'fixed', 'needs_action', 'needs_inspection', 'not_applicable', 'pass']
     for content in expected_contents:
         compose_xml = ComposeXML()
         result_dir = os.path.join(self.dir_name, content)
         compose_xml.collect_group_xmls(self.dir_name, content=content)
         self.assertTrue(os.path.exists(os.path.join(result_dir, 'group.xml')))
         self.assertFalse(os.path.exists(os.path.join(result_dir, 'all-xccdf.xml')))
    def test_final_compose(self):
        expected_contents = ['failed', 'fixed', 'needs_action', 'needs_inspection', 'not_applicable', 'pass']
        for content in expected_contents:
            compose_xml = ComposeXML()
            dir_name = os.path.join(self.temp_dir, FOO_DIR, 'dummy')
            compose_xml.collect_group_xmls(dir_name, content=content)

        xccdf_compose = XCCDFCompose(os.path.join(self.temp_dir, FOO_DIR))
        xccdf_compose.generate_xml()
        all_xccdf = os.path.join(self.result_dir, settings.content_file)
        self.assertTrue(os.path.exists(all_xccdf))
        dummy_lines = FileHelper.get_file_content(all_xccdf, 'rb')
Example #3
0
 def test_compose(self):
     expected_contents = [
         'failed', 'fixed', 'needs_action', 'needs_inspection',
         'not_applicable', 'pass'
     ]
     for content in expected_contents:
         compose_xml = ComposeXML()
         result_dir = os.path.join(self.dir_name, content)
         compose_xml.collect_group_xmls(self.dir_name, content=content)
         self.assertTrue(
             os.path.exists(os.path.join(result_dir, 'group.xml')))
         self.assertFalse(
             os.path.exists(os.path.join(result_dir, 'all-xccdf.xml')))
Example #4
0
    def test_final_compose(self):
        expected_contents = [
            'failed', 'fixed', 'needs_action', 'needs_inspection',
            'not_applicable', 'pass'
        ]
        for content in expected_contents:
            compose_xml = ComposeXML()
            dir_name = os.path.join(self.temp_dir, FOO_DIR, 'dummy')
            compose_xml.collect_group_xmls(dir_name, content=content)

        xccdf_compose = XCCDFCompose(os.path.join(self.temp_dir, FOO_DIR))
        xccdf_compose.generate_xml()
        all_xccdf = os.path.join(self.result_dir, settings.content_file)
        self.assertTrue(os.path.exists(all_xccdf))
        dummy_lines = FileHelper.get_file_content(all_xccdf, 'rb')