def __stop_loggers(self): if self._console_proc: utils.nuke_subprocess(self._console_proc) utils.nuke_subprocess(self._followfiles_proc) self._console_proc = self._followfile_proc = None if self.job: self.job.warning_loggers.discard(self._logfile_warning_stream) self._logfile_warning_stream.close()
def stop_loggers(self): super(NetconsoleHost, self).stop_loggers() if self.__logger: utils.nuke_subprocess(self.__logger) self.__logger = None if self.job: self.job.warning_loggers.discard(self.__warning_stream) self.__warning_stream.close()
def stop_loggers(self): super(SerialHost, self).stop_loggers() if self.__logger: utils.nuke_subprocess(self.__logger) self.__logger = None if self.job: self.job.warning_loggers.discard(self.__warning_stream) self.__warning_stream.close()
def execute(self): os.chdir(self.tmpdir) (p1, _) = utils.run_bg('dd if=/dev/hda3 of=/dev/null') time.sleep(60) blah = os.path.join(self.tmpdir, 'blah') dirty_bin = os.path.join(self.srcdir, 'dirty') dirty_op = os.path.join(self.tmpdir, 'dirty') utils.system('echo AA > ' + blah) p2 = subprocess.Popen(dirty_bin + ' ' + blah + ' 1 > ' + dirty_op, shell=True) time.sleep(600) if p2.poll() is None: utils.nuke_subprocess(p1) utils.nuke_subprocess(p2) raise error.TestFail('Writes made no progress') # Commenting out use of utils.run as there is a timeout bug # # try: # utils.run(dirty_bin + ' ' + blah + '1 > ' + dirty_op, 900, False, # None, None) # except Exception: # utils.nuke_subprocess(p1) # raise error.TestFail('Writes made no progress') utils.nuke_subprocess(p1)