def tearDown(self): if self._successful_test: to_check_dirs = iotools.get_all_dir_names_in_dir(self.path_to_check) for to_check_dir in to_check_dirs: directory_to_check = os.path.join(self.path_to_check, to_check_dir) input_arguments = " clean --temp=" + directory_to_check call_command = os.path.abspath(self.path_to_modified_sbs_match) + " " + input_arguments call_command = sys.executable + " " + call_command process = subprocess.Popen(call_command, shell=True) process.communicate() iotools.delete_item(directory_to_check) iotools.delete_item(os.path.join(self.path_to_check, "test_log.log")) else: print "Test wasn't successful, will not delete output"
def testOutput(self): input_dirs = iotools.get_all_dir_names_in_dir(self.path_to_input) for input_dir_name in input_dirs: input_dir_path = os.path.join(self.path_to_input, input_dir_name) directory_to_check = os.path.join(self.path_to_check, input_dir_name) directory_valid = os.path.join(self.path_to_valid, input_dir_name) ips_to_test = self._get_ips_to_test(os.path.join(input_dir_path, "test.cfg")) print "Starting run for " + input_dir_path for ip in ips_to_test: print " Running ip", ip self._run_sbsmatch_for_input(ip, input_dir_path, directory_to_check) print " Checking results..." self._check_results_for_ip(ip, directory_to_check, directory_valid) print " Done" self._successful_test = True
def tearDown(self): if self._successful_test: to_check_dirs = iotools.get_all_dir_names_in_dir( self.path_to_check) for to_check_dir in to_check_dirs: directory_to_check = os.path.join(self.path_to_check, to_check_dir) input_arguments = " clean --temp=" + directory_to_check call_command = os.path.abspath( self.path_to_modified_sbs_match) + " " + input_arguments call_command = sys.executable + " " + call_command process = subprocess.Popen(call_command, shell=True) process.communicate() iotools.delete_item(directory_to_check) iotools.delete_item( os.path.join(self.path_to_check, "test_log.log")) else: print "Test wasn't successful, will not delete output"
def testOutput(self): input_dirs = iotools.get_all_dir_names_in_dir(self.path_to_input) for input_dir_name in input_dirs: input_dir_path = os.path.join(self.path_to_input, input_dir_name) directory_to_check = os.path.join(self.path_to_check, input_dir_name) directory_valid = os.path.join(self.path_to_valid, input_dir_name) ips_to_test = self._get_ips_to_test( os.path.join(input_dir_path, "test.cfg")) print "Starting run for " + input_dir_path for ip in ips_to_test: print " Running ip", ip self._run_sbsmatch_for_input(ip, input_dir_path, directory_to_check) print " Checking results..." self._check_results_for_ip(ip, directory_to_check, directory_valid) print " Done" self._successful_test = True