]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/shell/run-tests.sh: tune kernel cleanup
authorArturo Borrero <arturo.borrero.glez@gmail.com>
Fri, 18 Mar 2016 08:41:31 +0000 (09:41 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 22 Mar 2016 19:38:48 +0000 (20:38 +0100)
The modprobe call can return != 0 if, for example, a module was builtin and
we are triying to remove it, so force return code of 0 at the end of the
script.

This patch also adds the '-a' switch to modprobe so it doesn't stop unloading
modules if one of them fails (for example, it was builtin).

While at it, fix several module names, for example: 'nft_bridge_reject' vs
'nft_reject_bridge', delete bogus module names.

Reported-by: Piyush Pangtey <gokuvsvegita@gmail.com>
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Tested-by: Piyush Pangtey <gokuvsvegita@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/run-tests.sh

index c08a3eb65737a833f79263e39228cd7b31f4620b..620fe579ddd66553eba9861f1dab2e4c900209d0 100755 (executable)
@@ -48,15 +48,13 @@ fi
 
 kernel_cleanup() {
        $NFT flush ruleset
-       $MODPROBE -rq \
-       nft_reject_ipv4 nft_reject_ipv6 nft_bridge_reject \
-       nft_reject_ipv6 nft_reject \
+       $MODPROBE -raq \
+       nft_reject_ipv4 nft_reject_bridge nft_reject_ipv6 nft_reject \
        nft_redir_ipv4 nft_redir_ipv6 nft_redir \
-       nft_dup_ipv4 nft_dup_ipv6 nft_dup \
-       nft_nat_ipv4 nft_nat_ipv6 nft_nat \
+       nft_dup_ipv4 nft_dup_ipv6 nft_dup nft_nat \
        nft_masq_ipv4 nft_masq_ipv6 nft_masq \
        nft_exthdr nft_payload nft_cmp \
-       nft_meta nft_bridge_meta nft_counter nft_log nft_limit \
+       nft_meta nft_meta_bridge nft_counter nft_log nft_limit \
        nft_hash nft_rbtree nft_ct nft_compat \
        nf_tables_inet nf_tables_bridge nf_tables_arp \
        nf_tables_ipv4 nf_tables_ipv6 nf_tables
@@ -91,3 +89,4 @@ echo ""
 msg_info "results: [OK] $ok [FAILED] $failed [TOTAL] $((ok+failed))"
 
 kernel_cleanup
+exit 0