selftests: fib_tests: Fix 'Command line is not complete' errors
authorDavid Ahern <dsahern@gmail.com>
Tue, 9 Apr 2019 21:23:10 +0000 (14:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:41:21 +0000 (19:41 +0200)
commite4525c9d9adaf5a8855273b857897d52d964d210
tree7ba97518ad712196576e125a3734d837f3797965
parent7828986b84ba68ee4dbe0b8bf7cba351c9b7b730
selftests: fib_tests: Fix 'Command line is not complete' errors

[ Upstream commit a5f622984a623df9a84cf43f6b098d8dd76fbe05 ]

A couple of tests are verifying a route has been removed. The helper
expects the prefix as the first part of the expected output. When
checking that a route has been deleted the prefix is empty leading
to an invalid ip command:

  $ ip ro ls match
  Command line is not complete. Try option "help"

Fix by moving the comparison of expected output and output to a new
function that is used by both check_route and check_route6. Use the
new helper for the 2 checks on route removal.

Also, remove the reset of 'set -x' in route_setup which overrides the
user managed setting.

Fixes: d69faad76584c ("selftests: fib_tests: Add prefix route tests with metric")
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/net/fib_tests.sh