summaryrefslogtreecommitdiffstats
path: root/client/test_func.py
diff options
context:
space:
mode:
authorSeth Vidal <skvidal@fedoraproject.org>2007-09-20 21:28:51 -0400
committerSeth Vidal <skvidal@fedoraproject.org>2007-09-20 21:28:51 -0400
commit8d168259f1cb0af25a7ee342bd1c32cd5bfdd424 (patch)
tree9c1d80b6da18a902b03ba7b21ec6bd0a60aabbfa /client/test_func.py
parenta83c4bcc40aae7c8b8058d831667ee1e07a969dc (diff)
parent98010f591948fb4bf297c1c0c32def42f766edca (diff)
Merge branch 'master' of ssh://git.fedoraproject.org/git/hosted/func
* 'master' of ssh://git.fedoraproject.org/git/hosted/func: (27 commits) just a friendly reminder we are not vf_server, change I!*N domain Add virt module. Add test code for virt. add a very simple, very dumb commandline client: Remove messages.pot from po dir, since its automatically generated Get rid of extra / in module loading error pychecker cleanups Add po dir to git Prevent XMLRPC server from printing to console. Catch FuncException when the config file is missing and exit gracefully Implement a quickie service control module Removing VF items + misc cleanup Clean up some speclint warnings Baseobj bites the dust. remove all the --debug "try to run from the src tree" crap debug spew cleanup to protect the unwashed masses from foo poisoning fix up config_data to use ConfigParser correctly attempt to let us run with --debug flag to run from src checkout attempts at letting us run from a installed, or local modules ...
Diffstat (limited to 'client/test_func.py')
-rw-r--r--client/test_func.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/client/test_func.py b/client/test_func.py
index 35ce100..a108c47 100644
--- a/client/test_func.py
+++ b/client/test_func.py
@@ -1,11 +1,37 @@
#!/usr/bin/python
+# FIXME: should import the client lib, not XMLRPC lib, when we are done
+
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)
+# 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