Re: [nft PATCH] tests/shell: unload modules between tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 17 March 2016 at 19:02, Piyush Pangtey <gokuvsvegita@xxxxxxxxx> wrote:
> I'm getting nonzero return code(1) by this last kernel_cleanup call, maybe.
>

Hi Piyush,

find attached a patch, please test it and let me know.

best regards.

-- 
Arturo Borrero González
tests/shell/run-tests.sh: tune kernel cleanup

From: Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx>

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@xxxxxxxxx>
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx>
---
 tests/shell/run-tests.sh |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index c08a3eb..620fe57 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -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

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux