TUN-4178: Fix component test for running as a service in MacOS to not assume a named tunnel
This commit is contained in:
parent
0929e5f0ff
commit
1720ac0fc6
|
@ -7,21 +7,17 @@ from util import start_cloudflared, wait_tunnel_ready, send_requests
|
||||||
# Rolling logger rotate log files after 1 MB
|
# Rolling logger rotate log files after 1 MB
|
||||||
rotate_after_size = 1000 * 1000
|
rotate_after_size = 1000 * 1000
|
||||||
default_log_file = "cloudflared.log"
|
default_log_file = "cloudflared.log"
|
||||||
expect_message = "Starting tunnel"
|
expect_message = "Starting Hello World server"
|
||||||
|
|
||||||
|
|
||||||
def assert_log_to_terminal(cloudflared):
|
def assert_log_to_terminal(cloudflared):
|
||||||
stderr = cloudflared.stderr.read(200)
|
stderr = cloudflared.stderr.read(1250)
|
||||||
# cloudflared logs the following when it first starts
|
|
||||||
# 2021-03-10T12:30:39Z INF Starting tunnel tunnelID=<tunnel ID>
|
|
||||||
assert expect_message.encode() in stderr, f"{stderr} doesn't contain {expect_message}"
|
assert expect_message.encode() in stderr, f"{stderr} doesn't contain {expect_message}"
|
||||||
|
|
||||||
|
|
||||||
def assert_log_in_file(file):
|
def assert_log_in_file(file):
|
||||||
with open(file, "r") as f:
|
with open(file, "r") as f:
|
||||||
log = f.read(200)
|
log = f.read(1500)
|
||||||
# cloudflared logs the following when it first starts
|
|
||||||
# {"level":"info","tunnelID":"<tunnel ID>","time":"2021-03-10T12:21:13Z","message":"Starting tunnel"}
|
|
||||||
assert expect_message in log, f"{log} doesn't contain {expect_message}"
|
assert expect_message in log, f"{log} doesn't contain {expect_message}"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue