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
|
||||
rotate_after_size = 1000 * 1000
|
||||
default_log_file = "cloudflared.log"
|
||||
expect_message = "Starting tunnel"
|
||||
expect_message = "Starting Hello World server"
|
||||
|
||||
|
||||
def assert_log_to_terminal(cloudflared):
|
||||
stderr = cloudflared.stderr.read(200)
|
||||
# cloudflared logs the following when it first starts
|
||||
# 2021-03-10T12:30:39Z INF Starting tunnel tunnelID=<tunnel ID>
|
||||
stderr = cloudflared.stderr.read(1250)
|
||||
assert expect_message.encode() in stderr, f"{stderr} doesn't contain {expect_message}"
|
||||
|
||||
|
||||
def assert_log_in_file(file):
|
||||
with open(file, "r") as f:
|
||||
log = f.read(200)
|
||||
# cloudflared logs the following when it first starts
|
||||
# {"level":"info","tunnelID":"<tunnel ID>","time":"2021-03-10T12:21:13Z","message":"Starting tunnel"}
|
||||
log = f.read(1500)
|
||||
assert expect_message in log, f"{log} doesn't contain {expect_message}"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue