Skip to content

add new flag -D: Print the list of the network interfaces available on the system #230

add new flag -D: Print the list of the network interfaces available on the system

add new flag -D: Print the list of the network interfaces available on the system #230

Workflow file for this run

name: Test
on:
workflow_dispatch:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master", "dev" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
with:
go-version: '1.21'
- name: Set up deps
run: |
sudo apt-get install -y gcc flex bison make libelf-dev
- name: Build
run: make build
- name: Test
run: make test
- name: Store executable
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
with:
name: ptcpdump
path: ptcpdump
e2e-test:
name: e2e-test
needs: build
strategy:
fail-fast: false
matrix:
kernel:
- '5.4-20240515.073534'
- '5.10-20240515.073534'
# - '5.15-20240515.073534'
- '6.1-20240515.073534'
# - '6.6-20240515.073534'
- 'bpf-next-20240515.073534'
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- name: Retrieve stored ptcpdump executable
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4
with:
name: ptcpdump
path: ptcpdump
- name: Provision LVH VMs
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
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: Test default
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
bash /host/testdata/test_default.sh /host/ptcpdump/ptcpdump
- name: Test base
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
bash /host/testdata/test_base.sh /host/ptcpdump/ptcpdump
- name: Test filter by process name
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
bash /host/testdata/test_pname_filter.sh /host/ptcpdump/ptcpdump
- name: Test filter by process id
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
bash /host/testdata/test_pid_filter.sh /host/ptcpdump/ptcpdump
- name: Test read pcap file
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
bash /host/testdata/test_read_pcap.sh /host/ptcpdump/ptcpdump
- name: Test write pcap file
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
bash /host/testdata/test_write_pcap.sh /host/ptcpdump/ptcpdump
- name: Test write to stdout
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
bash /host/testdata/test_write_stdout.sh /host/ptcpdump/ptcpdump
- name: Test exist connections
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
bash /host/testdata/test_exist_connection.sh /host/ptcpdump/ptcpdump
- name: Test arp and icmp
if: ${{ !startsWith(matrix.kernel, '5.4') }}
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
bash /host/testdata/test_arp.sh /host/ptcpdump/ptcpdump
bash /host/testdata/test_icmp.sh /host/ptcpdump/ptcpdump
- name: Test run sub program
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
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@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
bash /host/testdata/test_nat.sh /host/ptcpdump/ptcpdump
- name: Test docker
uses: cilium/little-vm-helper@3c748d6fc9d6c44a433de85a66f70e8f7043be04 # v0.0.18
with:
provision: 'false'
cmd: |
set -ex
uname -a
cat /etc/issue
bash /host/testdata/test_docker.sh /host/ptcpdump/ptcpdump