From 7d7c0f4dc299dc342c53341f61ae4643eb134213 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 20 Sep 2007 16:44:02 -0400 Subject: Remove yaml libraries (configparser is good enough) plus remove references to virt-factory. --- client/test_func.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'client/test_func.py') diff --git a/client/test_func.py b/client/test_func.py index 35ce100..21c2009 100644 --- a/client/test_func.py +++ b/client/test_func.py @@ -1,6 +1,8 @@ #!/usr/bin/python +# FIXME: should import the client lib, not XMLRPC lib, when we are done + import xmlrpclib s = xmlrpclib.ServerProxy("http://127.0.0.1:51234") -- cgit From 0472b715a7137cb2958ae6c7b96495d1d880853a Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 20 Sep 2007 18:26:32 -0400 Subject: Implement a quickie service control module --- client/test_func.py | 1 + 1 file changed, 1 insertion(+) (limited to 'client/test_func.py') diff --git a/client/test_func.py b/client/test_func.py index 21c2009..ede9bbf 100644 --- a/client/test_func.py +++ b/client/test_func.py @@ -8,6 +8,7 @@ import xmlrpclib s = xmlrpclib.ServerProxy("http://127.0.0.1:51234") print s.test_add(1, 2) +print s.service_restart("httpd") -- cgit From 9cb28275cf20711009834d63e596dd389efe47f1 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 20 Sep 2007 19:02:53 -0400 Subject: Add test code for virt. --- client/test_func.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'client/test_func.py') diff --git a/client/test_func.py b/client/test_func.py index ede9bbf..a108c47 100644 --- a/client/test_func.py +++ b/client/test_func.py @@ -5,10 +5,33 @@ import xmlrpclib +TEST_VIRT = True +TEST_SERVICES = 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) -print s.service_restart("httpd") +# here's the service module testing +if TEST_SERVICES: + print s.service_restart("httpd") + +# 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","fc7webserver",False) + + # 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) + if status == "stopped": + s.virt_start(vm) +# add more tests here -- cgit