From 8d8ab7730a506d117cb61796df9d40aa1bc6cea9 Mon Sep 17 00:00:00 2001 From: Adrian Likins Date: Thu, 17 Jan 2008 16:40:33 -0500 Subject: add tests for process and service modules --- test/unittest/test_client.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'test') 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 -- cgit