Comment 0 for bug 1890136

Revision history for this message
Po-Hsu Lin (cypressyew) wrote : Return value in rtnetlink.sh from kselftests/net will be overrided in the last test

In this test, it uses ret to store the return value of each test.

However, this value will be reset to 0 in the beginning of each test.

In the end of this test, it will judge PASS/FAIL base on this value.

Thus this will cause false-negative in some cases.
Below is an example for the test on Bionic OEM-OSP1, test "ip6erspan", "erspan", "ip6gretap" failed with return value 255, but the return value will soon be overridden with 0 if following test passed without any issue (I made the test to print === RET $ret === line for debugging purpose):

PASS: policy routing
=== RET 0 ===
PASS: route get
=== RET 0 ===
PASS: preferred_lft addresses have expired
=== RET 0 ===
PASS: tc htb hierarchy
=== RET 0 ===
PASS: gre tunnel endpoint
=== RET 0 ===
PASS: gretap
=== RET 0 ===
Usage: ... { ip6gre | ip6gretap | ip6erspan} [ remote ADDR ]
                                  [ local ADDR ]
                                  [ [i|o]seq ]
                                  [ [i|o]key KEY ]
                                  [ [i|o]csum ]
                                  [ hoplimit TTL ]
                                  [ encaplimit ELIM ]
                                  [ tclass TCLASS ]
                                  [ flowlabel FLOWLABEL ]
                                  [ dscp inherit ]
                                  [ fwmark MARK ]
                                  [ dev PHYS_DEV ]
                                  [ noencap ]
                                  [ encap { fou | gue | none } ]
                                  [ encap-sport PORT ]
                                  [ encap-dport PORT ]
                                  [ [no]encap-csum ]
                                  [ [no]encap-csum6 ]
                                  [ [no]encap-remcsum ]
                                  [ erspan IDX ]

Where: ADDR := IPV6_ADDRESS
       TTL := { 0..255 } (default=64)
       KEY := { DOTTED_QUAD | NUMBER }
       ELIM := { none | 0..255 }(default=4)
       TCLASS := { 0x0..0xff | inherit }
       FLOWLABEL := { 0x0..0xfffff | inherit }
       MARK := { 0x0..0xffffffff | inherit }
Cannot find device "ip6gretap00"
FAIL: ip6gretap
=== RET 255 ===
Usage: ... { gre | gretap | erspan } [ remote ADDR ]
                            [ local ADDR ]
                            [ [i|o]seq ]
                            [ [i|o]key KEY ]
                            [ [i|o]csum ]
                            [ ttl TTL ]
                            [ tos TOS ]
                            [ [no]pmtudisc ]
                            [ [no]ignore-df ]
                            [ dev PHYS_DEV ]
                            [ noencap ]
                            [ encap { fou | gue | none } ]
                            [ encap-sport PORT ]
                            [ encap-dport PORT ]
                            [ [no]encap-csum ]
                            [ [no]encap-csum6 ]
                            [ [no]encap-remcsum ]
                            [ external ]
                            [ fwmark MARK ]
                            [ erspan IDX ]

Where: ADDR := { IP_ADDRESS | any }
       TOS := { NUMBER | inherit }
       TTL := { 1..255 | inherit }
       KEY := { DOTTED_QUAD | NUMBER }
       MARK := { 0x0..0xffffffff }
Cannot find device "erspan00"
Cannot find device "erspan00"
Cannot find device "erspan00"
Usage: ... { gre | gretap | erspan } [ remote ADDR ]
                            [ local ADDR ]
                            [ [i|o]seq ]
                            [ [i|o]key KEY ]
                            [ [i|o]csum ]
                            [ ttl TTL ]
                            [ tos TOS ]
                            [ [no]pmtudisc ]
                            [ [no]ignore-df ]
                            [ dev PHYS_DEV ]
                            [ noencap ]
                            [ encap { fou | gue | none } ]
                            [ encap-sport PORT ]
                            [ encap-dport PORT ]
                            [ [no]encap-csum ]
                            [ [no]encap-csum6 ]
                            [ [no]encap-remcsum ]
                            [ external ]
                            [ fwmark MARK ]
                            [ erspan IDX ]

Where: ADDR := { IP_ADDRESS | any }
       TOS := { NUMBER | inherit }
       TTL := { 1..255 | inherit }
       KEY := { DOTTED_QUAD | NUMBER }
       MARK := { 0x0..0xffffffff }
