chore(deps): update golang:1.25.5-bookworm docker digest to cbd59ce #1066
This file contains hidden or 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
| name: Test | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ "master", "dev" ] | |
| pull_request: | |
| branches: [ "master", "dev" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-with-dynamic-link: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 | |
| with: | |
| # renovate: datasource=golang-version depName=golang | |
| go-version: '1.25.5' | |
| - name: Install Deps | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y gcc flex bison make libelf-dev autoconf libpcap-dev | |
| - name: Build | |
| run: | | |
| make build-dynamic-link | |
| - name: Test | |
| run: | | |
| file ./ptcpdump | grep 'dynamically linked' | |
| ldd ./ptcpdump | grep 'libpcap.so' | |
| sudo ./ptcpdump -i any -c 2 | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 | |
| with: | |
| # renovate: datasource=golang-version depName=golang | |
| go-version: '1.25.5' | |
| - name: Build | |
| run: make build-via-docker COVERAGE_FLAG='-cover' | |
| - name: Store executable | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| with: | |
| name: ptcpdump | |
| path: ptcpdump | |
| run-with-docker: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: test running with docker | |
| run: | | |
| bash testdata/test_run_with_docker.sh "quay.io/ptcpdump/ptcpdump:latest" | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| env: | |
| GOCOVERDIR: '${{ github.workspace }}/coverage' | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 | |
| with: | |
| # renovate: datasource=golang-version depName=golang | |
| go-version: '1.25.5' | |
| - name: Install Deps | |
| run: | | |
| sudo apt-get install -y gcc flex bison make libelf-dev autoconf libpcap-dev | |
| make build | |
| - name: Test | |
| run: | | |
| mkdir ${{ env.GOCOVERDIR }} | |
| make test COVERAGE_FLAG='-cover' COVERAGE_ARGS='-args -test.gocoverdir=${{ env.GOCOVERDIR }}' | |
| - name: Store coverage | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| with: | |
| name: coverage.ut.out | |
| path: | | |
| ${{ env.GOCOVERDIR }}/* | |
| docker-integration-test: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| timeout-minutes: 15 | |
| env: | |
| GOCOVERDIR: '${{ github.workspace }}/coverage' | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Retrieve stored ptcpdump executable | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6 | |
| with: | |
| name: ptcpdump | |
| path: ./ | |
| - name: prepare | |
| run: | | |
| mkdir -p ${{ env.GOCOVERDIR }} | |
| chmod +x ./ptcpdump | |
| - name: test docker | |
| run: | | |
| sudo GOCOVERDIR=${{ env.GOCOVERDIR }} bash testdata/test_docker.sh ./ptcpdump | |
| - name: test filter by container id | |
| run: | | |
| sudo GOCOVERDIR=${{ env.GOCOVERDIR }} bash testdata/test_docker_container_id_filter.sh ./ptcpdump | |
| - name: test docker filter by container name | |
| run: | | |
| sudo GOCOVERDIR=${{ env.GOCOVERDIR }} bash testdata/test_docker_container_name_filter.sh ./ptcpdump | |
| - name: Store coverage | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| with: | |
| name: coverage.docker.out | |
| path: | | |
| ${{ env.GOCOVERDIR }}/* | |
| containerd-integration-test: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| timeout-minutes: 15 | |
| env: | |
| GOCOVERDIR: '${{ github.workspace }}/coverage' | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Retrieve stored ptcpdump executable | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6 | |
| with: | |
| name: ptcpdump | |
| path: ./ | |
| - name: ensure containerd | |
| run: | | |
| wget https://github.com/containerd/nerdctl/releases/download/v1.7.6/nerdctl-1.7.6-linux-amd64.tar.gz | |
| sudo tar Cxzvvf /usr/local/bin nerdctl-1.7.6-linux-amd64.tar.gz | |
| wget https://github.com/containernetworking/plugins/releases/download/v1.5.0/cni-plugins-linux-amd64-v1.5.0.tgz | |
| sudo mkdir -p /opt/cni/bin | |
| sudo tar Cxzvvf /opt/cni/bin cni-plugins-linux-amd64-v1.5.0.tgz | |
| - name: prepare | |
| run: | | |
| mkdir -p ${{ env.GOCOVERDIR }} | |
| chmod +x ./ptcpdump | |
| - name: test containerd | |
| run: | | |
| sudo GOCOVERDIR=${{ env.GOCOVERDIR }} bash testdata/test_containerd.sh ./ptcpdump | |
| - name: test filter by container id | |
| run: | | |
| sudo GOCOVERDIR=${{ env.GOCOVERDIR }} bash testdata/test_containerd_container_id_filter.sh ./ptcpdump | |
| - name: test docker filter by container name | |
| run: | | |
| sudo GOCOVERDIR=${{ env.GOCOVERDIR }} bash testdata/test_containerd_container_name_filter.sh ./ptcpdump | |
| - name: Store coverage | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| with: | |
| name: coverage.containerd.out | |
| path: | | |
| ${{ env.GOCOVERDIR }}/* | |
| k8s-integration-test: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| timeout-minutes: 20 | |
| env: | |
| GOCOVERDIR: '${{ github.workspace }}/coverage' | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Retrieve stored ptcpdump executable | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6 | |
| with: | |
| name: ptcpdump | |
| path: ./ | |
| - name: setup kind | |
| run: | | |
| wget https://github.com/kubernetes-sigs/kind/releases/download/v0.23.0/kind-linux-amd64 | |
| chmod +x kind-linux-amd64 | |
| sudo cp ./kind-linux-amd64 /usr/local/bin/kind | |
| IMG=kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e | |
| sudo docker pull "${IMG}" | |
| sudo docker pull alpine:3.18 | |
| sudo docker pull busybox:1 | |
| sudo kind create cluster | |
| sudo kind load docker-image alpine:3.18 | |
| sudo kind load docker-image busybox:1 | |
| sudo kind export kubeconfig | |
| sleep 30 | |
| sudo kubectl get sa default | |
| - name: prepare | |
| run: | | |
| mkdir -p ${{ env.GOCOVERDIR }} | |
| chmod +x ./ptcpdump | |
| - name: test k8s | |
| run: | | |
| sudo GOCOVERDIR=${{ env.GOCOVERDIR }} bash testdata/run_test_k8s.sh | |
| - name: test k8s filter by container id | |
| run: | | |
| sudo GOCOVERDIR=${{ env.GOCOVERDIR }} bash testdata/run_test_k8s_filter_by_container.sh | |
| - name: test k8s filter by pod name | |
| run: | | |
| sudo GOCOVERDIR=${{ env.GOCOVERDIR }} bash testdata/run_test_k8s_filter_by_pod.sh | |
| - name: test k8s filter by pod name with multiple containers | |
| run: | | |
| sudo GOCOVERDIR=${{ env.GOCOVERDIR }} bash testdata/run_test_k8s_filter_by_pod_2.sh | |
| - name: post test | |
| run: | | |
| if [ -d ${{ env.GOCOVERDIR }}/coverage ]; then | |
| sudo mv ${{ env.GOCOVERDIR }}/coverage/* ${{ env.GOCOVERDIR }}/ | |
| fi | |
| - name: Store coverage | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| with: | |
| name: coverage.k8s.out | |
| path: | | |
| ${{ env.GOCOVERDIR }}/* | |
| e2e-test: | |
| name: e2e-test | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| backend: | |
| - 'tc' | |
| - 'cgroup-skb' | |
| - 'tp-btf' | |
| - 'socket-filter' | |
| kernel: | |
| # renovate: datasource=docker depName=quay.io/lvh-images/kernel-images | |
| - '4.19-20250630.013259' | |
| # renovate: datasource=docker depName=quay.io/lvh-images/kernel-images | |
| - '5.4-20250630.013259' | |
| # renovate: datasource=docker depName=quay.io/lvh-images/kernel-images | |
| - '5.10-20250630.013259' | |
| # renovate: datasource=docker depName=quay.io/lvh-images/kernel-images | |
| - '5.15-20250630.013259' | |
| # renovate: datasource=docker depName=quay.io/lvh-images/kernel-images | |
| - '6.1-20250630.013259' | |
| # renovate: datasource=docker depName=quay.io/lvh-images/kernel-images | |
| - '6.6-20250630.013259' | |
| # renovate: datasource=docker depName=quay.io/lvh-images/kernel-images | |
| - '6.12-20250630.013259' | |
| # renovate: datasource=docker depName=quay.io/lvh-images/kernel-images | |
| - 'bpf-20250630.013259' | |
| # renovate: datasource=docker depName=quay.io/lvh-images/kernel-images | |
| - 'bpf-next-20250630.013259' | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| env: | |
| GOCOVERDIR: coverage | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - run: | | |
| if [ "${{ matrix.backend }}" = "tc" ]; then | |
| PTCPDUMP_EXTRA_ARGS='' | |
| elif [ "${{ matrix.backend }}" = "tp-btf" ]; then | |
| PTCPDUMP_EXTRA_ARGS='--backend tp-btf' | |
| elif [ "${{ matrix.backend }}" = "cgroup-skb" ]; then | |
| PTCPDUMP_EXTRA_ARGS='--backend cgroup-skb' | |
| elif [ "${{ matrix.backend }}" = "socket-filter" ]; then | |
| PTCPDUMP_EXTRA_ARGS='--backend socket-filter' | |
| else | |
| PTCPDUMP_EXTRA_ARGS='--backend tc' | |
| fi | |
| echo "PTCPDUMP_EXTRA_ARGS=${PTCPDUMP_EXTRA_ARGS}" >> $GITHUB_ENV | |
| mkdir $GOCOVERDIR | |
| - name: Retrieve stored ptcpdump executable | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6 | |
| 10BC0 with: | |
| name: ptcpdump | |
| path: ptcpdump | |
| - name: Provision LVH VMs | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| with: | |
| test-name: ptcpdump-test | |
| image-version: ${{ matrix.kernel }} | |
| cpu: 2 | |
| mem: '4G' | |
| host-mount: ./ | |
| install-dependencies: 'true' | |
| cmd: | | |
| chmod +x /host/ptcpdump/ptcpdump | |
| - name: download btf file | |
| if: ${{ startsWith(matrix.kernel, '4.') }} | |
| run: | | |
| img=quay.io/lvh-images/kernel-images:${{ matrix.kernel }} | |
| docker pull $img | |
| id=$(docker create $img) | |
| mkdir data/ | |
| docker cp $id:/data/kernels data/ | |
| ls -la data/ | |
| find data/ -path "*vmlinuz*" -type f | |
| find data/ -path "*btf*" -type f | |
| - name: copy btf file | |
| if: ${{ startsWith(matrix.kernel, '4.') }} | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| uname -a | |
| cat /etc/issue | |
| cat /etc/os-release | |
| sudo mkdir -p /var/lib/ptcpdump/btf/ | |
| sudo cp /host/data/kernels/4.*/boot/btf-4.* /var/lib/ptcpdump/btf/vmlinux | |
| # btf_file=$(find /host/ -path "*btf*" -type f) | |
| # sudo cp $btf_file /var/lib/ptcpdump/btf/vmlinux | |
| - name: Test default (ping) | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) }} | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/test_default.sh /host/ptcpdump/ptcpdump | |
| - name: Test base (curl) | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) || !(startsWith(matrix.kernel, '5.4') || startsWith(matrix.kernel, '4.')) }} | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/test_base.sh /host/ptcpdump/ptcpdump | |
| - name: Test parent info | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) || !(startsWith(matrix.kernel, '5.4') || startsWith(matrix.kernel, '4.')) }} | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/test_parent_info.sh /host/ptcpdump/ptcpdump | |
| - name: Test filter by process name | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) || !(startsWith(matrix.kernel, '5.4') || startsWith(matrix.kernel, '4.')) }} | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/test_pname_filter.sh /host/ptcpdump/ptcpdump | |
| - name: Test filter by process id | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) || !(startsWith(matrix.kernel, '5.4') || startsWith(matrix.kernel, '4.')) }} | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/test_pid_filter.sh /host/ptcpdump/ptcpdump | |
| - name: Test read pcap file | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) }} | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/test_read_pcap.sh /host/ptcpdump/ptcpdump | |
| - name: Test write pcap file | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) }} | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/test_write_pcap.sh /host/ptcpdump/ptcpdump | |
| - name: Test write to stdout | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) }} | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/test_write_stdout.sh /host/ptcpdump/ptcpdump | |
| - name: Test exist connections | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) || !(startsWith(matrix.kernel, '5.4') || startsWith(matrix.kernel, '4.')) }} | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/test_exist_connection.sh /host/ptcpdump/ptcpdump | |
| - name: Test arp and icmp | |
| if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) && (!startsWith(matrix.backend, 'cgroup-skb')) }} | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/test_arp.sh /host/ptcpdump/ptcpdump | |
| bash /host/testdata/test_icmp.sh /host/ptcpdump/ptcpdump | |
| - name: Test tun interface | |
| if: ${{ !startsWith(matrix.kernel, '4.') && !startsWith(matrix.kernel, '5.') }} | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| modprobe tun || { echo 'install tun mod failed'; exit 0; } | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/retry.sh 3 bash /host/testdata/test_tun.sh /host/ptcpdump/ptcpdump | |
| - name: Test netns | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) || (!startsWith(matrix.kernel, '5.4') && !startsWith(matrix.kernel, '4.') && !startsWith(matrix.backend, 'cgroup-skb')) }} | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/retry.sh 3 bash /host/testdata/test_netns.sh /host/ptcpdump/ptcpdump | |
| - name: Test netns newly (normal) | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) || (!startsWith(matrix.kernel, '5.4') && !startsWith(matrix.kernel, '4.') && !startsWith(matrix.backend, 'cgroup-skb')) }} | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/retry.sh 3 bash /host/testdata/test_netns_newly_normal.sh /host/ptcpdump/ptcpdump | |
| - name: Test netns newly (exec) | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) || (!startsWith(matrix.kernel, '5.4') && !startsWith(matrix.kernel, '4.') && !startsWith(matrix.backend, 'cgroup-skb')) }} | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/retry.sh 3 bash /host/testdata/test_netns_newly_exec.sh /host/ptcpdump/ptcpdump | |
| - name: Test run sub program | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) || !(startsWith(matrix.kernel, '5.4') || startsWith(matrix.kernel, '4.')) }} | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/test_sub_program.sh /host/ptcpdump/ptcpdump | |
| bash /host/testdata/test_sub_curl_domain_program.sh /host/ptcpdump/ptcpdump | |
| - name: Test NAT | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) }} | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/retry.sh 8 bash /host/testdata/test_nat.sh /host/ptcpdump/ptcpdump | |
| - name: Test rotate | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| if: ${{ (startsWith(matrix.backend, 'tc')) && (contains(matrix.kernel, 'next')) }} # no need test for all kernels | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| bash /host/testdata/retry.sh 5 bash /host/testdata/test_rotate_filesize.sh /host/ptcpdump/ptcpdump | |
| sleep 30 | |
| bash /host/testdata/retry.sh 5 bash /host/testdata/test_rotate_filesize_with_count.sh /host/ptcpdump/ptcpdump | |
| - name: build demo app | |
| if: false | |
| # if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) && (!startsWith(matrix.backend, 'tp')) }} | |
| run: | | |
| make -C testdata/gohttpapp build | |
| - name: Test go tls keylog (unstripped) | |
| if: false | |
| # if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) && (!startsWith(matrix.backend, 'tp')) }} | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| ls -lh /host/testdata/gohttpapp | |
| apt update && yes | apt install -y tshark | |
| bash /host/testdata/retry.sh 8 bash /host/testdata/test_gotls_keylog.sh /host/ptcpdump/ptcpdump gohttpapp | |
| - name: Test go tls keylog (PIE) | |
| if: false | |
| # if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) && (!startsWith(matrix.backend, 'tp')) }} | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| ls -lh /host/testdata/gohttpapp | |
| apt update && yes | apt install -y tshark | |
| bash /host/testdata/retry.sh 8 bash /host/testdata/test_gotls_keylog.sh /host/ptcpdump/ptcpdump gohttpapp_pie | |
| - name: Test go tls keylog (stripped) | |
| if: false | |
| # if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) && (!startsWith(matrix.backend, 'tp')) }} | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| ls -lh /host/testdata/gohttpapp | |
| apt update && yes | apt install -y tshark | |
| bash /host/testdata/retry.sh 8 bash /host/testdata/test_gotls_keylog.sh /host/ptcpdump/ptcpdump gohttpapp_stripped | |
| - name: Test go tls keylog (stripped + PIE) | |
| if: false | |
| # if: ${{ (!startsWith(matrix.kernel, '5.4')) && (!startsWith(matrix.kernel, '4.')) && (!startsWith(matrix.backend, 'tp')) }} | |
| uses: cilium/little-vm-helper@ad43ff511dd5365a0011ae9f864ec959c36daebf # v0.0.28 | |
| with: | |
| provision: 'false' | |
| cmd: | | |
| set -ex | |
| export PTCPDUMP_EXTRA_ARGS="${{ env.PTCPDUMP_EXTRA_ARGS }}" | |
| export GOCOVERDIR="/host/${{ env.GOCOVERDIR }}" | |
| ls -lh /host/testdata/gohttpapp | |
| apt update && yes | apt install -y tshark | |
| bash /host/testdata/retry.sh 8 bash /host/testdata/test_gotls_keylog.sh /host/ptcpdump/ptcpdump gohttpapp_stripped_pie | |
| - name: upload coverage | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| if: ${{ startsWith(matrix.backend, 'tc') || (startsWith(matrix.backend, 'socket-filter') && !startsWith(matrix.kernel, '4.') ) || !(startsWith(matrix.kernel, '5.4') || startsWith(matrix.kernel, '4.')) }} | |
| with: | |
| name: coverage.e2e.${{ matrix.backend }}.${{ matrix.kernel }}.out | |
| path: | | |
| coverage/* | |
| coverage: | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| needs: | |
| - unit-test | |
| - e2e-test | |
| - docker-integration-test | |
| - containerd-integration-test | |
| - k8s-integration-test | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: download coverage | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6 | |
| with: | |
| pattern: 'coverage.*' | |
| merge-multiple: true | |
| path: coverage | |
| - name: merge coverage | |
| run: | | |
| set -ex | |
| ls -l coverage/ | |
| go tool covdata textfmt -i=coverage -o coverage.out | |
| ls -lh *.out | |
| cat coverage.out | |
| - name: upload coverage to Coveralls | |
| uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2 | |
| with: | |
| file: 'coverage.out' | |
| format: 'golang' |