blob: 42d79af524df70e316464dea2fd3ddbfea2f1c32 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
|