diff options
author | Hanoh Haim <hhaim@cisco.com> | 2015-06-24 14:03:29 +0300 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2015-06-24 14:03:29 +0300 |
commit | 8b52a31ed2c299b759f330c4f976b9c70f5765f4 (patch) | |
tree | 9d6da5438b5b56b1d2d57e6c13494b4e65d000e7 /scripts/automation/trex_control_plane/unit_tests/client_launching_test.py |
first version
Diffstat (limited to 'scripts/automation/trex_control_plane/unit_tests/client_launching_test.py')
-rwxr-xr-x | scripts/automation/trex_control_plane/unit_tests/client_launching_test.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/unit_tests/client_launching_test.py b/scripts/automation/trex_control_plane/unit_tests/client_launching_test.py new file mode 100755 index 00000000..42d79af5 --- /dev/null +++ b/scripts/automation/trex_control_plane/unit_tests/client_launching_test.py @@ -0,0 +1,31 @@ +#!/router/bin/python +from control_plane_general_test import CControlPlaneGeneral_Test +from Client.trex_client import CTRexClient + +import socket +from nose.tools import assert_raises + + +class CClientLaunching_Test(CControlPlaneGeneral_Test): + def __init__(self): + super(CClientLaunching_Test, self).__init__() + pass + + def setUp(self): + pass + + def test_wrong_hostname(self): + # self.tmp_server = CTRexClient('some-invalid-hostname') + assert_raises (socket.gaierror, CTRexClient, 'some-invalid-hostname' ) + + # perform this test only if server is down, but server machine is up + def test_refused_connection(self): + assert_raises (socket.error, CTRexClient, 'trex-dan') # Assuming 'trex-dan' server is down! otherwise test fails + + + def test_verbose_mode(self): + tmp_client = CTRexClient(self.trex_server_name, verbose = True) + pass + + def tearDown(self): + pass |