Hi!
> All original test cases in ltp/testcases/kernel/containers/netns
> were removed and replaced with the new ones. The new test cases
> cover all of the tests in the original code and everything else
> in the original code didn't exercise new code paths in the kernel.
> Mapping of old test cases to the new ones:
> 
> netns_crtchild -> netns_comm
> netns_two_children_ns -> netns_comm
> netns_crtchild_delchild -> netns_sysfs
> netns_par_chld_ipv6, netns_par_chld_ftp -> nets_comm (netns_comm
>     does not complicate it with sshd or ftp, it just tests
>     communication using ping/ping6)
> netns_devices, netns_devices2 -> netns_comm
> netns_isolation -> netns_breakns
> 
> New testcases also use the helper tools for creating and working
> with namespaces from ltp/testcases/kernel/containers/share.
> 
> diff --git a/runtest/containers b/runtest/containers
> index de4197e..2dee944 100644
> --- a/runtest/containers
> +++ b/runtest/containers
> @@ -23,15 +23,24 @@ mqns_03_clone mqns_03 -clone
>  mqns_04 mqns_04
>  mqns_04_clone mqns_04 -clone
>  
> -netns_crtchild netns_crtchild
> -netns_two_children_ns netns_two_children_ns
> -netns_crtchild_delchild netns_crtchild_delchild
> -netns_par_chld_ipv6 netns_par_chld_ipv6
> -netns_par_chld_ftp netns_par_chld_ftp.sh
>  netns_netlink netns_netlink
> -netns_devices netns_devices.sh
> -netns_devices2 netns_devices2.sh
> -netns_isolation netns_isolation.sh
> +netns_breakns netns_breakns.sh ns_exec ipv4 netlink
> +netns_breakns netns_breakns.sh ns_exec ipv6 netlink
> +netns_breakns netns_breakns.sh ns_exec ipv4 ioctl
> +netns_breakns netns_breakns.sh ns_exec ipv6 ioctl
> +netns_breakns netns_breakns.sh ip ipv4 netlink
> +netns_breakns netns_breakns.sh ip ipv6 netlink
> +netns_breakns netns_breakns.sh ip ipv4 ioctl
> +netns_breakns netns_breakns.sh ip ipv6 ioctl
> +netns_comm netns_comm.sh ns_exec ipv4 netlink
> +netns_comm netns_comm.sh ns_exec ipv6 netlink
> +netns_comm netns_comm.sh ns_exec ipv4 ioctl
> +netns_comm netns_comm.sh ns_exec ipv6 ioctl
> +netns_comm netns_comm.sh ip ipv4 netlink
> +netns_comm netns_comm.sh ip ipv6 netlink
> +netns_comm netns_comm.sh ip ipv4 ioctl
> +netns_comm netns_comm.sh ip ipv6 ioctl
> +netns_sysfs netns_sysfs.sh

I'm really against having different testcases with the same name.

> diff --git a/testcases/kernel/containers/netns/netns_breakns.sh 
> b/testcases/kernel/containers/netns/netns_breakns.sh
> new file mode 100755
> index 0000000..46d8ca3
> --- /dev/null
> +++ b/testcases/kernel/containers/netns/netns_breakns.sh
> @@ -0,0 +1,74 @@
> +#!/bin/sh
> +#==============================================================================
> +# Copyright (c) 2015 Red Hat, Inc.
> +#
> +# This program is free software: you can redistribute it and/or modify
> +# it under the terms of version 2 the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +#
> +# Written by Matus Marhefka <mmarh...@redhat.com>
> +#
> +#==============================================================================
> +#
> +# SYNOPSIS:
> +# netns_breakns.sh <NS_EXEC_PROGRAM> <IP_VERSION> <COMM_TYPE>
> +#
> +# OPTIONS:
> +#    * NS_EXEC_PROGRAM (ns_exec|ip)
> +#            Program which will be used to enter and run other commands
> +#            inside a network namespace.
> +#    * IP_VERSION (ipv4|ipv6)
> +#            Version of IP. (ipv4|ipv6)
> +#    * COMM_TYPE (netlink|ioctl)
> +#            Communication type between kernel and user space
> +#            for basic setup: enabling and assigning IP addresses
> +#            to the virtual ethernet devices. (Uses 'ip' command for netlink
> +#            and 'ifconfig' for ioctl.)
> +#
> +# Tests communication with ip (uses netlink) and ifconfig (uses ioctl)
> +# over a device which is not visible from the current network namespace.
> +#
> +# There are two test cases which are trying to set an ip address on the veth1
> +# device which is not inside the network namespace referred to by NS_HANDLE0:
> +# 1. using netlink (ip command).
> +# 2. using ioctl (ifconfig command).
> +#==============================================================================
> +
> +TCID="netns_breakns"
> +TST_TOTAL=2
> +. netns_helper.sh
> +
> +# SETUP
> +netns_setup $1 $2 $3 "192.168.0.2" "192.168.0.3" "fd00::2" "fd00::3"
> +TCID="netns_breakns_$1_$2_$3"

Hmm, why don't we define the TCID="netns_breakns_$1_$2_$3" from the
start?

> +tst_resm TINFO "NS interaction: $1 | devices setup: $3"
> +
> +
> +# TEST CASE #1
> +$NS_EXEC $NS_HANDLE0 ip address add $IP1/$NETMASK dev veth1 2>/dev/null
> +if [ $? -ne 0 ]; then
> +     tst_resm TPASS "controlling device over netlink"
> +else
> +     tst_resm TFAIL "controlling device over netlink"
> +fi
> +
> +
> +# TEST CASE #2
> +tst_check_cmds ifconfig
> +$NS_EXEC $NS_HANDLE0 ifconfig veth1 $IFCONF_IN6_ARG $IP1/$NETMASK 2>/dev/null
> +if [ $? -ne 0 ]; then
> +     tst_resm TPASS "controlling device over ioctl"
> +else
> +     tst_resm TFAIL "controlling device over ioctl"
> +fi
> +
> +
> +tst_exit

Otherwise it looks good.

-- 
Cyril Hrubis
chru...@suse.cz

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to