diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 14:18:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 14:18:53 +0000 |
commit | a0e0018c9a7ef5ce7f6d2c3ae16aecbbd16a8f67 (patch) | |
tree | 8feaf1a1932871b139b3b30be4c09c66489918be /testsuite/tests/ip/route/add_default_route.t | |
parent | Initial commit. (diff) | |
download | iproute2-a0e0018c9a7ef5ce7f6d2c3ae16aecbbd16a8f67.tar.xz iproute2-a0e0018c9a7ef5ce7f6d2c3ae16aecbbd16a8f67.zip |
Adding upstream version 6.1.0.upstream/6.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | testsuite/tests/ip/route/add_default_route.t | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/tests/ip/route/add_default_route.t b/testsuite/tests/ip/route/add_default_route.t new file mode 100755 index 0000000..ded4edc --- /dev/null +++ b/testsuite/tests/ip/route/add_default_route.t @@ -0,0 +1,35 @@ +#!/bin/sh + +. lib/generic.sh + +ts_log "[Testing add default route]" + +DEV=dummy0 + +ts_ip "$0" "Add new interface $DEV" link add $DEV type dummy +ts_ip "$0" "Set $DEV into UP state" link set up dev $DEV + +ts_ip "$0" "Add 1.1.1.1/24 addr on $DEV" addr add 1.1.1.1/24 dev $DEV +ts_ip "$0" "Add default route via 1.1.1.2" route add default via 1.1.1.2 + +ts_ip "$0" "Show IPv4 default route" -4 route show default +test_on "default via 1.1.1.2 dev $DEV" +test_lines_count 1 + +ts_ip "$0" "Add another IPv4 route dst 2.2.2.0/24" -4 route add 2.2.2.0/24 dev $DEV +ts_ip "$0" "Show IPv4 default route" -4 route show default +test_on "default via 1.1.1.2 dev $DEV" +test_lines_count 1 + +ts_ip "$0" "Add dead:beef::1/64 addr on $DEV" -6 addr add dead:beef::1/64 dev $DEV +ts_ip "$0" "Add default route via dead:beef::2" route add default via dead:beef::2 +ts_ip "$0" "Show IPv6 default route" -6 route show default +test_on "default via dead:beef::2 dev $DEV" +test_lines_count 1 + +ts_ip "$0" "Add another IPv6 route dst cafe:babe::/64" -6 route add cafe:babe::/64 dev $DEV +ts_ip "$0" "Show IPv6 default route" -6 route show default +test_on "default via dead:beef::2 dev $DEV" +test_lines_count 1 + +ts_ip "$0" "Del $DEV dummy interface" link del dev $DEV |