def test_hashes(self):
     text_to_hash = """
         This is preupgrade assistant test has string"
     """
     self.dir_name = "tests/hashes"
     os.mkdir(self.dir_name)
     utils.write_to_file(os.path.join(self.dir_name, "post_script"), "wb", text_to_hash)
     remediate.hash_postupgrade_file(False, self.dir_name)
     return_value = remediate.hash_postupgrade_file(False, self.dir_name, check=True)
     self.assertTrue(return_value)
示例#2
0
 def test_hashes(self):
     text_to_hash="""
         This is preupgrade assistant test has string"
     """
     self.dir_name = "tests/hashes"
     os.mkdir(self.dir_name)
     utils.write_to_file(os.path.join(self.dir_name, "post_script"), 'wb', text_to_hash)
     remediate.hash_postupgrade_file(False, self.dir_name)
     return_value = remediate.hash_postupgrade_file(False, self.dir_name, check=True)
     self.assertTrue(return_value)
示例#3
0
 def finalize_xml_files(self):
     """
     Function copies postupgrade scripts and creates hash postupgrade file.
     It finds solution files and update XML file.
     """
     # Copy postupgrade.d special files
     remediate.special_postupgrade_scripts(self.conf.result_dir)
     remediate.hash_postupgrade_file(self.conf.verbose,
                                     self.get_postupgrade_dir())
     solution_files = self.report_parser.get_solution_files()
     for report in self._get_reports():
         self.xml_mgr.find_solution_files(report.split('.')[0], solution_files)
     remediate.copy_modified_config_files(self.conf.result_dir)
示例#4
0
 def apply_scan(self):
     """Extract tar ball for remediation"""
     self.prepare_apply_directories()
     tarball_result_dir(self.conf.apply,
                        self.conf.result_dir,
                        self.conf.verbose,
                        direction=False)
     if remediate.hash_postupgrade_file(self.conf.verbose, self.get_postupgrade_dir(), check=True):
         remediate.postupgrade_scripts(self.conf.verbose, self.get_postupgrade_dir())