Skip to content

Commit

Permalink
test/suites/basic: add test OVN connectivity
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Apr 18, 2024
1 parent df78c4e commit 46c02e6
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions microcloud/test/suites/basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,17 @@ devices:
type: disk
EOF

# Launch a container and VM with CEPH storage & OVN network.
# Launch 2 containers and VM with CEPH storage & OVN network.
if [ "${SKIP_VM_LAUNCH}" = "1" ]; then
echo "::warning::SKIPPING VM LAUNCH TEST"
else
lxc exec micro01 -- lxc launch ubuntu-minimal:22.04 v1 -c limits.memory=512MiB -d root,size=3GiB --vm -s remote -n default
fi
lxc exec micro01 -- lxc launch ubuntu-minimal:22.04 c1 -c limits.memory=512MiB -d root,size=3GiB -s remote -n default
lxc exec micro01 -- lxc launch ubuntu-minimal:22.04 c2 -c limits.memory=512MiB -d root,size=3GiB -s remote -n default

# Ensure we can reach the launched instances.
for m in c1 v1 ; do
for m in c1 c2 v1 ; do
if [ "${m}" = "v1" ] && [ "${SKIP_VM_LAUNCH}" = "1" ]; then
continue
fi
Expand All @@ -357,8 +358,6 @@ EOF
lxc exec ${m} -- stat /cephfs
echo \" ${m} booted successfully\"
lxc rm ${m} -f
return 0
fi
echo -n .
Expand All @@ -368,6 +367,35 @@ EOF
return 1
"
done

echo "Test connectivity to lxdbr0"
IPV4_GW="$(lxc network get lxdbr0 ipv4.address | cut -d/ -f1)"
IPV6_GW="$(lxc network get lxdbr0 ipv6.address | cut -d/ -f1)"

lxc exec micro01 -- lxc exec c1 -- ping -nc1 -w5 -4 "${IPV4_GW}"
lxc exec micro01 -- lxc exec c2 -- ping -nc1 -w5 -4 "${IPV4_GW}"
lxc exec micro01 -- lxc exec c1 -- ping -nc1 -w5 -6 "${IPV6_GW}"
lxc exec micro01 -- lxc exec c2 -- ping -nc1 -w5 -6 "${IPV6_GW}"
if [ "${SKIP_VM_LAUNCH}" != "1" ]; then
lxc exec micro01 -- lxc exec v1 -- ping -nc1 -w5 -4 "${IPV4_GW}"
lxc exec micro01 -- lxc exec v1 -- ping -nc1 -w5 -6 "${IPV6_GW}"
fi

echo "Test connectivity between instances"
lxc exec micro01 -- lxc exec c1 -- ping -nc1 -w5 -4 c2
lxc exec micro01 -- lxc exec c2 -- ping -nc1 -w5 -4 c1
lxc exec micro01 -- lxc exec c1 -- ping -nc1 -w5 -6 c2
lxc exec micro01 -- lxc exec c2 -- ping -nc1 -w5 -6 c1
if [ "${SKIP_VM_LAUNCH}" != "1" ]; then
lxc exec micro01 -- lxc exec c1 -- ping -nc1 -w5 -4 v1
lxc exec micro01 -- lxc exec v1 -- ping -nc1 -w5 -4 c1
lxc exec micro01 -- lxc exec c1 -- ping -nc1 -w5 -6 v1
lxc exec micro01 -- lxc exec v1 -- ping -nc1 -w5 -6 c1

lxc exec micro01 -- lxc delete -f v1
fi

lxc exec micro01 -- lxc delete -f c1 c2
}

_test_case() {
Expand Down

0 comments on commit 46c02e6

Please sign in to comment.