Skip to content

Commit

Permalink
net: add tests for adding routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Snaipe committed Apr 18, 2021
1 parent 7013be9 commit e20eb0f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/net.t
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,24 @@ Adding addresses
valid_lft forever preferred_lft forever
inet6 fe80::fced:deff:fead:beef/64 scope link tentative
valid_lft forever preferred_lft forever

Adding routes

$ bst --route gateway=1.1.1.1 -- ip route show
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]

$ bst --ip 172.20.0.2/16,lo --route src=172.20.0.2,dst=10.0.0.0/8,gateway=172.20.0.1 -- ip route show
10.0.0.0/8 via 172.20.0.1 dev lo

$ bst --ip 172.20.0.2/16,lo --route src=172.20.0.2,gateway=172.20.0.1 -- ip route show
default via 172.20.0.1 dev lo

$ bst --ip 172.20.0.2/16,lo --route dst=10.0.0.0/8,gateway=172.20.0.1 -- ip route show
10.0.0.0/8 via 172.20.0.1 dev lo

$ 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

0 comments on commit e20eb0f

Please sign in to comment.