lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c2a2d56-95a0-72f8-23a0-1e186e6443a2@alu.unizg.hr>
Date:   Tue, 18 Jul 2023 20:39:33 +0200
From:   Mirsad Todorovac <mirsad.todorovac@....unizg.hr>
To:     Ido Schimmel <idosch@...sch.org>
Cc:     netdev@...r.kernel.org, linux-kselftest@...r.kernel.org,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Shuah Khan <shuah@...nel.org>,
        Ido Schimmel <idosch@...dia.com>,
        Nikolay Aleksandrov <razor@...ckwall.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        petrm@...dia.com
Subject: Re: [PROBLEM] selftests: net/forwarding/*.sh: 'Command line is not
 complete. Try option "help"'

On 7/18/23 20:19, Mirsad Todorovac wrote:
> On 7/18/23 09:22, Ido Schimmel wrote:
>> On Mon, Jul 17, 2023 at 10:51:04PM +0200, Mirsad Todorovac wrote:
>>> Tests fail with error message:
>>>
>>> Command line is not complete. Try option "help"
>>> Failed to create netif
>>>
>>> The script
>>>
>>> # tools/testing/seltests/net/forwarding/bridge_igmp.sh
>>>
>>> bash `set -x` ends with an error:
>>>
>>> ++ create_netif_veth
>>> ++ local i
>>> ++ (( i = 1 ))
>>> ++ (( i <= NUM_NETIFS ))
>>> ++ local j=2
>>> ++ ip link show dev
>>> ++ [[ 255 -ne 0 ]]
>>> ++ ip link add type veth peer name
>>> Command line is not complete. Try option "help"
>>> ++ [[ 255 -ne 0 ]]
>>> ++ echo 'Failed to create netif'
>>> Failed to create netif
>>> ++ exit 1
>>>
>>> The problem seems to be linked with this piece of code of "lib.sh":
>>>
>>> create_netif_veth()
>>> {
>>>          local i
>>>
>>>          for ((i = 1; i <= NUM_NETIFS; ++i)); do
>>>                  local j=$((i+1))
>>>
>>>                  ip link show dev ${NETIFS[p$i]} &> /dev/null
>>>                  if [[ $? -ne 0 ]]; then
>>>                          ip link add ${NETIFS[p$i]} type veth \
>>>                                  peer name ${NETIFS[p$j]}
>>>                          if [[ $? -ne 0 ]]; then
>>>                                  echo "Failed to create netif"
>>>                                  exit 1
>>>                          fi
>>>                  fi
>>>                  i=$j
>>>          done
>>> }
>>>
>>> Somehow, ${NETIFS[p$i]} is evaluated to an empty string?
>>
>> You need to provide a configuration file in
>> tools/testing/selftests/net/forwarding/forwarding.config. See
>> tools/testing/selftests/net/forwarding/forwarding.config.sample for
>> example.
>>
>> Another option is to provide the interfaces on the command line.
>>
>> ./bridge_igmp.sh veth0 veth1 veth2 veth3
>>
>> If no configuration file is present, we can try to assume that the
>> tests are meant to be run with veth pairs and not with physical
>> loopbacks. Something like:
>>
>> diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
>> index 71f7c0c49677..5b0183013017 100755
>> --- a/tools/testing/selftests/net/forwarding/lib.sh
>> +++ b/tools/testing/selftests/net/forwarding/lib.sh
>> @@ -16,8 +16,6 @@ TEAMD=${TEAMD:=teamd}
>>   WAIT_TIME=${WAIT_TIME:=5}
>>   PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
>>   PAUSE_ON_CLEANUP=${PAUSE_ON_CLEANUP:=no}
>> -NETIF_TYPE=${NETIF_TYPE:=veth}
>> -NETIF_CREATE=${NETIF_CREATE:=yes}
>>   MCD=${MCD:=smcrouted}
>>   MC_CLI=${MC_CLI:=smcroutectl}
>>   PING_COUNT=${PING_COUNT:=10}
>> @@ -30,6 +28,20 @@ REQUIRE_MZ=${REQUIRE_MZ:=yes}
>>   REQUIRE_MTOOLS=${REQUIRE_MTOOLS:=no}
>>   STABLE_MAC_ADDRS=${STABLE_MAC_ADDRS:=no}
>>   TCPDUMP_EXTRA_FLAGS=${TCPDUMP_EXTRA_FLAGS:=}
>> +NETIF_TYPE=${NETIF_TYPE:=veth}
>> +NETIF_CREATE=${NETIF_CREATE:=yes}
>> +declare -A NETIFS=(
>> +       [p1]=veth0
>> +       [p2]=veth1
>> +       [p3]=veth2
>> +       [p4]=veth3
>> +       [p5]=veth4
>> +       [p6]=veth5
>> +       [p7]=veth6
>> +       [p8]=veth7
>> +       [p9]=veth8
>> +       [p10]=veth9
>> +)
>>   relative_path="${BASH_SOURCE%/*}"
>>   if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then
> 
> This patch appears to work for the first testing script
> 
> root@...iant:# ./bridge_igmp.sh
> TEST: IGMPv2 report 239.10.10.10                                    [ OK ]
> TEST: IGMPv2 leave 239.10.10.10                                     [ OK ]
> TEST: IGMPv3 report 239.10.10.10 is_include                         [ OK ]
> TEST: IGMPv3 report 239.10.10.10 include -> allow                   [ OK ]
> TEST: IGMPv3 report 239.10.10.10 include -> is_include              [ OK ]
> TEST: IGMPv3 report 239.10.10.10 include -> is_exclude              [ OK ]
> TEST: IGMPv3 report 239.10.10.10 include -> to_exclude              [ OK ]
> TEST: IGMPv3 report 239.10.10.10 exclude -> allow                   [ OK ]
> TEST: IGMPv3 report 239.10.10.10 exclude -> is_include              [ OK ]
> TEST: IGMPv3 report 239.10.10.10 exclude -> is_exclude              [ OK ]
> TEST: IGMPv3 report 239.10.10.10 exclude -> to_exclude              [ OK ]
> TEST: IGMPv3 report 239.10.10.10 include -> block                   [ OK ]
> TEST: IGMPv3 report 239.10.10.10 exclude -> block                   [ OK ]
> TEST: IGMPv3 group 239.10.10.10 exclude timeout                     [ OK ]
> TEST: IGMPv3 S,G port entry automatic add to a *,G port             [ OK ]
> root@...iant:#
> 
> However, I suggest setting tools/testing/selftest/net/forwarding/settings:timeout=150 at least,
> because default 45 is premature on my box and it leaves the networking system in an undefined
> state upon exit.

There is also a gotcha here: you do not delete all veths:

root@...iant:# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp16s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
     link/ether 9c:6b:00:01:fb:80 brd ff:ff:ff:ff:ff:ff
root@...iant:# ./bridge_igmp.sh
TEST: IGMPv2 report 239.10.10.10                                    [ OK ]
TEST: IGMPv2 leave 239.10.10.10                                     [ OK ]
TEST: IGMPv3 report 239.10.10.10 is_include                         [ OK ]
TEST: IGMPv3 report 239.10.10.10 include -> allow                   [ OK ]
TEST: IGMPv3 report 239.10.10.10 include -> is_include              [ OK ]
TEST: IGMPv3 report 239.10.10.10 include -> is_exclude              [ OK ]
TEST: IGMPv3 report 239.10.10.10 include -> to_exclude              [ OK ]
TEST: IGMPv3 report 239.10.10.10 exclude -> allow                   [ OK ]
TEST: IGMPv3 report 239.10.10.10 exclude -> is_include              [ OK ]
TEST: IGMPv3 report 239.10.10.10 exclude -> is_exclude              [ OK ]
TEST: IGMPv3 report 239.10.10.10 exclude -> to_exclude              [ OK ]
TEST: IGMPv3 report 239.10.10.10 include -> block                   [ OK ]
TEST: IGMPv3 report 239.10.10.10 exclude -> block                   [ OK ]
TEST: IGMPv3 group 239.10.10.10 exclude timeout                     [ OK ]
TEST: IGMPv3 S,G port entry automatic add to a *,G port             [ OK ]
root@...iant:# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp16s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
     link/ether 9c:6b:00:01:fb:80 brd ff:ff:ff:ff:ff:ff
3: veth1@...h0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
     link/ether b6:46:e6:4c:e4:00 brd ff:ff:ff:ff:ff:ff
4: veth0@...h1: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
     link/ether 2e:ff:7f:8a:6b:d4 brd ff:ff:ff:ff:ff:ff
5: veth3@...h2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
     link/ether ba:33:37:81:dc:5b brd ff:ff:ff:ff:ff:ff
6: veth2@...h3: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
     link/ether f2:fd:0a:9b:94:17 brd ff:ff:ff:ff:ff:ff
root@...iant:#

Also, I ran into problems with some other tests, but for documentation sake
I will address the issue in a separate thread.

Best regards,
Mirsad Todorovac

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