-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce test_filter_by_comm.sh
Signed-off-by: spencercjh <[email protected]>
- Loading branch information
1 parent
2bfdc88
commit c5e874d
Showing
2 changed files
with
97 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
. $(dirname "$0")/common.sh | ||
set -ex | ||
|
||
CMD="$1" | ||
FILE_PREFIX="/tmp/kyanos" | ||
BEFORE_LNAME="${FILE_PREFIX}_filter_by_comm_before.log" | ||
AFTER_LNAME="${FILE_PREFIX}_filter_by_comm_after.log" | ||
|
||
function test_filter_by_comm() { | ||
openssl req -x509 -newkey rsa:2048 -keyout server.pem -out server.pem -days 365 -nodes -subj "/C=US/ST=California/L=San Francisco/O=My Company/CN=localhost" | ||
|
||
pip install --break-system-packages ssl || true | ||
|
||
# server start before kyanos | ||
timeout 40 python3 ./testdata/start_https_server.py & | ||
timeout 30 ${CMD} watch --debug-output http --comm python3 2>&1 | tee "${BEFORE_LNAME}" & | ||
sleep 10 | ||
curl --insecure https://127.0.0.1:4443 &>/dev/null || true | ||
wait | ||
|
||
cat "${BEFORE_LNAME}" | ||
cat "${BEFORE_LNAME}" | grep "127.0.0.1:4443" | ||
|
||
# server start after kyanos | ||
timeout 40 ${CMD} watch --debug-output http --comm python3 2>&1 | tee "${AFTER_LNAME}" & | ||
sleep 10 | ||
timeout 30 python3 ./testdata/start_https_server.py & | ||
curl --insecure https://127.0.0.1:4443 &>/dev/null || true | ||
wait | ||
|
||
cat "${AFTER_LNAME}" | ||
cat "${AFTER_LNAME}" | grep "127.0.0.1:4443" | ||
} | ||
|
||
function main() { | ||
test_filter_by_comm | ||
} | ||
|
||
main |