On the results drone, execute code from the results dir.
Signed-off-by: Steve Howard <showard@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3856 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/scheduler/drone_manager_unittest.py b/scheduler/drone_manager_unittest.py
index d388a82..cf07584 100755
--- a/scheduler/drone_manager_unittest.py
+++ b/scheduler/drone_manager_unittest.py
@@ -6,7 +6,7 @@
from autotest_lib.scheduler import drone_manager, drone_utility, drones
class MockDrone(drones._AbstractDrone):
- def __init__(self, name, active_processes, max_processes):
+ def __init__(self, name, active_processes=0, max_processes=10):
super(MockDrone, self).__init__()
self.name = name
self.active_processes = active_processes
@@ -71,7 +71,7 @@
self.god.stub_function(drones, 'get_drone')
# set up some dummy drones
- self.mock_drone = MockDrone('mock_drone', 0, 10)
+ self.mock_drone = MockDrone('mock_drone')
self.manager._drones[self.mock_drone.name] = self.mock_drone
self.results_drone = MockDrone('results_drone', 0, 10)
self.manager._results_drone = self.results_drone
@@ -120,7 +120,11 @@
drone_utility._TEMPORARY_DIRECTORY))
(drones.get_drone.expect_call(self.mock_drone.name)
.and_return(self.mock_drone))
- drones.get_drone.expect_call(results_hostname).and_return(object())
+
+ results_drone = MockDrone('results_drone')
+ self.god.stub_function(results_drone, 'set_autotest_install_dir')
+ drones.get_drone.expect_call(results_hostname).and_return(results_drone)
+ results_drone.set_autotest_install_dir.expect_call(self._RESULTS_DIR)
self.manager.initialize(base_results_dir=self._RESULTS_DIR,
drone_hostnames=[self.mock_drone.name],