Skip to content

Commit

Permalink
Fix extra output
Browse files Browse the repository at this point in the history
  • Loading branch information
perkfly committed Dec 25, 2023
1 parent 7493245 commit a5bde4d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
3 changes: 2 additions & 1 deletion tests/signatures/chrome_119.0.6045.199_macOS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ signature:
- 'sec-ch-ua-mobile: ?0'
- 'sec-ch-ua-platform: "macOS"'
- 'upgrade-insecure-requests: 1'
- 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
- 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
- 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7'
- 'sec-fetch-site: none'
- 'sec-fetch-mode: navigate'
Expand Down
3 changes: 1 addition & 2 deletions tests/signatures/chrome_120.0.6099.71_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ signature:
- 'sec-ch-ua-mobile: ?0'
- 'sec-ch-ua-platform: "Linux"'
- 'upgrade-insecure-requests: 1'
- 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/120.0.0.0 Safari/537.36'
- 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
- 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7'
- 'sec-fetch-site: none'
- 'sec-fetch-mode: navigate'
Expand Down
26 changes: 18 additions & 8 deletions tests/test_impersonate.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,21 @@ def browser_signatures():
# This ensures we will capture the correct traffic in tcpdump.
LOCAL_PORTS = (50000, 50100)

TEST_URLS = [
"https://www.wikimedia.org",
"https://www.wikipedia.org",
"https://www.mozilla.org/en-US/",
"https://www.apache.org",
"https://www.kernel.org",
"https://git-scm.com",
]

if os.getenv("GITHUB_ACTIONS") == "true":
TEST_URLS = [
"https://www.wikimedia.org",
"https://www.wikipedia.org",
"https://www.mozilla.org/en-US/",
"https://www.apache.org",
"https://www.kernel.org",
"https://git-scm.com",
]
else:
TEST_URLS = [
"https://tls.browserleaks.com/json",
"https://httpbin.org/ip",
]

# List of binaries and their expected signatures
CURL_BINARIES_AND_SIGNATURES = yaml.safe_load(open("./targets.yaml"))
Expand Down Expand Up @@ -187,12 +194,15 @@ def _run_curl(curl_binary, env_vars, extra_args, urls, output="/dev/null"):
curl_binary,
"-o",
output,
"-o",
output,
"--local-port",
f"{LOCAL_PORTS[0]}-{LOCAL_PORTS[1]}",
]
if extra_args:
args += extra_args
args.extend(urls)
logging.debug("runing curl with: %s", " ".join(args))

curl = subprocess.Popen(args, env=env)
return curl.wait(timeout=15)
Expand Down

0 comments on commit a5bde4d

Please sign in to comment.