-
Notifications
You must be signed in to change notification settings - Fork 143
/
regress-io
47 lines (38 loc) · 916 Bytes
/
regress-io
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
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# test IO affinity parsing
# tests may fail depending on machine setup
testdir=`dirname "$0"`
: ${srcdir:=${testdir}/..}
: ${builddir:=${srcdir}}
export PATH=${builddir}:$PATH
E=0
check() {
echo testing $@
if "$@" ; then
true
else
echo failed
E=1
fi
}
fail() {
echo testing failure of $@
if "$@" ; then
echo failed
E=1
else
true
fi
}
check "${builddir}/test/node-parse" file:.
check "${builddir}/test/node-parse" ip:8.8.8.8
fail "${builddir}/test/node-parse" ip:127.0.0.1
IF=$(ip link ls | grep eth | cut -d: -f2 | head -1)
check "${builddir}/test/node-parse" "netdev:$IF"
fail "${builddir}/test/node-parse" netdev:lo
DEV=$(df | awk '/\/$/ { print $1 }')
check "${builddir}/test/node-parse" file:$DEV
check "${builddir}/test/node-parse" block:$(basename $DEV)
check "${builddir}/test/node-parse" pci:0:0.0
if [ "$E" = 0 ] ; then echo SUCCESS ; else echo FAILURE ; fi
exit $E