-
Notifications
You must be signed in to change notification settings - Fork 73
/
rss-ladder-test
executable file
·36 lines (32 loc) · 845 Bytes
/
rss-ladder-test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
set -euo pipefail
testdata=./tests/rss-ladder.tests/
run_test() {
local name="$1"
local rc=0
local params
echo -n "# $name "
cp $testdata/$name/interrupts ./interrupts || return 1
cp $testdata/$name/lscpu_output ./lscpu_output || return 2
read -a params < $testdata/$name/params
rss-ladder --no-color --dry-run --test-dir $testdata/$name "${params[@]}" > ./output || return 3
cmp -s $testdata/$name/expected output || rc=$?
if [ "$rc" = '0' ]; then
echo OK
else
diff -U 0 $testdata/$name/expected output
if [ $(uname) == 'Darwin' ]; then
md5 $testdata/$name/expected output
else
md5sum $testdata/$name/expected output
fi
echo FAIL
fi
return "$rc"
}
retval=0
for test in ixgbe.E5645 igb.E5606 mlx5.Q6700; do
run_test $test || retval=1
done
rm -f interrupts lscpu_output output
exit $retval