Skip to contentSkip to conversation

Any config needed for packetdrill testing?

Question Hangbin Liu 3 participants 4 messages Apr 14, 2025 – Apr 15, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Willem,

I tried to run packetdrill in selftest, but doesn't work. e.g.

# rpm -q packetdrill
packetdrill-2.0~20220927gitc556afb-10.fc41.x86_64
# make mrproper
# vng --build \
            --config tools/testing/selftests/net/packetdrill/config \
            --config kernel/configs/debug.config
# vng -v --run . --user root --cpus 4 -- \
            make -C tools/testing/selftests TARGETS=net/packetdrill run_tests
make: Entering directory '/home/net/tools/testing/selftests'
make[1]: Nothing to be done for 'all'.
TAP version 13                                                                                                                  1..66
# timeout set to 45
# selftests: net/packetdrill: tcp_blocking_blocking-accept.pkt
# TAP version 13
# 1..2
#
not ok 1 selftests: net/packetdrill: tcp_blocking_blocking-accept.pkt # TIMEOUT 45 seconds
# timeout set to 45
# selftests: net/packetdrill: tcp_blocking_blocking-connect.pkt
# TAP version 13
# 1..2
# tcp_blocking_blocking-connect.pkt:13: error handling packet: live packet field ipv4_total_length: expected: 40 (0x28) vs actua
l: 60 (0x3c)
# script packet:  0.234272 . 1:1(0) ack 1
# actual packet:  1.136447 S 0:0(0) win 65535 <mss 1460,sackOK,TS val 3684156121 ecr 0,nop,wscale 8>
# not ok 1 ipv4
# ok 2 ipv6
# # Totals: pass:1 fail:1 xfail:0 xpass:0 skip:0 error:0
not ok 2 selftests: net/packetdrill: tcp_blocking_blocking-connect.pkt # exit=1

All the test failed. Even I use ksft_runner.sh it also failed.

# ./ksft_runner.sh tcp_inq_client.pkt
TAP version 13
1..2
tcp_inq_client.pkt:17: error handling packet: live packet field ipv4_total_length: expected: 52 (0x34) vs actual: 60 (0x3c)
script packet:  0.013980 . 1:1(0) ack 1 <nop,nop,TS val 200 ecr 700>
actual packet:  1.056058 S 0:0(0) win 65535 <mss 1460,sackOK,TS val 1154 ecr 0,nop,wscale 8>
not ok 1 ipv4
ok 2 ipv6
# Totals: pass:1 fail:1 xfail:0 xpass:0 skip:0 error:0
# echo $?
1

Is there any special config needed for packetdrill testing?

Thanks
Hangbin

maintainer
#1 lore raw
Quoted 48 lines · On Mon, 14 Apr 2025 12:52:19 +0000 Hangbin Liu wrote:

Hi Willem,

I tried to run packetdrill in selftest, but doesn't work. e.g.

# rpm -q packetdrill
packetdrill-2.0~20220927gitc556afb-10.fc41.x86_64
# make mrproper
# vng --build \
            --config tools/testing/selftests/net/packetdrill/config \
            --config kernel/configs/debug.config
# vng -v --run . --user root --cpus 4 -- \
            make -C tools/testing/selftests TARGETS=net/packetdrill run_tests
make: Entering directory '/home/net/tools/testing/selftests'
make[1]: Nothing to be done for 'all'.
TAP version 13                                                                                                                  1..66
# timeout set to 45
# selftests: net/packetdrill: tcp_blocking_blocking-accept.pkt
# TAP version 13
# 1..2
#
not ok 1 selftests: net/packetdrill: tcp_blocking_blocking-accept.pkt # TIMEOUT 45 seconds
# timeout set to 45
# selftests: net/packetdrill: tcp_blocking_blocking-connect.pkt
# TAP version 13
# 1..2
# tcp_blocking_blocking-connect.pkt:13: error handling packet: live packet field ipv4_total_length: expected: 40 (0x28) vs actua
l: 60 (0x3c)
# script packet:  0.234272 . 1:1(0) ack 1
# actual packet:  1.136447 S 0:0(0) win 65535 <mss 1460,sackOK,TS val 3684156121 ecr 0,nop,wscale 8>
# not ok 1 ipv4
# ok 2 ipv6
# # Totals: pass:1 fail:1 xfail:0 xpass:0 skip:0 error:0
not ok 2 selftests: net/packetdrill: tcp_blocking_blocking-connect.pkt # exit=1

All the test failed. Even I use ksft_runner.sh it also failed.

