Skip to content

Commit

Permalink
test/suites: Test for listing gateway leases
Browse files Browse the repository at this point in the history
Signed-off-by: hamistao <[email protected]>
  • Loading branch information
hamistao committed Oct 23, 2024
1 parent 0bd8de9 commit 9efb65f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/suites/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,18 @@ test_network() {
# Create new project with an instance with ipv[46] for the next tests.
lxc project create foo -c features.networks=false -c features.images=false -c features.profiles=false
lxc launch testimage outsider -n lxdt$$ --project foo
gateway_addr="$(lxc network get lxdt$$ ipv4.address | cut -d/ -f1)"
v4_addr_foo="$(lxc network get lxdt$$ ipv4.address | cut -d/ -f1)1"
v6_addr_foo="$(lxc network get lxdt$$ ipv6.address | cut -d/ -f1)01"
lxc config device set outsider eth0 ipv4.address "${v4_addr_foo}" --project foo
lxc config device set outsider eth0 ipv6.address "${v6_addr_foo}" --project foo

lxc network list-leases lxdt$$ | grep STATIC | grep -q "${v4_addr}"
lxc network list-leases lxdt$$ | grep STATIC | grep -q "${v6_addr}"
lxc network list-leases lxdt$$ | grep GATEWAY | grep -q "${gateway_addr}"
lxc network list-leases lxdt$$ --project foo | grep STATIC | grep -q "${v4_addr_foo}"
lxc network list-leases lxdt$$ --project foo | grep STATIC | grep -q "${v6_addr_foo}"
lxc network list-leases lxdt$$ --project foo | grep GATEWAY | grep -q "${gateway_addr}"

# Request DHCPv6 lease (if udhcpc6 is in busybox image).
busyboxUdhcpc6=1
Expand Down

0 comments on commit 9efb65f

Please sign in to comment.