Skip to content

Commit 87156b0

Browse files
committed
Address review comments, change variable naming
1 parent 720fc18 commit 87156b0

12 files changed

Lines changed: 25 additions & 12 deletions

tests/test-client-handles-client-closes-connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
ghostunnel = None
1010
try:
11-
__root__ = create_default_certs()
11+
_root = create_default_certs() # keep RootCert alive for cert lifecycle
1212
ghostunnel = start_ghostunnel_client(extra_args=['--close-timeout=10s'])
1313

1414
# connect to server, confirm that the tunnel is up

tests/test-client-handles-no-server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
ghostunnel = None
1010
try:
11-
__root__ = create_default_certs()
11+
_root = create_default_certs() # keep RootCert alive for cert lifecycle
1212
ghostunnel = start_ghostunnel_client()
1313

1414
# client should fail to connect since nothing is listening on wrong_port
1515
wrong_port = get_free_port()
1616
try:
17-
_pair = SocketPair(TcpClient(LISTEN_PORT), TlsServer(
17+
SocketPair(TcpClient(LISTEN_PORT), TlsServer(
1818
'server', 'root', wrong_port))
1919
raise Exception('client should have failed to connect')
2020
except TimeoutError:

tests/test-client-handles-server-closes-connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
ghostunnel = None
1010
try:
11-
__root__ = create_default_certs()
11+
_root = create_default_certs() # keep RootCert alive for cert lifecycle
1212
ghostunnel = start_ghostunnel_client(extra_args=['--close-timeout=10s'])
1313

1414
# connect with client, confirm that the tunnel is up

tests/test-mutually-exclusive-client-flags.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
from common import LOCALHOST, RootCert, run_ghostunnel, terminate, assert_not_zero, LISTEN_PORT, TARGET_PORT
44

5+
ghostunnel1 = None
6+
ghostunnel2 = None
7+
ghostunnel3 = None
8+
ghostunnel4 = None
9+
ghostunnel5 = None
510
try:
611
# create certs
712
root = RootCert('root')

tests/test-mutually-exclusive-server-flags.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
from common import LOCALHOST, RootCert, run_ghostunnel, terminate, assert_not_zero, LISTEN_PORT, TARGET_PORT
44

5+
ghostunnel1 = None
6+
ghostunnel2 = None
7+
ghostunnel3 = None
8+
ghostunnel4 = None
9+
ghostunnel5 = None
10+
ghostunnel6 = None
511
try:
612
# create certs
713
root = RootCert('root')

tests/test-server-disable-authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
# connect with client2, confirm that the tunnel isn't up
5151
try:
52-
_pair = SocketPair(
52+
SocketPair(
5353
TlsClient('client2', 'root', LISTEN_PORT), TcpServer(TARGET_PORT))
5454
except ssl.SSLError as err:
5555
raise Exception(

tests/test-server-handles-client-closes-connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
ghostunnel = None
1010
try:
11-
__root__ = create_default_certs()
11+
_root = create_default_certs() # keep RootCert alive for cert lifecycle
1212
ghostunnel = start_ghostunnel_server(extra_args=['--close-timeout=10s'])
1313

1414
# connect with client, confirm that the tunnel is up

tests/test-server-handles-no-server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
ghostunnel = None
1010
try:
11-
__root__ = create_default_certs()
11+
_root = create_default_certs() # keep RootCert alive for cert lifecycle
1212
ghostunnel = start_ghostunnel_server()
1313

1414
# client should fail to connect since nothing is listening on wrong_port
1515
wrong_port = get_free_port()
1616
try:
17-
_pair = SocketPair(
17+
SocketPair(
1818
TlsClient('client', 'root', LISTEN_PORT), TcpServer(wrong_port))
1919
raise Exception('client should have failed to connect')
2020
except TimeoutError:

tests/test-server-handles-server-closes-connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
ghostunnel = None
1010
try:
11-
__root__ = create_default_certs()
11+
_root = create_default_certs() # keep RootCert alive for cert lifecycle
1212
ghostunnel = start_ghostunnel_server(extra_args=['--close-timeout=10s'])
1313

1414
# connect with client, confirm that the tunnel is up

tests/test-server-quiet-conn-logs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
print(err)
5555

5656
if 'opening pipe' in err.decode('utf-8'):
57-
raise Exception('ghostunnel logged connection log to stderr with --quiet=all')
57+
raise Exception('ghostunnel logged connection log to stderr with --quiet=conns')
5858

5959
print_ok('OK')
6060
finally:

0 commit comments

Comments
 (0)