diff mbox

[nft] tests/shell: unload modules between tests

Message ID CAOkSjBi7-XMcjZkc9N=RD9SsSZ4Xhc7TuNyA7vw5q0mbWRvfXw@mail.gmail.com
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Arturo Borrero March 18, 2016, 8:41 a.m. UTC
On 17 March 2016 at 19:02, Piyush Pangtey <gokuvsvegita@gmail.com> 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.

Comments

Pablo Neira Ayuso March 22, 2016, 7:17 p.m. UTC | #1
On Fri, Mar 18, 2016 at 09:41:31AM +0100, Arturo Borrero Gonzalez wrote:
> From: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
> 
> 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.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

tests/shell/run-tests.sh: tune kernel cleanup

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

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>
---
 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