Yaniv Bronhaim has uploaded a new change for review. Change subject: Adding supervdsm uts file ......................................................................
Adding supervdsm uts file Change-Id: I08880b12db8a6ca9cc57d74d2ef2a86980a5b097 Signed-off-by: Yaniv Bronhaim <[email protected]> --- M tests/Makefile.am A tests/superVdsmTests.py 2 files changed, 46 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/8600/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index a5e4c64..f16239c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -42,12 +42,14 @@ parted_utils_tests.py \ permutationTests.py \ persistentDictTests.py \ - restTests.py \ + remoteFileHandlerTests.py \ + resourceManagerTests.py \ restData.py \ + restTests.py \ + superVdsmTests.py \ tcTests.py \ vdsClientTests.py \ - remoteFileHandlerTests.py \ - resourceManagerTests.py + $(NULL) dist_noinst_DATA = \ run_tests_local.sh diff --git a/tests/superVdsmTests.py b/tests/superVdsmTests.py new file mode 100644 index 0000000..ecb876f --- /dev/null +++ b/tests/superVdsmTests.py @@ -0,0 +1,41 @@ +from testrunner import VdsmTestCase as TestCaseBase +import supervdsm +import testValidation +import tempfile + + +class TestSuperVdsm(TestCaseBase): + + def setUp(self): + self._proxy = supervdsm.getProxy() + + # changing default constants for test. remember to return the origin + # value + self._originpidfile = self._proxy.pidfile + self._origintimestempfile = self._proxy.timestamp + self._originsock = self._proxy.address + + # temporary values to run temporary svdsm + self._proxy.pidfile = tempfile.mkdtemp() + self._proxy.timestamp = tempfile.mkdtemp() + self._proxy.address = tempfile.mkdtemp() + + def tearDown(self): + self._proxy.kill() # cleanning old temp files + self._proxy.pidfile = self._originpidfile + self._proxy.timestamp = self._origintimestempfile + self._proxy.address = self._originsock + + def testIsSuperUp(self): + testValidation.checkSudo(['python', "supervdsmServer.py"]) + self._proxy.ping() # this call initiate svdsm + + self.assertTrue(self._proxy.isRunning()) + + def testKillSuper(self): + testValidation.checkSudo(['python', "supervdsmServer.py"]) + self._proxy.ping() + self._proxy.kill() + self.assertFail(self._proxy.isRunning()) + self._proxy.ping() # Launching vdsm after kill + self.assertTrue(self._proxy.isRunning()) -- To view, visit http://gerrit.ovirt.org/8600 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I08880b12db8a6ca9cc57d74d2ef2a86980a5b097 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Yaniv Bronhaim <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