# ./ksft_runner.sh tcp_inq_client.pkt
TAP version 13
1..2
tcp_inq_client.pkt:17: error handling packet: live packet field ipv4_total_length: expected: 52 (0x34) vs actual: 60 (0x3c)
script packet:  0.013980 . 1:1(0) ack 1 <nop,nop,TS val 200 ecr 700>
actual packet:  1.056058 S 0:0(0) win 65535 <mss 1460,sackOK,TS val 1154 ecr 0,nop,wscale 8>
not ok 1 ipv4
ok 2 ipv6
# Totals: pass:1 fail:1 xfail:0 xpass:0 skip:0 error:0
# echo $?
1
Quoted 1 line

Is there any special config needed for packetdrill testing?

FWIW we don't do anything special for packetdrill in NIPA. Here is the config and the build logs:

https://netdev-3.bots.linux.dev/vmksft-packetdrill/results/75222/config
https://netdev-3.bots.linux.dev/vmksft-packetdrill/results/77484/build/

#2 lore raw
Quoted 49 lines · Jakub Kicinski
Quoted 48 lines · On Mon, 14 Apr 2025 12:52:19 +0000 Hangbin Liu wrote:

Hi Willem,

I tried to run packetdrill in selftest, but doesn't work. e.g.

# rpm -q packetdrill
packetdrill-2.0~20220927gitc556afb-10.fc41.x86_64
# make mrproper
# vng --build \
            --config tools/testing/selftests/net/packetdrill/config \
            --config kernel/configs/debug.config
# vng -v --run . --user root --cpus 4 -- \
            make -C tools/testing/selftests TARGETS=net/packetdrill run_tests
make: Entering directory '/home/net/tools/testing/selftests'
make[1]: Nothing to be done for 'all'.
TAP version 13                                                                                                                  1..66
# timeout set to 45
# selftests: net/packetdrill: tcp_blocking_blocking-accept.pkt
# TAP version 13
# 1..2
#
not ok 1 selftests: net/packetdrill: tcp_blocking_blocking-accept.pkt # TIMEOUT 45 seconds
# timeout set to 45
# selftests: net/packetdrill: tcp_blocking_blocking-connect.pkt
# TAP version 13
# 1..2
# tcp_blocking_blocking-connect.pkt:13: error handling packet: live packet field ipv4_total_length: expected: 40 (0x28) vs actua
l: 60 (0x3c)
# script packet:  0.234272 . 1:1(0) ack 1
# actual packet:  1.136447 S 0:0(0) win 65535 <mss 1460,sackOK,TS val 3684156121 ecr 0,nop,wscale 8>
# not ok 1 ipv4
# ok 2 ipv6
# # Totals: pass:1 fail:1 xfail:0 xpass:0 skip:0 error:0
not ok 2 selftests: net/packetdrill: tcp_blocking_blocking-connect.pkt # exit=1

All the test failed. Even I use ksft_runner.sh it also failed.

# ./ksft_runner.sh tcp_inq_client.pkt
TAP version 13
1..2
tcp_inq_client.pkt:17: error handling packet: live packet field ipv4_total_length: expected: 52 (0x34) vs actual: 60 (0x3c)
script packet:  0.013980 . 1:1(0) ack 1 <nop,nop,TS val 200 ecr 700>
actual packet:  1.056058 S 0:0(0) win 65535 <mss 1460,sackOK,TS val 1154 ecr 0,nop,wscale 8>
not ok 1 ipv4
ok 2 ipv6
# Totals: pass:1 fail:1 xfail:0 xpass:0 skip:0 error:0
# echo $?
1
Quoted 7 lines
Quoted 1 line

Is there any special config needed for packetdrill testing?

FWIW we don't do anything special for packetdrill in NIPA. Here is the config and the build logs:

https://netdev-3.bots.linux.dev/vmksft-packetdrill/results/75222/config
https://netdev-3.bots.linux.dev/vmksft-packetdrill/results/77484/build/

Nothing special should be required, indeed.

Individual git commits also have explicit examples of how the code was built and tested. Such as

commit 88395c071f08 ("selftests/net: packetdrill: import tcp/ecn, tcp/close, tcp/sack, tcp/tcp_info")

    make mrproper
    vng --build \
        --config tools/testing/selftests/net/packetdrill/config \
        --config kernel/configs/debug.config
    vng -v --run . --user root --cpus 4 -- \
        make -C tools/testing/selftests TARGETS=net/packetdrill run_tests

