summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAdrian Likins <alikins@grimlock.devel.redhat.com>2008-01-17 16:40:33 -0500
committerAdrian Likins <alikins@grimlock.devel.redhat.com>2008-01-17 16:40:33 -0500
commit8d8ab7730a506d117cb61796df9d40aa1bc6cea9 (patch)
tree2624f2a44fdb59f0ad537574b09ec18dc8919cd7 /test
parentbe3319b8e25b4f138e07f8d2d2039ef3eb6932a6 (diff)
downloadthird_party-func-8d8ab7730a506d117cb61796df9d40aa1bc6cea9.tar.gz
third_party-func-8d8ab7730a506d117cb61796df9d40aa1bc6cea9.tar.xz
third_party-func-8d8ab7730a506d117cb61796df9d40aa1bc6cea9.zip
add tests for process and service modules
Diffstat (limited to 'test')
-rw-r--r--test/unittest/test_client.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/unittest/test_client.py b/test/unittest/test_client.py
index f5d5edd..1670341 100644
--- a/test/unittest/test_client.py
+++ b/test/unittest/test_client.py
@@ -153,3 +153,37 @@ class TestNetworkTest(BaseTest):
assert type(result[self.th]) != xmlrpclib.Fault
+class TestProcess(BaseTest):
+ def test_info(self):
+ result = self.client.process.info()
+ assert type(result[self.th]) != xmlrpclib.Fault
+
+ def test_mem(self):
+ result = self.client.process.mem()
+ assert type(result[self.th]) != xmlrpclib.Fault
+
+ # FIXME: how to test kill/pkill? start a process with
+ # command and then kill it?
+
+
+class TestService(BaseTest):
+ def test_inventory(self):
+ result = self.client.service.inventory()
+ assert type(result[self.th]) != xmlrpclib.Fault
+
+ def test_get_enabled(self):
+ result = self.client.service.get_enabled()
+ assert type(result[self.th]) != xmlrpclib.Fault
+
+ def test_get_running(self):
+ result = self.client.service.get_running()
+ assert type(result[self.th]) != xmlrpclib.Fault
+
+ def test_get_status(self):
+ running_data = self.client.service.get_running()[self.th]
+ result = self.client.service.status(running_data[0][0])
+ assert type(result[self.th]) != xmlrpclib.Fault
+ assert result[self.th] == 0
+
+ #FIXME: whats a good way to test starting/stoping services without
+ # doing bad things? -akl