diff mbox series

[Unstable] UBUNTU: SAUCE: selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support

Message ID 20200714124233.49350-1-paolo.pisati@canonical.com
State New
Headers show
Series [Unstable] UBUNTU: SAUCE: selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support | expand

Commit Message

Paolo Pisati July 14, 2020, 12:42 p.m. UTC
Fix ip_defrag.sh when CONFIG_NF_DEFRAG_IPV6=m:

$ sudo ./ip_defrag.sh
+ set -e
+ mktemp -u XXXXXX
+ readonly NETNS=ns-rGlXcw
+ trap cleanup EXIT
+ setup
+ ip netns add ns-rGlXcw
+ ip -netns ns-rGlXcw link set lo up
+ ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_high_thresh=9000000
+ ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_low_thresh=7000000
+ ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_time=1
+ ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_high_thresh=9000000
+ ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_low_thresh=7000000
+ ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_time=1
+ ip netns exec ns-rGlXcw sysctl -w net.netfilter.nf_conntrack_frag6_high_thresh=9000000
+ cleanup
+ ip netns del ns-rGlXcw

$ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
ls: cannot access '/proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh': No such file or directory

$ sudo modprobe nf_defrag_ipv6
$ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
-rw-r--r-- 1 root root 0 Jul 14 12:34 /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 tools/testing/selftests/net/ip_defrag.sh | 2 ++
 1 file changed, 2 insertions(+)

Comments

Colin Ian King July 14, 2020, 12:50 p.m. UTC | #1
On 14/07/2020 13:42, Paolo Pisati wrote:
> Fix ip_defrag.sh when CONFIG_NF_DEFRAG_IPV6=m:
> 
> $ sudo ./ip_defrag.sh
> + set -e
> + mktemp -u XXXXXX
> + readonly NETNS=ns-rGlXcw
> + trap cleanup EXIT
> + setup
> + ip netns add ns-rGlXcw
> + ip -netns ns-rGlXcw link set lo up
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_high_thresh=9000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_low_thresh=7000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_time=1
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_high_thresh=9000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_low_thresh=7000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_time=1
> + ip netns exec ns-rGlXcw sysctl -w net.netfilter.nf_conntrack_frag6_high_thresh=9000000
> + cleanup
> + ip netns del ns-rGlXcw
> 
> $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> ls: cannot access '/proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh': No such file or directory
> 
> $ sudo modprobe nf_defrag_ipv6
> $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> -rw-r--r-- 1 root root 0 Jul 14 12:34 /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
> ---
>  tools/testing/selftests/net/ip_defrag.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/ip_defrag.sh b/tools/testing/selftests/net/ip_defrag.sh
> index 15d3489ecd9c..6919afe47e0a 100755
> --- a/tools/testing/selftests/net/ip_defrag.sh
> +++ b/tools/testing/selftests/net/ip_defrag.sh
> @@ -3,6 +3,8 @@
>  #
>  # Run a couple of IP defragmentation tests.
>  
> +modprobe -q nf_defrag_ipv6
> +
>  set +x
>  set -e
>  
> 
Should the modprobe be after the set +x, set -e commands?

Colin
Paolo Pisati July 14, 2020, 1:13 p.m. UTC | #2
On Tue, Jul 14, 2020 at 01:50:45PM +0100, Colin Ian King wrote:
> Should the modprobe be after the set +x, set -e commands?

If nf_defrag_ipv6 doesn't exist (e.g. CONFIG_NF_DEFRAG_IPV6=y or
CONFIG_NF_DEFRAG_IPV6 is not set), 'set -e' will make it exit (man builtins |
set section):

-e      Exit immediately if a pipeline (which may consist of a single simple command), a list, or a compound command (see SHELL  GRAM‐
        MAR above), exits with a non-zero status.

$ cat << EOF >> test.sh 
#!/bin/sh -x

modprobe -q foobar 
set -e
modprobe -q foobar

echo DONE
EOF

$ chmod +x test.sh
$ sudo ./test.sh 
+ modprobe -q foobar
+ set -e
+ modprobe -q foobar
Colin Ian King July 14, 2020, 1:17 p.m. UTC | #3
On 14/07/2020 13:42, Paolo Pisati wrote:
> Fix ip_defrag.sh when CONFIG_NF_DEFRAG_IPV6=m:
> 
> $ sudo ./ip_defrag.sh
> + set -e
> + mktemp -u XXXXXX
> + readonly NETNS=ns-rGlXcw
> + trap cleanup EXIT
> + setup
> + ip netns add ns-rGlXcw
> + ip -netns ns-rGlXcw link set lo up
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_high_thresh=9000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_low_thresh=7000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_time=1
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_high_thresh=9000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_low_thresh=7000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_time=1
> + ip netns exec ns-rGlXcw sysctl -w net.netfilter.nf_conntrack_frag6_high_thresh=9000000
> + cleanup
> + ip netns del ns-rGlXcw
> 
> $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> ls: cannot access '/proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh': No such file or directory
> 
> $ sudo modprobe nf_defrag_ipv6
> $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> -rw-r--r-- 1 root root 0 Jul 14 12:34 /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
> ---
>  tools/testing/selftests/net/ip_defrag.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/ip_defrag.sh b/tools/testing/selftests/net/ip_defrag.sh
> index 15d3489ecd9c..6919afe47e0a 100755
> --- a/tools/testing/selftests/net/ip_defrag.sh
> +++ b/tools/testing/selftests/net/ip_defrag.sh
> @@ -3,6 +3,8 @@
>  #
>  # Run a couple of IP defragmentation tests.
>  
> +modprobe -q nf_defrag_ipv6
> +
>  set +x
>  set -e
>  
>
Thanks for the explanation in the thread Paolo.

