Make it possible to run the "cleanup" phase manually.

Signed-off-by: Jeremy Orlow <jorlow@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2681 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/tests/cleanup_test/cleanup_test.py b/server/tests/cleanup_test/cleanup_test.py
new file mode 100644
index 0000000..f797817
--- /dev/null
+++ b/server/tests/cleanup_test/cleanup_test.py
@@ -0,0 +1,11 @@
+from autotest_lib.server import test
+from autotest_lib.client.common_lib import error
+
+class cleanup_test(test.test):
+    version = 1
+
+    def execute(self, host):
+        try:
+            host.cleanup()
+        except Exception, e:
+            raise error.TestError("Cleanup failed: " + str(e))
diff --git a/server/tests/cleanup_test/control b/server/tests/cleanup_test/control
new file mode 100644
index 0000000..84c45e8
--- /dev/null
+++ b/server/tests/cleanup_test/control
@@ -0,0 +1,19 @@
+NAME = 'Cleanup Test'
+AUTHOR = 'jorlow@google.com (Jeremy Orlow)'
+TIME = 'SHORT'
+TEST_CLASS = 'Software'
+TEST_CATEGORY = 'Functional'
+TEST_TYPE = 'server'
+RUN_VERIFY = False
+
+DOC = """
+Run the same cleanup function that the scheduler uses in between tests and
+log a test failure if something goes wrong.
+"""
+
+def run(machine):
+    host = hosts.create_host(machine, initialize=False)
+    job.run_test('cleanup_test', host=host, disable_sysinfo=True)
+
+job.parallel_simple(run, machines)
+