Skip to content

Commit

Permalink
packetblaster: Added simple selftest.sh
Browse files Browse the repository at this point in the history
This is a really simple test case that runs packetblaster on
$INTEL_TEST_INTEL10G_PCIDEVA (if defined) and just makes sure that it
runs for at least 5 seconds i.e. doesn't die on startup.
  • Loading branch information
lukego committed Jun 25, 2015
1 parent 095bd91 commit 299cdfe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Binary file added src/program/packetblaster/selftest.pcap
Binary file not shown.
19 changes: 19 additions & 0 deletions src/program/packetblaster/selftest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

echo "selftest: packetblaster"
if [ -z "${SNABB_TEST_INTEL10G_PCIDEVA}" ]; then
echo "selftest: skipping test - SNABB_TEST_INTEL10G_PCIDEVA undefined"
exit 43
fi

# Simple test: Just make sure packetblaster runs for a period of time
# (doesn't crash on startup).
timeout 5 ./snabb packetblaster replay program/packetblaster/selftest.pcap \
${SNABB_TEST_INTEL10G_PCIDEVA}
status=$?
if [ $status != 124 ]; then
echo "Error: expected timeout (124) but got ${status}"
exit 1
fi

echo "selftest: ok"

0 comments on commit 299cdfe

Please sign in to comment.