Skip to content

Commit

Permalink
test: exit if ua2f failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Dec 17, 2024
1 parent a6e4492 commit 0eb9478
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ def start_server():
t6.start()

def start_ua2f(u: str):
p = subprocess.Popen([u])
atexit.register(lambda: p.kill())
try:
out = subprocess.check_output([u])
print(out)
except Exception as e:
print(e)
exit(-1)


def setup_iptables():
Expand Down Expand Up @@ -92,6 +96,9 @@ def assert_equal(actual, expected):
response = requests.get(f"http://127.0.0.1:{PORT}", headers={
"User-Agent": nxt
})
if not response.ok:
print(response.status_code)
print(response.text)
assert response.ok
assert response.text == str(len(nxt))

Expand Down

0 comments on commit 0eb9478

Please sign in to comment.