Commit 10e2ed3f authored by Florian Westphal's avatar Florian Westphal Committed by Jakub Kicinski

selftests: netfilter: place checktool helper in lib.sh

... so it doesn't have to be repeated everywhere.
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Link: https://lore.kernel.org/r/20240411233624.8129-10-fw@strlen.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0413156e
......@@ -11,11 +11,7 @@
source lib.sh
nft --version > /dev/null 2>&1
if [ $? -ne 0 ];then
echo "SKIP: Could not run test without nft tool"
exit $ksft_skip
fi
checktool "nft --version" "run test without nft tool"
cleanup() {
cleanup_all_ns
......
......@@ -24,13 +24,6 @@ source lib.sh
rx=$(mktemp)
checktool (){
if ! $1 > /dev/null 2>&1; then
echo "SKIP: Could not $2"
exit $ksft_skip
fi
}
checktool "iptables --version" "run test without iptables"
checktool "socat -h" "run test without socat"
......
net_netfilter_dir=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
source "$net_netfilter_dir/../lib.sh"
checktool (){
if ! $1 > /dev/null 2>&1; then
echo "SKIP: Could not $2"
exit $ksft_skip
fi
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment