Fix the drone results dir computation. I forgot that the results don't just go under the drone_installation_directory, they go under "results" in there.
Signed-off-by: Steve Howard <showard@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3854 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/scheduler/drone_manager.py b/scheduler/drone_manager.py
index ec1fccc..93753fd 100644
--- a/scheduler/drone_manager.py
+++ b/scheduler/drone_manager.py
@@ -5,6 +5,10 @@
from autotest_lib.scheduler import scheduler_config
+# results on drones will be placed under the drone_installation_directory in a
+# directory with this name
+_DRONE_RESULTS_DIR_SUFFIX = 'results'
+
WORKING_DIRECTORY = object() # see execute_command()
@@ -523,7 +527,8 @@
if on_results_repository:
base_dir = self._results_dir
else:
- base_dir = drones.AUTOTEST_INSTALL_DIR
+ base_dir = os.path.join(drones.AUTOTEST_INSTALL_DIR,
+ _DRONE_RESULTS_DIR_SUFFIX)
return os.path.join(base_dir, path)
diff --git a/scheduler/drone_manager_unittest.py b/scheduler/drone_manager_unittest.py
index 02d5fe3..6ad9601 100755
--- a/scheduler/drone_manager_unittest.py
+++ b/scheduler/drone_manager_unittest.py
@@ -49,6 +49,7 @@
class DroneManager(unittest.TestCase):
_DRONE_INSTALL_DIR = '/drone/install/dir'
+ _DRONE_RESULTS_DIR = os.path.join(_DRONE_INSTALL_DIR, 'results')
_RESULTS_DIR = '/results/dir'
_SOURCE_PATH = 'source/path'
_DESTINATION_PATH = 'destination/path'
@@ -114,14 +115,14 @@
pidfile_name=pidfile_name,
log_file=log_file)
- full_working_directory = os.path.join(self._DRONE_INSTALL_DIR,
+ full_working_directory = os.path.join(self._DRONE_RESULTS_DIR,
working_directory)
self.assertEquals(pidfile_id.path,
os.path.join(full_working_directory, pidfile_name))
self.assert_(self.mock_drone.was_call_queued(
'execute_command', ['test', full_working_directory],
full_working_directory,
- os.path.join(self._DRONE_INSTALL_DIR, log_file), pidfile_name))
+ os.path.join(self._DRONE_RESULTS_DIR, log_file), pidfile_name))
def test_copy_results_on_drone(self):
@@ -130,8 +131,8 @@
self._DESTINATION_PATH)
self.assert_(self.mock_drone.was_call_queued(
'copy_file_or_directory',
- os.path.join(self._DRONE_INSTALL_DIR, self._SOURCE_PATH),
- os.path.join(self._DRONE_INSTALL_DIR, self._DESTINATION_PATH)))
+ os.path.join(self._DRONE_RESULTS_DIR, self._SOURCE_PATH),
+ os.path.join(self._DRONE_RESULTS_DIR, self._DESTINATION_PATH)))
def test_copy_to_results_repository(self):
@@ -139,7 +140,7 @@
self._SOURCE_PATH)
self.assert_(self.mock_drone.was_file_sent(
self.results_drone,
- os.path.join(self._DRONE_INSTALL_DIR, self._SOURCE_PATH),
+ os.path.join(self._DRONE_RESULTS_DIR, self._SOURCE_PATH),
os.path.join(self._RESULTS_DIR, self._SOURCE_PATH)))
@@ -159,7 +160,7 @@
file_path, lines, paired_with_process=self.mock_drone_process)
self.assert_(self.mock_drone.was_call_queued(
'write_to_file',
- os.path.join(self._DRONE_INSTALL_DIR, file_path), written_data))
+ os.path.join(self._DRONE_RESULTS_DIR, file_path), written_data))
if __name__ == '__main__':