Skip to content

Commit

Permalink
Network: add test for local interfaces per cluster member
Browse files Browse the repository at this point in the history
Signed-off-by: David Edler <[email protected]>
  • Loading branch information
edlerd committed Dec 12, 2024
1 parent a9a4a5f commit b774b67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/includes/clustering.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ ip link set dev "${veth2}" name eth0
ip link set eth0 up
ip addr add "10.1.1.10${id}/16" dev eth0
ip route add default via 10.1.1.1
ip link add localBridge${id} type bridge
EOF
}

Expand Down
7 changes: 7 additions & 0 deletions test/suites/clustering.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,13 @@ test_clustering_network() {
LXD_DIR="${LXD_ONE_DIR}" lxc config device remove c3 eth0
LXD_DIR="${LXD_ONE_DIR}" lxc config device add c3 eth0 nic hwaddr="${c1MAC}" nictype=bridged parent="${net}"

# Check networks local to a cluster member show up when targeting that member
# and hidden when targeting other cluster members. Setup is in includes/clustering.sh
LXD_DIR="${LXD_ONE_DIR}" lxc network list --target=node1 | grep localBridge1
! LXD_DIR="${LXD_ONE_DIR}" lxc network list --target=node1 | grep localBridge2 || false
! LXD_DIR="${LXD_ONE_DIR}" lxc network list --target=node2 | grep localBridge1 || false
LXD_DIR="${LXD_ONE_DIR}" lxc network list --target=node2 | grep localBridge2

# Cleanup instances and image.
LXD_DIR="${LXD_ONE_DIR}" lxc delete -f c1 c2 c3
LXD_DIR="${LXD_ONE_DIR}" lxc image delete testimage
Expand Down

0 comments on commit b774b67

Please sign in to comment.