Skip to content

Commit

Permalink
test: solidify network tests
Browse files Browse the repository at this point in the history
It's not perfect, but this should help reducing the dependency of the
test on the version of ip.
  • Loading branch information
Snaipe committed Dec 13, 2022
1 parent 4a7c125 commit d30c88f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/net.t
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Adding addresses

Adding routes

$ bst --route gateway=1.1.1.1 -- ip route show
$ (bst --route gateway=1.1.1.1 -- ip route show 2>&1 || echo [$?]) | sed 's/Network unreachable/Network is unreachable/'
bst: route_add 0.0.0.0/0 via 1.1.1.1/32 src 0.0.0.0/0 dev metric 0: Network is unreachable
[1]

Expand All @@ -58,5 +58,6 @@ Adding routes
$ bst --ip 172.20.0.2/16,lo --route gateway=172.20.0.1 -- ip route show
default via 172.20.0.1 dev lo

$ bst --route dev=lo -- ip route show
default dev lo scope link
$ exp=$(bst --no-loopback-setup sh -c 'ip link set lo up && ip route add default dev lo scope link && ip route show' 2>&1)
> act=$(bst --route dev=lo,scope=link -- ip route show 2>&1)
> [ "$exp" = "$act" ] || echo -e "-$exp\n+$act"

0 comments on commit d30c88f

Please sign in to comment.