tests: Simplify explicit checks for command success
A number of individual test cases use '*out' commands to check for success of specific commands they've issued. Now that the test harness is testing for success of all issued commands as a matter of course, we no longer need to do this. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
4643b9b74c
commit
21e9cf7b95
5 changed files with 24 additions and 52 deletions
|
@ -14,9 +14,7 @@
|
||||||
htools clang-tidy cppcheck
|
htools clang-tidy cppcheck
|
||||||
|
|
||||||
test Run clang-tidy
|
test Run clang-tidy
|
||||||
hout RET make clang-tidy; echo $?
|
host make clang-tidy
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
test Run cppcheck
|
test Run cppcheck
|
||||||
hout RET make cppcheck; echo $?
|
host make cppcheck
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
|
@ -61,8 +61,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Wno-missing-field-initializers -Wno-missing-braces -Wno-type-limits" make; echo $?
|
host CFLAGS="-Wno-missing-field-initializers -Wno-missing-braces -Wno-type-limits" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
# TODO: pasta test skipped for the moment: clone() as called by NS_CALL hangs
|
# TODO: pasta test skipped for the moment: clone() as called by NS_CALL hangs
|
||||||
# with wrapper provided by glibc 2.19, probably wrong argument order.
|
# with wrapper provided by glibc 2.19, probably wrong argument order.
|
||||||
|
@ -89,8 +88,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
host sysctl -w kernel.unprivileged_userns_clone=1
|
host sysctl -w kernel.unprivileged_userns_clone=1
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
@ -114,8 +112,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
host sysctl -w kernel.unprivileged_userns_clone=1
|
host sysctl -w kernel.unprivileged_userns_clone=1
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
@ -146,8 +143,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
host sysctl -w kernel.unprivileged_userns_clone=1
|
host sysctl -w kernel.unprivileged_userns_clone=1
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
@ -179,8 +175,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
host sysctl -w kernel.unprivileged_userns_clone=1
|
host sysctl -w kernel.unprivileged_userns_clone=1
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
@ -204,8 +199,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
@ -234,8 +228,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
@ -265,8 +258,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
@ -289,8 +281,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
@ -311,8 +302,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
@ -334,8 +324,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,7 @@ host echo "DNSSERVERS='__DNS6__'" | netconfig modify -s dns_resolver -i eth0
|
||||||
host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
|
host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
@ -89,8 +88,7 @@ host echo "DNSSERVERS='__DNS6__'" | netconfig modify -s dns_resolver -i eth0
|
||||||
host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
|
host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
@ -117,8 +115,7 @@ host echo "DNSSERVERS='__DNS6__'" | netconfig modify -s dns_resolver -i eth0
|
||||||
host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
|
host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
@ -143,8 +140,7 @@ sleep 10
|
||||||
host zypper install -y gcc make netcat-openbsd; echo
|
host zypper install -y gcc make netcat-openbsd; echo
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
@ -172,8 +168,7 @@ sleep 10
|
||||||
host zypper install -y gcc make netcat-openbsd; echo
|
host zypper install -y gcc make netcat-openbsd; echo
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
@ -200,8 +195,7 @@ host echo "DNSSERVERS='__DNS6__'" | netconfig modify -s dns_resolver -i ens2
|
||||||
host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
|
host for i in $(seq 1 10); do zypper install -y gcc make netcat-openbsd && break; done; echo
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Wno-missing-field-initializers -Wno-missing-braces -Wno-type-limits" make; echo $?
|
host CFLAGS="-Wno-missing-field-initializers -Wno-missing-braces -Wno-type-limits" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
# TODO: pasta test skipped for the moment: clone() as called by NS_CALL hangs
|
# TODO: pasta test skipped for the moment: clone() as called by NS_CALL hangs
|
||||||
# with wrapper provided by glibc 2.19, probably wrong argument order.
|
# with wrapper provided by glibc 2.19, probably wrong argument order.
|
||||||
|
@ -96,8 +95,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Wno-missing-field-initializers -Wno-missing-braces -Wno-type-limits -Wno-sign-compare" make; echo $?
|
host CFLAGS="-Wno-missing-field-initializers -Wno-missing-braces -Wno-type-limits -Wno-sign-compare" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
# TODO: pasta test skipped for the moment: clone() as called by NS_CALL hangs
|
# TODO: pasta test skipped for the moment: clone() as called by NS_CALL hangs
|
||||||
# with wrapper provided by glibc 2.19, probably wrong argument order.
|
# with wrapper provided by glibc 2.19, probably wrong argument order.
|
||||||
|
@ -127,8 +125,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Wno-missing-field-initializers -Wno-missing-braces -Wno-type-limits -Wno-sign-compare" make; echo $?
|
host CFLAGS="-Wno-missing-field-initializers -Wno-missing-braces -Wno-type-limits -Wno-sign-compare" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
# TODO: pasta test skipped for the moment: clone() as called by NS_CALL hangs
|
# TODO: pasta test skipped for the moment: clone() as called by NS_CALL hangs
|
||||||
# with wrapper provided by glibc 2.19, probably wrong argument order.
|
# with wrapper provided by glibc 2.19, probably wrong argument order.
|
||||||
|
@ -160,8 +157,7 @@ host dhclient
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
distro_quick_pasta_test
|
distro_quick_pasta_test
|
||||||
|
|
||||||
|
@ -195,8 +191,7 @@ host apt-get update
|
||||||
host apt-get -y install make gcc netcat-openbsd
|
host apt-get -y install make gcc netcat-openbsd
|
||||||
|
|
||||||
host make clean
|
host make clean
|
||||||
hout RET CFLAGS="-Werror" make; echo $?
|
host CFLAGS="-Werror" make
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
host export SHELL="/bin/dash"
|
host export SHELL="/bin/dash"
|
||||||
host dash
|
host dash
|
||||||
|
|
|
@ -24,14 +24,10 @@ test ICMP echo: guest to ns
|
||||||
nsout IFNAME_NS ip -j li sh | jq -rM '.[] | select(.link_type == "ether").ifname'
|
nsout IFNAME_NS ip -j li sh | jq -rM '.[] | select(.link_type == "ether").ifname'
|
||||||
ns ip addr add 192.0.2.1/32 dev __IFNAME_NS__
|
ns ip addr add 192.0.2.1/32 dev __IFNAME_NS__
|
||||||
guest ping -c1 -w1 192.0.2.1
|
guest ping -c1 -w1 192.0.2.1
|
||||||
gout RET echo $?
|
|
||||||
ns ip addr del 192.0.2.1/32 dev __IFNAME_NS__
|
ns ip addr del 192.0.2.1/32 dev __IFNAME_NS__
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
||||||
test ICMPv6 echo: guest to ns
|
test ICMPv6 echo: guest to ns
|
||||||
ns ip addr add 2001:db8::1 dev __IFNAME_NS__ && sleep 2 # DAD
|
ns ip addr add 2001:db8::1 dev __IFNAME_NS__ && sleep 2 # DAD
|
||||||
gout IFNAME ip -j li sh | jq -rM '.[] | select(.link_type == "ether").ifname'
|
gout IFNAME ip -j li sh | jq -rM '.[] | select(.link_type == "ether").ifname'
|
||||||
guest ping -c1 -w1 2001:db8::1
|
guest ping -c1 -w1 2001:db8::1
|
||||||
gout RET echo $?
|
|
||||||
ns ip addr del 2001:db8::1 dev __IFNAME_NS__
|
ns ip addr del 2001:db8::1 dev __IFNAME_NS__
|
||||||
check [ __RET__ -eq 0 ]
|
|
||||||
|
|
Loading…
Reference in a new issue