def test_client_logger_process_line_log_copy_collection_failure(self): collector = autotest.log_collector.expect_new(self.host, '', '') logger = autotest.client_logger(self.host, '', '') collector.collect_client_job_results.expect_call().and_raises( Exception('log copy failure')) logging.exception.expect_call(mock.is_string_comparator()) logger._process_line('AUTOTEST_TEST_COMPLETE:/autotest/fifo1')
def test_client_logger_process_line_package_install_fifo_failure(self): collector = autotest.log_collector.expect_new(self.host, '', '') logger = autotest.client_logger(self.host, '', '') self.god.stub_function(logger, '_send_tarball') c = autotest.global_config.global_config c.get_config_value.expect_call('PACKAGES', 'serve_packages_from_autoserv', type=bool).and_return(True) logger._send_tarball.expect_call('pkgname.tar.bz2', '/autotest/dest/') self.host.run.expect_call('echo B > /autotest/fifo3').and_raises( Exception('fifo failure')) logging.exception.expect_call(mock.is_string_comparator()) logger._process_line('AUTOTEST_FETCH_PACKAGE:pkgname.tar.bz2:' '/autotest/dest/:/autotest/fifo3')