source: test/do-live-tests.sh @ 262a093

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivelibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 262a093 was 262a093, checked in by Richard Sanger <rsangerarj@…>, 8 years ago

Adds tests for the Live Linux formats, int: ring: and pcapint:

Launch from test/do-live-tests.sh (needs root)
Alternatively test/netns-env <command>, bash can be used here useful for debugging etc.

This runs tests in separate network namespace with two virtual adapters, this is isolated from the kernels influence so that the only traffic is that which we create.

  • test-live.c - Tests sending and receiving 100 packets from one format to another between to virtual ports
    • Tests read/write, wirelength, capturelength, packet order/integrity, timestamps, ability to set direction/snap lengths and trace statistics
  • test-live-snaplen.c Tests that snap length works correctly via trace_config(), does basic checks on the wire and capture lengths returned

Limitations

  • Doesn't support BSD yet
  • DPDK included but probably not working in master
  • Doesn't test BPF filters
  • Requires root to run

Found some existing issues :(, fixes to which will be in the following commits.

  • Property mode set to 100644
File size: 604 bytes
Line 
1#!/bin/bash
2
3OK=0
4FAIL=""
5
6do_test() {
7        if $@; then
8                OK=$[ $OK + 1 ]
9        else
10                FAIL="$FAIL
11$@"
12        fi
13}
14
15if [[ -z "$GOT_NETNS" ]]; then
16        ./netns-env.sh "./$0"
17        exit 0
18fi
19
20libdir=../lib/.libs:../libpacketdump/.libs
21export LD_LIBRARY_PATH="$libdir"
22export DYLD_LIBRARY_PATH="${libdir}"
23
24declare -a formats=("pcapint" "int" "ring")
25
26for a in "${formats[@]}"
27do
28        for b in "${formats[@]}"
29        do
30                echo
31                echo ./test-live "$a" "$b"
32                do_test ./test-live "$a" "$b"
33                echo
34                echo ./test-live-snaplen "$a" "$b"
35                do_test ./test-live-snaplen "$a" "$b"
36        done
37done
38
39echo
40echo "Tests passed: $OK"
41echo "Tests failed: $FAIL"
Note: See TracBrowser for help on using the repository browser.