Acked-by: Colin Ian King <colin.king@canonical.com>
Andrea Righi July 14, 2020, 1:40 p.m. UTC | #4
On Tue, Jul 14, 2020 at 02:42:33PM +0200, Paolo Pisati wrote:
> Fix ip_defrag.sh when CONFIG_NF_DEFRAG_IPV6=m:
> 
> $ sudo ./ip_defrag.sh
> + set -e
> + mktemp -u XXXXXX
> + readonly NETNS=ns-rGlXcw
> + trap cleanup EXIT
> + setup
> + ip netns add ns-rGlXcw
> + ip -netns ns-rGlXcw link set lo up
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_high_thresh=9000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_low_thresh=7000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_time=1
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_high_thresh=9000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_low_thresh=7000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_time=1
> + ip netns exec ns-rGlXcw sysctl -w net.netfilter.nf_conntrack_frag6_high_thresh=9000000
> + cleanup
> + ip netns del ns-rGlXcw
> 
> $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> ls: cannot access '/proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh': No such file or directory
> 
> $ sudo modprobe nf_defrag_ipv6
> $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> -rw-r--r-- 1 root root 0 Jul 14 12:34 /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>

Makes sense to me.

Acked-by: Andrea Righi <andrea.righi@canonical.com>

> ---
>  tools/testing/selftests/net/ip_defrag.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/ip_defrag.sh b/tools/testing/selftests/net/ip_defrag.sh
> index 15d3489ecd9c..6919afe47e0a 100755
> --- a/tools/testing/selftests/net/ip_defrag.sh
> +++ b/tools/testing/selftests/net/ip_defrag.sh
> @@ -3,6 +3,8 @@
>  #
>  # Run a couple of IP defragmentation tests.
>  
> +modprobe -q nf_defrag_ipv6
> +
>  set +x
>  set -e
>  
> -- 
> 2.25.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Kleber Sacilotto de Souza July 14, 2020, 1:40 p.m. UTC | #5
On 14.07.20 14:42, Paolo Pisati wrote:
> Fix ip_defrag.sh when CONFIG_NF_DEFRAG_IPV6=m:
> 
> $ sudo ./ip_defrag.sh
> + set -e
> + mktemp -u XXXXXX
> + readonly NETNS=ns-rGlXcw
> + trap cleanup EXIT
> + setup
> + ip netns add ns-rGlXcw
> + ip -netns ns-rGlXcw link set lo up
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_high_thresh=9000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_low_thresh=7000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_time=1
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_high_thresh=9000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_low_thresh=7000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_time=1
> + ip netns exec ns-rGlXcw sysctl -w net.netfilter.nf_conntrack_frag6_high_thresh=9000000
> + cleanup
> + ip netns del ns-rGlXcw
> 
> $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> ls: cannot access '/proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh': No such file or directory
> 
> $ sudo modprobe nf_defrag_ipv6
> $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> -rw-r--r-- 1 root root 0 Jul 14 12:34 /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  tools/testing/selftests/net/ip_defrag.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/ip_defrag.sh b/tools/testing/selftests/net/ip_defrag.sh
> index 15d3489ecd9c..6919afe47e0a 100755
> --- a/tools/testing/selftests/net/ip_defrag.sh
> +++ b/tools/testing/selftests/net/ip_defrag.sh
> @@ -3,6 +3,8 @@
>  #
>  # Run a couple of IP defragmentation tests.
>  
> +modprobe -q nf_defrag_ipv6
> +
>  set +x
>  set -e
>  
>
Seth Forshee July 17, 2020, 10:31 p.m. UTC | #6
On Tue, Jul 14, 2020 at 02:42:33PM +0200, Paolo Pisati wrote:
> Fix ip_defrag.sh when CONFIG_NF_DEFRAG_IPV6=m:
> 
> $ sudo ./ip_defrag.sh
> + set -e
> + mktemp -u XXXXXX
> + readonly NETNS=ns-rGlXcw
> + trap cleanup EXIT
> + setup
> + ip netns add ns-rGlXcw
> + ip -netns ns-rGlXcw link set lo up
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_high_thresh=9000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_low_thresh=7000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv4.ipfrag_time=1
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_high_thresh=9000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_low_thresh=7000000
> + ip netns exec ns-rGlXcw sysctl -w net.ipv6.ip6frag_time=1
> + ip netns exec ns-rGlXcw sysctl -w net.netfilter.nf_conntrack_frag6_high_thresh=9000000
> + cleanup
> + ip netns del ns-rGlXcw
> 
> $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> ls: cannot access '/proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh': No such file or directory
> 
> $ sudo modprobe nf_defrag_ipv6
> $ ls -la /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> -rw-r--r-- 1 root root 0 Jul 14 12:34 /proc/sys/net/netfilter/nf_conntrack_frag6_high_thresh
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>

Applied to unstable, thanks!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/ip_defrag.sh b/tools/testing/selftests/net/ip_defrag.sh
index 15d3489ecd9c..6919afe47e0a 100755
--- a/tools/testing/selftests/net/ip_defrag.sh
+++ b/tools/testing/selftests/net/ip_defrag.sh
@@ -3,6 +3,8 @@ 
 #
 # Run a couple of IP defragmentation tests.
 
+modprobe -q nf_defrag_ipv6
+
 set +x
 set -e