#!/bin/bash## This test is for checking rtnetlink callpaths, and get as much coverage as possible.## set -eALL_TESTS=" kci_test_polrouting kci_test_route_get kci_test_addrlft kci_test_promote_secondaries kci_test_tc kci_test_gre kci_test_gretap kci_test_ip6gretap kci_test_erspan kci_test_ip6erspan kci_test_bridge kci_test_addrlabel kci_test_ifalias kci_test_vrf kci_test_encap kci_test_macsec kci_test_ipsec kci_test_ipsec_offload kci_test_fdb_get kci_test_fdb_del kci_test_neigh_get kci_test_bridge_parent_id kci_test_address_proto kci_test_enslave_bonding kci_test_mngtmpaddr"devdummy="test-dummy0"VERBOSE=0PAUSE=no
PAUSE_ON_FAIL=no
sourcelib.sh
# set global exit status, but never reset nonzero one.
check_err(){if[$ret-eq0];thenret=$1fi[-n"$2"]&&echo"$2"}# same but inverted -- used when command must fail for test to pass
check_fail(){if[$1-eq0];thenret=1fi}
run_cmd_common(){localcmd="$*"localout
if["$VERBOSE"="1"];thenecho"COMMAND: ${cmd}"fiout=$($cmd2>&1)rc=$?if["$VERBOSE"="1"-a-n"$out"];thenecho" $out"fireturn$rc}
run_cmd(){run_cmd_common"$@"rc=$?check_err$rcreturn$rc}
run_cmd_fail(){run_cmd_common"$@"rc=$?check_fail$rcreturn$rc}
run_cmd_grep_common(){