1#!/bin/sh 2# SPDX-License-Identifier: GPL-2.0-or-later 3# Copyright (c) 2019 Petr Vorel <pvorel@suse.cz> 4# Copyright (c) International Business Machines Corp., 2006 5# Author: Mitsuru Chinen <mitch@jp.ibm.com> 6# Rewrite into new shell API: Petr Vorel 7# 8# Change route destination 9# lhost: 10.0.0.2, rhost: 10.23.x.1 10 11TST_TESTFUNC="test_dst" 12. route-lib.sh 13 14setup() 15{ 16 tst_res TINFO "change IPv$TST_IPVER route destination $NS_TIMES times" 17} 18 19test_dst() 20{ 21 local iface="$(tst_iface)" 22 local rt="$(tst_ipaddr_un -p $1)" 23 local rhost="$(tst_ipaddr_un $1 1)" 24 25 tst_res TINFO "testing route '$rt'" 26 27 tst_add_ipaddr -s -q -a $rhost rhost 28 ROD ip route add $rt dev $iface 29 EXPECT_PASS_BRK ping$TST_IPV6 -c1 -I $(tst_ipaddr) $rhost \>/dev/null 30 ROD ip route del $rt dev $iface 31 tst_del_ipaddr -s -q -a $rhost rhost 32} 33 34tst_run 35