and commit 8a405552fd3b ("selftests/net: integrate packetdrill with ksft"):

    Tested:
            make -C tools/testing/selftests \
              TARGETS=net/packetdrill \
              run_tests
    
            make -C tools/testing/selftests \
              TARGETS=net/packetdrill \
              install INSTALL_PATH=$KSFT_INSTALL_PATH
    
            # in virtme-ng
            ./run_kselftest.sh -c net/packetdrill
            ./run_kselftest.sh -t net/packetdrill:tcp_inq_client.pkt
#3 lore raw
Quoted 74 lines · Willem de Bruijn
Quoted 49 lines · Jakub Kicinski
Quoted 48 lines · On Mon, 14 Apr 2025 12:52:19 +0000 Hangbin Liu wrote:

Hi Willem,

I tried to run packetdrill in selftest, but doesn't work. e.g.

# rpm -q packetdrill
packetdrill-2.0~20220927gitc556afb-10.fc41.x86_64
# make mrproper
# vng --build \
            --config tools/testing/selftests/net/packetdrill/config \
            --config kernel/configs/debug.config
# vng -v --run . --user root --cpus 4 -- \
            make -C tools/testing/selftests TARGETS=net/packetdrill run_tests
make: Entering directory '/home/net/tools/testing/selftests'
make[1]: Nothing to be done for 'all'.
TAP version 13                                                                                                                  1..66
# timeout set to 45
# selftests: net/packetdrill: tcp_blocking_blocking-accept.pkt
# TAP version 13
# 1..2
#
not ok 1 selftests: net/packetdrill: tcp_blocking_blocking-accept.pkt # TIMEOUT 45 seconds
# timeout set to 45
# selftests: net/packetdrill: tcp_blocking_blocking-connect.pkt
# TAP version 13
# 1..2
# tcp_blocking_blocking-connect.pkt:13: error handling packet: live packet field ipv4_total_length: expected: 40 (0x28) vs actua
l: 60 (0x3c)
# script packet:  0.234272 . 1:1(0) ack 1
# actual packet:  1.136447 S 0:0(0) win 65535 <mss 1460,sackOK,TS val 3684156121 ecr 0,nop,wscale 8>
# not ok 1 ipv4
# ok 2 ipv6
# # Totals: pass:1 fail:1 xfail:0 xpass:0 skip:0 error:0
not ok 2 selftests: net/packetdrill: tcp_blocking_blocking-connect.pkt # exit=1

All the test failed. Even I use ksft_runner.sh it also failed.

# ./ksft_runner.sh tcp_inq_client.pkt
TAP version 13
1..2
tcp_inq_client.pkt:17: error handling packet: live packet field ipv4_total_length: expected: 52 (0x34) vs actual: 60 (0x3c)
script packet:  0.013980 . 1:1(0) ack 1 <nop,nop,TS val 200 ecr 700>
actual packet:  1.056058 S 0:0(0) win 65535 <mss 1460,sackOK,TS val 1154 ecr 0,nop,wscale 8>
not ok 1 ipv4
ok 2 ipv6
# Totals: pass:1 fail:1 xfail:0 xpass:0 skip:0 error:0
# echo $?
1
Quoted 7 lines
Quoted 1 line

Is there any special config needed for packetdrill testing?

FWIW we don't do anything special for packetdrill in NIPA. Here is the config and the build logs:

https://netdev-3.bots.linux.dev/vmksft-packetdrill/results/75222/config
https://netdev-3.bots.linux.dev/vmksft-packetdrill/results/77484/build/

Nothing special should be required, indeed.

Individual git commits also have explicit examples of how the code was built and tested. Such as

commit 88395c071f08 ("selftests/net: packetdrill: import tcp/ecn, tcp/close, tcp/sack, tcp/tcp_info")

    make mrproper
    vng --build \
        --config tools/testing/selftests/net/packetdrill/config \
        --config kernel/configs/debug.config
    vng -v --run . --user root --cpus 4 -- \
        make -C tools/testing/selftests TARGETS=net/packetdrill run_tests

and commit 8a405552fd3b ("selftests/net: integrate packetdrill with ksft"):

Quoted 12 lines
    Tested:
            make -C tools/testing/selftests \
              TARGETS=net/packetdrill \
              run_tests
    
            make -C tools/testing/selftests \
              TARGETS=net/packetdrill \
              install INSTALL_PATH=$KSFT_INSTALL_PATH
    
            # in virtme-ng
            ./run_kselftest.sh -c net/packetdrill
            ./run_kselftest.sh -t net/packetdrill:tcp_inq_client.pkt

Thanks, after debugging, I found the fedora packetdrill using cmake to build, which cause the all the test failed. After using glibc-static to build the packetdrill, all the test passed.

Although I'm not sure why cmake does not work.

Thanks
Hangbin