Cannot find device "erspan00"
Cannot find device "erspan00"
Cannot find device "erspan00"
FAIL: erspan
=== RET 255 ===
Usage: ... { ip6gre | ip6gretap | ip6erspan} [ remote ADDR ]
                                  [ local ADDR ]
                                  [ [i|o]seq ]
                                  [ [i|o]key KEY ]
                                  [ [i|o]csum ]
                                  [ hoplimit TTL ]
                                  [ encaplimit ELIM ]
                                  [ tclass TCLASS ]
                                  [ flowlabel FLOWLABEL ]
                                  [ dscp inherit ]
                                  [ fwmark MARK ]
                                  [ dev PHYS_DEV ]
                                  [ noencap ]
                                  [ encap { fou | gue | none } ]
                                  [ encap-sport PORT ]
                                  [ encap-dport PORT ]
                                  [ [no]encap-csum ]
                                  [ [no]encap-csum6 ]
                                  [ [no]encap-remcsum ]
                                  [ erspan IDX ]

Where: ADDR := IPV6_ADDRESS
       TTL := { 0..255 } (default=64)
       KEY := { DOTTED_QUAD | NUMBER }
       ELIM := { none | 0..255 }(default=4)
       TCLASS := { 0x0..0xff | inherit }
       FLOWLABEL := { 0x0..0xfffff | inherit }
       MARK := { 0x0..0xffffffff | inherit }
Cannot find device "ip6erspan00"
Cannot find device "ip6erspan00"
Cannot find device "ip6erspan00"
Usage: ... { ip6gre | ip6gretap | ip6erspan} [ remote ADDR ]
                                  [ local ADDR ]
                                  [ [i|o]seq ]
                                  [ [i|o]key KEY ]
                                  [ [i|o]csum ]
                                  [ hoplimit TTL ]
                                  [ encaplimit ELIM ]
                                  [ tclass TCLASS ]
                                  [ flowlabel FLOWLABEL ]
                                  [ dscp inherit ]
                                  [ fwmark MARK ]
                                  [ dev PHYS_DEV ]
                                  [ noencap ]
                                  [ encap { fou | gue | none } ]
                                  [ encap-sport PORT ]
                                  [ encap-dport PORT ]
                                  [ [no]encap-csum ]
                                  [ [no]encap-csum6 ]
                                  [ [no]encap-remcsum ]
                                  [ erspan IDX ]

Where: ADDR := IPV6_ADDRESS
       TTL := { 0..255 } (default=64)
       KEY := { DOTTED_QUAD | NUMBER }
       ELIM := { none | 0..255 }(default=4)
       TCLASS := { 0x0..0xff | inherit }
       FLOWLABEL := { 0x0..0xfffff | inherit }
       MARK := { 0x0..0xffffffff | inherit }
Cannot find device "ip6erspan00"
Cannot find device "ip6erspan00"
Cannot find device "ip6erspan00"
Usage: ... { ip6gre | ip6gretap | ip6erspan} [ remote ADDR ]
                                  [ local ADDR ]
                                  [ [i|o]seq ]
                                  [ [i|o]key KEY ]
                                  [ [i|o]csum ]
                                  [ hoplimit TTL ]
                                  [ encaplimit ELIM ]
                                  [ tclass TCLASS ]
                                  [ flowlabel FLOWLABEL ]
                                  [ dscp inherit ]
                                  [ fwmark MARK ]
                                  [ dev PHYS_DEV ]
                                  [ noencap ]
                                  [ encap { fou | gue | none } ]
                                  [ encap-sport PORT ]
                                  [ encap-dport PORT ]
                                  [ [no]encap-csum ]
                                  [ [no]encap-csum6 ]
                                  [ [no]encap-remcsum ]
                                  [ erspan IDX ]

Where: ADDR := IPV6_ADDRESS
       TTL := { 0..255 } (default=64)
       KEY := { DOTTED_QUAD | NUMBER }
       ELIM := { none | 0..255 }(default=4)
       TCLASS := { 0x0..0xff | inherit }
       FLOWLABEL := { 0x0..0xfffff | inherit }
       MARK := { 0x0..0xffffffff | inherit }
Cannot find device "ip6erspan00"
FAIL: ip6erspan
=== RET 255 ===
PASS: bridge setup
=== RET 0 ===
PASS: ipv6 addrlabel
=== RET 0 ===
PASS: set ifalias a1214e60-3ac4-4fd4-8a98-aac4c0b4bfab for test-dummy0
=== RET 0 ===
PASS: vrf
=== RET 0 ===
PASS: vxlan
FAIL: can't add fou port 7777, skipping test
=== RET 0 ===
PASS: macsec
=== RET 0 ===
PASS: ipsec
=== RET 0 ===
PASS: ipsec_offload
=== RET 0 ===
SKIP: fdb get tests: iproute2 too old
=== RET 0 ===
SKIP: fdb get tests: iproute2 too old
=== RET 0 ===
=== RET 0 ===