-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
78 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,84 @@ jobs: | |
- name: Test | ||
run: make test | ||
|
||
- name: Store executable | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ptcpdump | ||
path: ptcpdump | ||
|
||
|
||
e2e-test: | ||
runs-on: ubuntu-latest | ||
name: e2e-test | ||
needs: build | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
kernel: [ '5.10-v0.3', '5.15-v0.3', '6.3-main', 'bpf-next-20231030.012704' ] | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Retrieve stored ptcpdump executable | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ptcpdump | ||
path: ptcpdump | ||
|
||
- name: Provision LVH VMs | ||
uses: cilium/[email protected] | ||
with: | ||
test-name: ptcpdump-test | ||
image-version: ${{ matrix.kernel }} | ||
host-mount: ./ | ||
dns-resolver: '1.1.1.1' | ||
install-dependencies: 'true' | ||
cmd: | | ||
chmod +x /host/ptcpdump/ptcpdump | ||
- name: Test base | ||
uses: cilium/[email protected] | ||
with: | ||
provision: 'false' | ||
dns-resolver: '1.1.1.1' | ||
cmd: | | ||
set -ex | ||
uname -a | ||
cat /etc/issue | ||
timeout 20s /host/ptcpdump/ptcpdump -c 1 -i any --print -w ptcpdump.pcapng 'dst host 1.1.1.1 and tcp[tcpflags] = tcp-syn' 2>&1 1>/tmp/log | (read _; curl 1.1.1.1 &>/dev/null || true) | ||
cat /tmp/log | ||
cat /tmp/log | grep '/usr/bin/curl' | ||
cat /tmp/log | grep -F ' > 1.1.1.1.80: Flags [S],' | ||
apt update && apt install -y tcpdump | ||
tcpdump -nr ./ptcpdump.pcapnp | ||
tcpdump -nr ./ptcpdump.pcapnp | grep -F ' > 1.1.1.1.80: Flags [S],' | ||
- name: Test filter by process | ||
uses: cilium/[email protected] | ||
with: | ||
provision: 'false' | ||
dns-resolver: '1.1.1.1' | ||
cmd: | | ||
set -ex | ||
uname -a | ||
cat /etc/issue | ||
timeout 20s /host/ptcpdump/ptcpdump -c 3 --pname curl --pid "$$" -f -i any --print -w ptcpdump.pcapng 2>&1 1>/tmp/log | (read _; curl 1.1.1.1 &>/dev/null || true) | ||
cat /tmp/log | ||
cat /tmp/log | grep '/usr/bin/curl' | ||
cat /tmp/log | grep -F ' > 1.1.1.1.80: Flags [S],' | ||
cat /tmp/log | grep -P '1.1.1.1.80 > .*: Flags \[S.\],' | ||
apt update && apt install -y tcpdump | ||
tcpdump -nr ./ptcpdump.pcapnp | ||
tcpdump -nr ./ptcpdump.pcapnp | grep -F ' > 1.1.1.1.80: Flags [S],' | ||
tcpdump -nr ./ptcpdump.pcapnp | grep -P '1.1.1.1.80 > .*: Flags \[S.\],' | ||
|
||
releaser-test: | ||
runs-on: ubuntu-latest | ||
|