You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
815 B

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2019 Petr Vorel <pvorel@suse.cz>
# Copyright (c) International Business Machines Corp., 2006
# Author: Mitsuru Chinen <mitch@jp.ibm.com>
# Rewrite into new shell API: Petr Vorel
#
# Change route destination
# lhost: 10.0.0.2, rhost: 10.23.x.1
TST_TESTFUNC="test_dst"
. route-lib.sh
setup()
{
tst_res TINFO "change IPv$TST_IPVER route destination $NS_TIMES times"
}
test_dst()
{
local iface="$(tst_iface)"
local rt="$(tst_ipaddr_un -p $1)"
local rhost="$(tst_ipaddr_un $1 1)"
tst_res TINFO "testing route '$rt'"
tst_add_ipaddr -s -q -a $rhost rhost
ROD ip route add $rt dev $iface
EXPECT_PASS_BRK ping$TST_IPV6 -c1 -I $(tst_ipaddr) $rhost \>/dev/null
ROD ip route del $rt dev $iface
tst_del_ipaddr -s -q -a $rhost rhost
}
tst_run