Yeela Kaplan has uploaded a new change for review. Change subject: vdscliTests: add a test for connect with a timeout ......................................................................
vdscliTests: add a test for connect with a timeout Change-Id: I21793986338a00caa1163c7f9297d160a9d1fc45 Signed-off-by: Yeela Kaplan <[email protected]> --- M tests/vdsClientTests.py 1 file changed, 19 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/06/38806/1 diff --git a/tests/vdsClientTests.py b/tests/vdsClientTests.py index 3556018..c928f98 100644 --- a/tests/vdsClientTests.py +++ b/tests/vdsClientTests.py @@ -23,9 +23,10 @@ import sys from tempfile import mkstemp from contextlib import contextmanager +from _ssl import SSLError from testlib import VdsmTestCase as TestCaseBase -from testValidation import brokentest +from testValidation import brokentest, ValidateRunningAsRoot from monkeypatch import MonkeyPatch from vdsm import vdscli @@ -521,6 +522,23 @@ 'key3': 'val3'}) +class ConnectTest(TestCaseBase): + + @ValidateRunningAsRoot + def testTimeout(self): + c = vdscli.connect(useSSL=True, + tsPath='/etc/pki/vdsm', + timeout=0.01) + self.assertRaises(SSLError, c.getVdsStats) + + @ValidateRunningAsRoot + def testNoTimeout(self): + c = vdscli.connect(useSSL=True, + tsPath='/etc/pki/vdsm', + timeout=3) + self.assertNotRaises(c.getVdsStats) + + class CannonizeHostPortTest(TestCaseBase): def testNoArguments(self): -- To view, visit https://gerrit.ovirt.org/38806 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I21793986338a00caa1163c7f9297d160a9d1fc45 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Yeela Kaplan <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
