Add a simple verify and repair function to autoserv for the
scheduler to call. This does a little bit of stuff each, and will
be useful, but basically it's a starter
Signed-off-by: Martin Bligh <mbligh@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@922 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/server_job.py b/server/server_job.py
index 2815c5e..1e81e4c 100755
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -72,6 +72,34 @@
parallel_simple(install, machines, log=False)
"""
+# This needs more stuff in it. Check for diskspace, etc. But it's a start.
+verify="""\
+def cleanup(machine):
+ host = hosts.SSHHost(machine, initialize=False)
+ host.ssh_ping()
+
+parallel_simple(cleanup, machines, log=False)
+"""
+
+# This is pretty silly. Wait for s/w watchdog. Pray hard.
+repair="""\
+def cleanup(machine):
+ host = hosts.SSHHost(machine, initialize=False)
+ host.ssh_ping(150*60) # wait for 2.5 hours
+
+parallel_simple(cleanup, machines, log=False)
+"""
+
+def verify_machines(machines):
+ namespace = {'machines' : machines, 'job' : None}
+ exec(preamble + verify, namespace, namespace)
+
+
+def repair_machines(machines):
+ namespace = {'machines' : machines, 'job' : None}
+ exec(preamble + repair, namespace, namespace)
+
+
class server_job:
"""The actual job against which we do everything.