diff options
author | Devan Goodwin <dgoodwin@dangerouslyinc.com> | 2007-10-02 21:42:47 -0300 |
---|---|---|
committer | James Bowes <jbowes@redhat.com> | 2007-10-02 21:33:49 -0400 |
commit | 1ce955ec36f775d8fde2cb9d7943178e8b9d60da (patch) | |
tree | 4c69d218fde87091d4e5d1f3138a435b9164dbf4 /func/overlord/test_func.py | |
parent | 3c13a4f30f247f4aa75c02c65e6bb6e575e30d01 (diff) | |
download | third_party-func-1ce955ec36f775d8fde2cb9d7943178e8b9d60da.tar.gz third_party-func-1ce955ec36f775d8fde2cb9d7943178e8b9d60da.tar.xz third_party-func-1ce955ec36f775d8fde2cb9d7943178e8b9d60da.zip |
Moved code under the func namespace.
Previously we had overlord, minion, modules, and func all at the root of
the source tree. After install these would all be shuffled below func.
Relocated them in the source tree to reflect this.
Diffstat (limited to 'func/overlord/test_func.py')
-rw-r--r-- | func/overlord/test_func.py | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/func/overlord/test_func.py b/func/overlord/test_func.py new file mode 100644 index 0000000..2b3f041 --- /dev/null +++ b/func/overlord/test_func.py @@ -0,0 +1,61 @@ +#!/usr/bin/python + + +# FIXME: should import the client lib, not XMLRPC lib, when we are done + +import xmlrpclib +import sys + +TEST_GETATTR = True +TEST_PROCESS = False +TEST_VIRT = False +TEST_SERVICES = False +TEST_HARDWARE = False +TEST_SMART = True + +if TEST_GETATTR: + import func.overlord.client as func_client + print func_client.Client("*").hardware.pci_info() + #print func_client.Client("*").test.add(1,2) + #print func_client.Client("*").hardware.info() + #print func_client.Client("*").run("hardware","info",[]) + #print func_client.Client(socket.gethostname(),noglobs=True).test.add("1","2") + sys.exit(1) + +# 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 |