diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-it.sh | 18 | ||||
-rw-r--r-- | test/unittest/test_client.py | 26 |
2 files changed, 28 insertions, 16 deletions
diff --git a/test/test-it.sh b/test/test-it.sh index 72f3224..fd93d62 100755 --- a/test/test-it.sh +++ b/test/test-it.sh @@ -273,25 +273,13 @@ run_unittests run_async_test stop_the_func -# see if funcd is running -# see if certmaster is installed -# see if cermtasterd is running - -# setup certs -## see if we have certs set up properly +# leaving the test cases with func not running is kind of +# annoying, so restart it +start_the_func ### probably do some stuff to test bad/no/malformed/unauthed certs as well -# see if we can connect to funcd with the overloard - -# see what modules we have available -# for each module, call the info stuff on them - -# / start walking over the modules, doing commandliney stuff to each, and -# trying to check return data and return code as much as possible - -# test shut down of init scripts diff --git a/test/unittest/test_client.py b/test/unittest/test_client.py index b7c5e7b..f4d56cc 100644 --- a/test/unittest/test_client.py +++ b/test/unittest/test_client.py @@ -13,11 +13,16 @@ import socket class BaseTest: # assume we are talking to localhost th = socket.gethostname() + nforks=1 + async=False + def __init__(self): pass def setUp(self): - self.client = fc.Client(self.th) + self.client = fc.Client(self.th, + nforks=self.nforks, + async=self.async) def test_module_version(self): mod = getattr(self.client, self.module) @@ -284,3 +289,22 @@ class TestSystem(BaseTest): +class TestAsyncTest(BaseTest): + module = "async.test" + nforks=4 + async=True + def test_sleep_async(self): + job_id = self.client.test.sleep(5) + print "job_id", job_id + (return_code, results) = self.client.job_status(job_id) +# self.assert_on_fault(results) + print "return_code", return_code + print "results", results + + def test_add_async(self): + job_id = self.client.test.add(1,5) + print "job_id", job_id + (return_code, results) = self.client.job_status(job_id) +# self.assert_on_fault(results) + print "return_code", return_code + print "results", results |