diff options
author | mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> | 2008-04-21 18:08:46 +0000 |
---|---|---|
committer | mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> | 2008-04-21 18:08:46 +0000 |
commit | 04399d0521ffcdd64a01c46b30dbd688f536c25e (patch) | |
tree | 1c83d37ea1e770bf048cb4963fe7267e934342fb /server/self-test | |
parent | b745c9c0761e4fbdd6302b0c6f8f599ec3e9c9d7 (diff) |
Add some basic server self-tests.
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@1456 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'server/self-test')
-rw-r--r-- | server/self-test/machine | 14 | ||||
-rw-r--r-- | server/self-test/remote_cmd | 45 |
2 files changed, 59 insertions, 0 deletions
diff --git a/server/self-test/machine b/server/self-test/machine new file mode 100644 index 00000000..e648bd32 --- /dev/null +++ b/server/self-test/machine @@ -0,0 +1,14 @@ +import time + +print "Instantiating a machine object" +m = hosts.SSHHost(machines[0]) +print "Passed" + +print + +print "Running is_up on remote machine" +m.is_up() +time.sleep(1) +m.is_up() +print "Passed" + diff --git a/server/self-test/remote_cmd b/server/self-test/remote_cmd new file mode 100644 index 00000000..a7c1eafd --- /dev/null +++ b/server/self-test/remote_cmd @@ -0,0 +1,45 @@ +import utils + +print "Instantiating a machine object" +m = hosts.SSHHost(machines[0]) +print "Passed" + +print + +print "Pinging" +if m.is_up(): + print "Passed" +else: + raise "Failed" + +print + +print "Waiting for ssh" +m.wait_up(5) +print "Passed" + +print + +print "Running ls on remote machine via host.run" +if m.run('ls -d /etc').stdout.strip() == '/etc': + print "Passed" +else: + raise "Failed" + +utils.run('rm -f /tmp/motd') +print "Removing temporary file from remote machine" +m.run('rm -f /tmp/motd') +print "Running send_file remote machine" +m.send_file('/etc/motd', '/tmp/motd') +print "Running get_file remote machine" +m.get_file('/tmp/motd', '/tmp/motd') +print "Verifying files match" +if utils.run('diff -q /etc/motd /tmp/motd').exit_status: + raise "Failed" +print "Removing temporary file from remote machine" +m.run('rm -f /tmp/motd') +print "Passed" +utils.run('rm -f /tmp/motd') + +print + |