** Description changed:

+ [Impact] 
+ If any sub-test in this icmp_redirect.sh is failing but not expected
+ to fail. The script will complain:
+     ./icmp_redirect.sh: line 72: [: 1: unary operator expected
+ 
+ This is because when the sub-test is not expected to fail, we won't
+ pass any value for the xfail local variable in log_test() and thus
+ it's empty. Fix this by passing 0 as the 4th variable to log_test()
+ for non-xfail cases.
+ 
+ This issue can be found on our KVM kernel with SRU tests, they're
+ failing because of missing some kernel configs.
+ 
+ [Fix]
+ * 39d8622c72 "selftests: icmp_redirect: pass xfail=0 to log_test()"
+ 
+ This patch can be cherry-picked into all of the affected kernels.
+ 
+ [Test Plan]
+ Run the patched icmp_redirect.sh script with a KVM kernel (e.g. F/kvm), and 
this "unary operator expected" error message should no longer exist.
+ 
+ [Where problems could occur]
+ Change limited to test script, it won't have any impact to real kernel 
function. And this issue is most likely specific to KVM kernels.
+ 
+ 
+ == Original Bug Report ==
  icmp_redirect from selftect is failing on F/kvm 5.4.0-1045.47
  
-  # selftests: net: icmp_redirect.sh
-  #
-  # ###########################################################################
-  # Legacy routing
-  # ###########################################################################
-  #
-  # TEST: IPv4: redirect exception                                      [ OK ]
-  # TEST: IPv6: redirect exception                                      [ OK ]
-  # TEST: IPv4: redirect exception plus mtu                             [ OK ]
-  # TEST: IPv6: redirect exception plus mtu                             [ OK ]
-  # TEST: IPv4: routing reset                                           [ OK ]
-  # TEST: IPv6: routing reset                                           [ OK ]
-  # TEST: IPv4: mtu exception                                           [ OK ]
-  # TEST: IPv6: mtu exception                                           [ OK ]
-  # TEST: IPv4: mtu exception plus redirect                             [ OK ]
-  # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
-  #
-  # ###########################################################################
-  # Legacy routing with VRF
-  # ###########################################################################
-  #
-  # Error: Unknown device type.
-  # Cannot find device "red"
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # Cannot find device "red"
-  # Cannot find device "red"
-  # Error: argument "red" is wrong: Not a valid VRF name
-  #
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
-  # TEST: IPv4: redirect exception                                      [FAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # TEST: IPv6: redirect exception                                      [XFAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
-  # TEST: IPv4: redirect exception plus mtu                             [FAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # TEST: IPv6: redirect exception plus mtu                             [XFAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
-  # TEST: IPv4: routing reset                                           [FAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # TEST: IPv6: routing reset                                           [XFAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
-  # TEST: IPv4: mtu exception                                           [FAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # TEST: IPv6: mtu exception                                           [XFAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
-  # TEST: IPv4: mtu exception plus redirect                             [FAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
-  #
-  # ###########################################################################
-  # Routing with nexthop objects
-  # ###########################################################################
-  #
-  # TEST: IPv4: redirect exception                                      [ OK ]
-  # TEST: IPv6: redirect exception                                      [ OK ]
-  # TEST: IPv4: redirect exception plus mtu                             [ OK ]
-  # TEST: IPv6: redirect exception plus mtu                             [ OK ]
-  # TEST: IPv4: routing reset                                           [ OK ]
-  # TEST: IPv6: routing reset                                           [ OK ]
-  # TEST: IPv4: mtu exception                                           [ OK ]
-  # TEST: IPv6: mtu exception                                           [ OK ]
-  # TEST: IPv4: mtu exception plus redirect                             [ OK ]
-  # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
-  #
-  # ###########################################################################
-  # Routing with nexthop objects and VRF
-  # ###########################################################################
-  #
-  # Error: Unknown device type.
-  # Cannot find device "red"
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # Cannot find device "red"
-  # Cannot find device "red"
-  # Error: argument "red" is wrong: Not a valid VRF name
-  #
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
-  # TEST: IPv4: redirect exception                                      [FAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # TEST: IPv6: redirect exception                                      [XFAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
-  # TEST: IPv4: redirect exception plus mtu                             [FAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # TEST: IPv6: redirect exception plus mtu                             [XFAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
-  # TEST: IPv4: routing reset                                           [FAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # TEST: IPv6: routing reset                                           [XFAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
-  # TEST: IPv4: mtu exception                                           [FAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # TEST: IPv6: mtu exception                                           [XFAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
-  # TEST: IPv4: mtu exception plus redirect                             [FAIL]
-  # Error: argument "red" is wrong: Invalid VRF
-  #
-  # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
-  #
-  # Tests passed:  18
-  # Tests failed:  10
-  # Tests xfailed:  12
-  not ok 35 selftests: net: icmp_redirect.sh # exit=1
+  # selftests: net: icmp_redirect.sh
+  #
+  # ###########################################################################
+  # Legacy routing
+  # ###########################################################################
+  #
+  # TEST: IPv4: redirect exception                                      [ OK ]
+  # TEST: IPv6: redirect exception                                      [ OK ]
+  # TEST: IPv4: redirect exception plus mtu                             [ OK ]
+  # TEST: IPv6: redirect exception plus mtu                             [ OK ]
+  # TEST: IPv4: routing reset                                           [ OK ]
+  # TEST: IPv6: routing reset                                           [ OK ]
+  # TEST: IPv4: mtu exception                                           [ OK ]
+  # TEST: IPv6: mtu exception                                           [ OK ]
+  # TEST: IPv4: mtu exception plus redirect                             [ OK ]
+  # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
+  #
+  # ###########################################################################
+  # Legacy routing with VRF
+  # ###########################################################################
+  #
+  # Error: Unknown device type.
+  # Cannot find device "red"
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # Cannot find device "red"
+  # Cannot find device "red"
+  # Error: argument "red" is wrong: Not a valid VRF name
+  #
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
+  # TEST: IPv4: redirect exception                                      [FAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # TEST: IPv6: redirect exception                                      [XFAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
+  # TEST: IPv4: redirect exception plus mtu                             [FAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # TEST: IPv6: redirect exception plus mtu                             [XFAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
+  # TEST: IPv4: routing reset                                           [FAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # TEST: IPv6: routing reset                                           [XFAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
+  # TEST: IPv4: mtu exception                                           [FAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # TEST: IPv6: mtu exception                                           [XFAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
+  # TEST: IPv4: mtu exception plus redirect                             [FAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
+  #
+  # ###########################################################################
+  # Routing with nexthop objects
+  # ###########################################################################
+  #
+  # TEST: IPv4: redirect exception                                      [ OK ]
+  # TEST: IPv6: redirect exception                                      [ OK ]
+  # TEST: IPv4: redirect exception plus mtu                             [ OK ]
+  # TEST: IPv6: redirect exception plus mtu                             [ OK ]
+  # TEST: IPv4: routing reset                                           [ OK ]
+  # TEST: IPv6: routing reset                                           [ OK ]
+  # TEST: IPv4: mtu exception                                           [ OK ]
+  # TEST: IPv6: mtu exception                                           [ OK ]
+  # TEST: IPv4: mtu exception plus redirect                             [ OK ]
+  # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
+  #
+  # ###########################################################################
+  # Routing with nexthop objects and VRF
+  # ###########################################################################
+  #
+  # Error: Unknown device type.
+  # Cannot find device "red"
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # Cannot find device "red"
+  # Cannot find device "red"
+  # Error: argument "red" is wrong: Not a valid VRF name
+  #
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
+  # TEST: IPv4: redirect exception                                      [FAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # TEST: IPv6: redirect exception                                      [XFAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
+  # TEST: IPv4: redirect exception plus mtu                             [FAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # TEST: IPv6: redirect exception plus mtu                             [XFAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
+  # TEST: IPv4: routing reset                                           [FAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # TEST: IPv6: routing reset                                           [XFAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
+  # TEST: IPv4: mtu exception                                           [FAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # TEST: IPv6: mtu exception                                           [XFAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
+  # TEST: IPv4: mtu exception plus redirect                             [FAIL]
+  # Error: argument "red" is wrong: Invalid VRF
+  #
+  # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
+  #
+  # Tests passed:  18
+  # Tests failed:  10
+  # Tests xfailed:  12
+  not ok 35 selftests: net: icmp_redirect.sh # exit=1

** Changed in: linux (Ubuntu Focal)
     Assignee: (unassigned) => Po-Hsu Lin (cypressyew)

** Changed in: linux (Ubuntu Hirsute)
     Assignee: (unassigned) => Po-Hsu Lin (cypressyew)

** Changed in: linux (Ubuntu Impish)
     Assignee: (unassigned) => Po-Hsu Lin (cypressyew)

** Changed in: linux (Ubuntu Jammy)
     Assignee: (unassigned) => Po-Hsu Lin (cypressyew)

** Changed in: linux (Ubuntu Focal)
       Status: New => In Progress

** Changed in: linux (Ubuntu Hirsute)
       Status: New => In Progress

** Changed in: linux (Ubuntu Impish)
       Status: New => In Progress

** Changed in: linux (Ubuntu Jammy)
       Status: Incomplete => In Progress

** Description changed:

- [Impact] 
+ [Impact]
  If any sub-test in this icmp_redirect.sh is failing but not expected
  to fail. The script will complain:
      ./icmp_redirect.sh: line 72: [: 1: unary operator expected
  
  This is because when the sub-test is not expected to fail, we won't
  pass any value for the xfail local variable in log_test() and thus
  it's empty. Fix this by passing 0 as the 4th variable to log_test()
  for non-xfail cases.
  
  This issue can be found on our KVM kernel with SRU tests, they're
  failing because of missing some kernel configs.
  
  [Fix]
  * 39d8622c72 "selftests: icmp_redirect: pass xfail=0 to log_test()"
  
  This patch can be cherry-picked into all of the affected kernels.
  
  [Test Plan]
- Run the patched icmp_redirect.sh script with a KVM kernel (e.g. F/kvm), and 
this "unary operator expected" error message should no longer exist.
+ Run the patched icmp_redirect.sh script with a KVM kernel (e.g. F/kvm),
+ and this "unary operator expected" error message should no longer exist.
  
  [Where problems could occur]
- Change limited to test script, it won't have any impact to real kernel 
function. And this issue is most likely specific to KVM kernels.
+ Change limited to test script, it won't have any impact to real kernel
+ function. And this issue is most likely specific to KVM kernels.
  
  
  == Original Bug Report ==
  icmp_redirect from selftect is failing on F/kvm 5.4.0-1045.47
  
   # selftests: net: icmp_redirect.sh
   #
   # ###########################################################################
   # Legacy routing
   # ###########################################################################
   #
   # TEST: IPv4: redirect exception                                      [ OK ]
   # TEST: IPv6: redirect exception                                      [ OK ]
   # TEST: IPv4: redirect exception plus mtu                             [ OK ]
   # TEST: IPv6: redirect exception plus mtu                             [ OK ]
   # TEST: IPv4: routing reset                                           [ OK ]
   # TEST: IPv6: routing reset                                           [ OK ]
   # TEST: IPv4: mtu exception                                           [ OK ]
   # TEST: IPv6: mtu exception                                           [ OK ]
   # TEST: IPv4: mtu exception plus redirect                             [ OK ]
   # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
   #
   # ###########################################################################
   # Legacy routing with VRF
   # ###########################################################################
   #
   # Error: Unknown device type.
   # Cannot find device "red"
   # Error: argument "red" is wrong: Invalid VRF
   #
   # Error: argument "red" is wrong: Invalid VRF
   #
   # Cannot find device "red"
   # Cannot find device "red"
   # Error: argument "red" is wrong: Not a valid VRF name
   #
   # Error: argument "red" is wrong: Invalid VRF
   #
   # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
   # TEST: IPv4: redirect exception                                      [FAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # TEST: IPv6: redirect exception                                      [XFAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
   # TEST: IPv4: redirect exception plus mtu                             [FAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # TEST: IPv6: redirect exception plus mtu                             [XFAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
   # TEST: IPv4: routing reset                                           [FAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # TEST: IPv6: routing reset                                           [XFAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
   # TEST: IPv4: mtu exception                                           [FAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # TEST: IPv6: mtu exception                                           [XFAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
   # TEST: IPv4: mtu exception plus redirect                             [FAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
   #
   # ###########################################################################
   # Routing with nexthop objects
   # ###########################################################################
   #
   # TEST: IPv4: redirect exception                                      [ OK ]
   # TEST: IPv6: redirect exception                                      [ OK ]
   # TEST: IPv4: redirect exception plus mtu                             [ OK ]
   # TEST: IPv6: redirect exception plus mtu                             [ OK ]
   # TEST: IPv4: routing reset                                           [ OK ]
   # TEST: IPv6: routing reset                                           [ OK ]
   # TEST: IPv4: mtu exception                                           [ OK ]
   # TEST: IPv6: mtu exception                                           [ OK ]
   # TEST: IPv4: mtu exception plus redirect                             [ OK ]
   # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
   #
   # ###########################################################################
   # Routing with nexthop objects and VRF
   # ###########################################################################
   #
   # Error: Unknown device type.
   # Cannot find device "red"
   # Error: argument "red" is wrong: Invalid VRF
   #
   # Error: argument "red" is wrong: Invalid VRF
   #
   # Cannot find device "red"
   # Cannot find device "red"
   # Error: argument "red" is wrong: Not a valid VRF name
   #
   # Error: argument "red" is wrong: Invalid VRF
   #
   # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
   # TEST: IPv4: redirect exception                                      [FAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # TEST: IPv6: redirect exception                                      [XFAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
   # TEST: IPv4: redirect exception plus mtu                             [FAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # TEST: IPv6: redirect exception plus mtu                             [XFAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
   # TEST: IPv4: routing reset                                           [FAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # TEST: IPv6: routing reset                                           [XFAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
   # TEST: IPv4: mtu exception                                           [FAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # TEST: IPv6: mtu exception                                           [XFAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # ./icmp_redirect.sh: line 71: [: 1: unary operator expected
   # TEST: IPv4: mtu exception plus redirect                             [FAIL]
   # Error: argument "red" is wrong: Invalid VRF
   #
   # TEST: IPv6: mtu exception plus redirect                             [XFAIL]
   #
   # Tests passed:  18
   # Tests failed:  10
   # Tests xfailed:  12
   not ok 35 selftests: net: icmp_redirect.sh # exit=1

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1938964

Title:
  icmp_redirect from selftests fails on F/kvm (unary operator expected)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/1938964/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to