diff options
author | Robin Norwood <rnorwood@redhat.com> | 2007-09-25 10:33:03 -0400 |
---|---|---|
committer | Robin Norwood <rnorwood@redhat.com> | 2007-09-25 10:33:03 -0400 |
commit | 5024f7f62ff32345660fae783ac7a97d506fe1da (patch) | |
tree | f27c302f2593ccd8517730a0d7d45e9832824b00 /overlord/test_func.py | |
parent | 7d543b6cf1d721c2e9f7ed88a230172870a9f558 (diff) | |
download | third_party-func-5024f7f62ff32345660fae783ac7a97d506fe1da.tar.gz third_party-func-5024f7f62ff32345660fae783ac7a97d506fe1da.tar.xz third_party-func-5024f7f62ff32345660fae783ac7a97d506fe1da.zip |
Renamed server to minion and client to overlord
Diffstat (limited to 'overlord/test_func.py')
-rw-r--r-- | overlord/test_func.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/overlord/test_func.py b/overlord/test_func.py new file mode 100644 index 0000000..bcce45d --- /dev/null +++ b/overlord/test_func.py @@ -0,0 +1,51 @@ +#!/usr/bin/python + + +# FIXME: should import the client lib, not XMLRPC lib, when we are done + +import xmlrpclib + +TEST_PROCESS = False +TEST_VIRT = False +TEST_SERVICES = False +TEST_HARDWARE = False +TEST_SMART = True + +# get a connecton (to be replaced by client lib logic) +s = xmlrpclib.ServerProxy("http://127.0.0.1:51234") + +# here's the basic test... +print s.test.add(1, 2) + +if TEST_SMART: + print s.smart.info() + +if TEST_PROCESS: + print s.process.info() + # print s.process.pkill("thunderbird") + +# here's the service module testing +if TEST_SERVICES: + print s.service.restart("httpd") + +if TEST_HARDWARE: + print s.hardware.info() + +# this is so I can remember how the virt module works +if TEST_VIRT: + + # example of using koan to install a virtual machine + #s.virt_install("mdehaan.rdu.redhat.com","profileX") + + # wait ... + vms = s.virt.list_vms() + # example of stopping all stopped virtual machines + print "list of virtual instances = %s" % vms + for vm in vms: + status = s.virt.status(vm) + print status + if status == "shutdown": + s.virt.start(vm) + +# add more tests here + |