[autotest] Move dynamic suite code into its own module
No big rewrite, just moving files around
BUG=chromium-os:30266
TEST=unit
TEST=successful run_suite.py run
TEST=suite_enumerator.py, suite_preprocessor.py, and suite_scheduler.py
Change-Id: I2fbcae0332104ce3adcb10a1e90ce94cb209aca8
Reviewed-on: https://gerrit.chromium.org/gerrit/30267
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/server/cros/dynamic_suite/__init__.py b/server/cros/dynamic_suite/__init__.py
new file mode 100644
index 0000000..dd0d382
--- /dev/null
+++ b/server/cros/dynamic_suite/__init__.py
@@ -0,0 +1 @@
+from dynamic_suite import *
diff --git a/server/cros/control_file_getter.py b/server/cros/dynamic_suite/control_file_getter.py
similarity index 100%
rename from server/cros/control_file_getter.py
rename to server/cros/dynamic_suite/control_file_getter.py
diff --git a/server/cros/control_file_getter_unittest.py b/server/cros/dynamic_suite/control_file_getter_unittest.py
similarity index 98%
rename from server/cros/control_file_getter_unittest.py
rename to server/cros/dynamic_suite/control_file_getter_unittest.py
index a91e4d1..d173e48 100644
--- a/server/cros/control_file_getter_unittest.py
+++ b/server/cros/dynamic_suite/control_file_getter_unittest.py
@@ -14,7 +14,7 @@
from autotest_lib.client.common_lib import error
from autotest_lib.client.common_lib.cros import dev_server
-from autotest_lib.server.cros import control_file_getter
+from autotest_lib.server.cros.dynamic_suite import control_file_getter
class DevServerGetterTest(mox.MoxTestBase):
diff --git a/server/cros/dynamic_suite.py b/server/cros/dynamic_suite/dynamic_suite.py
similarity index 98%
rename from server/cros/dynamic_suite.py
rename to server/cros/dynamic_suite/dynamic_suite.py
index 149b8d9..cb910f1 100644
--- a/server/cros/dynamic_suite.py
+++ b/server/cros/dynamic_suite/dynamic_suite.py
@@ -8,9 +8,10 @@
from autotest_lib.client.common_lib import base_job, control_data, global_config
from autotest_lib.client.common_lib import error, utils
from autotest_lib.client.common_lib.cros import dev_server
-from autotest_lib.server.cros import control_file_getter, frontend_wrappers
-from autotest_lib.server.cros import host_lock_manager, job_status
-from autotest_lib.server.cros.job_status import Status
+from autotest_lib.server.cros.dynamic_suite import control_file_getter
+from autotest_lib.server.cros.dynamic_suite import frontend_wrappers
+from autotest_lib.server.cros.dynamic_suite import host_lock_manager, job_status
+from autotest_lib.server.cros.dynamic_suite.job_status import Status
from autotest_lib.server import frontend
from autotest_lib.frontend.afe.json_rpc import proxy
@@ -34,7 +35,7 @@
Example control file:
import common
-from autotest_lib.server.cros import dynamic_suite
+from autotest_lib.server.cros.dynamic_suite import dynamic_suite
dynamic_suite.reimage_and_run(
build=build, board=board, name='bvt', job=job, pool=pool,
diff --git a/server/cros/dynamic_suite_unittest.py b/server/cros/dynamic_suite/dynamic_suite_unittest.py
similarity index 98%
rename from server/cros/dynamic_suite_unittest.py
rename to server/cros/dynamic_suite/dynamic_suite_unittest.py
index 1de8e08..7f5b6db 100755
--- a/server/cros/dynamic_suite_unittest.py
+++ b/server/cros/dynamic_suite/dynamic_suite_unittest.py
@@ -4,7 +4,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Unit tests for server/cros/dynamic_suite.py."""
+"""Unit tests for server/cros/dynamic_suite/dynamic_suite.py."""
import logging
import mox
@@ -20,11 +20,12 @@
from autotest_lib.client.common_lib import global_config
from autotest_lib.client.common_lib.cros import dev_server
from autotest_lib.frontend.afe.json_rpc import proxy
-from autotest_lib.server.cros import control_file_getter, dynamic_suite
-from autotest_lib.server.cros import host_lock_manager, job_status
-from autotest_lib.server.cros.dynamic_suite_fakes import FakeControlData
-from autotest_lib.server.cros.dynamic_suite_fakes import FakeHost, FakeJob
-from autotest_lib.server.cros.dynamic_suite_fakes import FakeLabel
+from autotest_lib.server.cros.dynamic_suite import control_file_getter
+from autotest_lib.server.cros.dynamic_suite import dynamic_suite
+from autotest_lib.server.cros.dynamic_suite import host_lock_manager, job_status
+from autotest_lib.server.cros.dynamic_suite.fakes import FakeControlData
+from autotest_lib.server.cros.dynamic_suite.fakes import FakeHost, FakeJob
+from autotest_lib.server.cros.dynamic_suite.fakes import FakeLabel
from autotest_lib.server import frontend
diff --git a/server/cros/dynamic_suite_fakes.py b/server/cros/dynamic_suite/fakes.py
similarity index 97%
rename from server/cros/dynamic_suite_fakes.py
rename to server/cros/dynamic_suite/fakes.py
index 29bede0..87df4e2 100644
--- a/server/cros/dynamic_suite_fakes.py
+++ b/server/cros/dynamic_suite/fakes.py
@@ -5,7 +5,7 @@
"""Fakes for dynamic_suite-related unit tests."""
import datetime
-from autotest_lib.server.cros import job_status
+from autotest_lib.server.cros.dynamic_suite import job_status
class FakeControlData(object):
diff --git a/server/cros/frontend_wrappers.py b/server/cros/dynamic_suite/frontend_wrappers.py
similarity index 100%
rename from server/cros/frontend_wrappers.py
rename to server/cros/dynamic_suite/frontend_wrappers.py
diff --git a/server/cros/frontend_wrappers_unittest.py b/server/cros/dynamic_suite/frontend_wrappers_unittest.py
similarity index 93%
rename from server/cros/frontend_wrappers_unittest.py
rename to server/cros/dynamic_suite/frontend_wrappers_unittest.py
index 49e6ad3..0d58481 100644
--- a/server/cros/frontend_wrappers_unittest.py
+++ b/server/cros/dynamic_suite/frontend_wrappers_unittest.py
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Unit tests for server/cros/frontend_wrappers.py."""
+"""Unit tests for server/cros/dynamic_suite/frontend_wrappers.py."""
import logging
import mox
@@ -10,7 +10,7 @@
import unittest
from autotest_lib.client.common_lib.cros import retry
-from autotest_lib.server.cros import frontend_wrappers
+from autotest_lib.server.cros.dynamic_suite import frontend_wrappers
from autotest_lib.server import frontend
class FrontendWrappersTest(mox.MoxTestBase):
diff --git a/server/cros/host_lock_manager.py b/server/cros/dynamic_suite/host_lock_manager.py
similarity index 96%
rename from server/cros/host_lock_manager.py
rename to server/cros/dynamic_suite/host_lock_manager.py
index a9053f1..59b3964 100644
--- a/server/cros/host_lock_manager.py
+++ b/server/cros/dynamic_suite/host_lock_manager.py
@@ -6,7 +6,7 @@
import common
from autotest_lib.client.common_lib import error
-from autotest_lib.server.cros import frontend_wrappers
+from autotest_lib.server.cros.dynamic_suite import frontend_wrappers
"""HostLockManager class, for the dynamic_suite module.
diff --git a/server/cros/host_lock_manager_unittest.py b/server/cros/dynamic_suite/host_lock_manager_unittest.py
similarity index 94%
rename from server/cros/host_lock_manager_unittest.py
rename to server/cros/dynamic_suite/host_lock_manager_unittest.py
index ea013a6..9e4bbce 100644
--- a/server/cros/host_lock_manager_unittest.py
+++ b/server/cros/dynamic_suite/host_lock_manager_unittest.py
@@ -4,7 +4,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Unit tests for server/cros/host_lock_manager.py."""
+"""Unit tests for server/cros/dynamic_suite/host_lock_manager.py."""
import logging
import mox
@@ -12,7 +12,7 @@
import unittest
from autotest_lib.client.common_lib import error
-from autotest_lib.server.cros import host_lock_manager
+from autotest_lib.server.cros.dynamic_suite import host_lock_manager
from autotest_lib.server import frontend
diff --git a/server/cros/job_status.py b/server/cros/dynamic_suite/job_status.py
similarity index 100%
rename from server/cros/job_status.py
rename to server/cros/dynamic_suite/job_status.py
diff --git a/server/cros/job_status_unittest.py b/server/cros/dynamic_suite/job_status_unittest.py
similarity index 97%
rename from server/cros/job_status_unittest.py
rename to server/cros/dynamic_suite/job_status_unittest.py
index 08682e1..93aece6 100644
--- a/server/cros/job_status_unittest.py
+++ b/server/cros/dynamic_suite/job_status_unittest.py
@@ -4,7 +4,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Unit tests for server/cros/job_status.py."""
+"""Unit tests for server/cros/dynamic_suite/job_status.py."""
import logging
import mox
@@ -13,9 +13,9 @@
import time
import unittest
-from autotest_lib.server.cros import job_status, host_lock_manager
-from autotest_lib.server.cros.dynamic_suite_fakes import FakeHost, FakeJob
-from autotest_lib.server.cros.dynamic_suite_fakes import FakeStatus
+from autotest_lib.server.cros.dynamic_suite import job_status, host_lock_manager
+from autotest_lib.server.cros.dynamic_suite.fakes import FakeHost, FakeJob
+from autotest_lib.server.cros.dynamic_suite.fakes import FakeStatus
from autotest_lib.server import frontend