Skip to content

Commit

Permalink
Merge pull request #46 from simondeziel/network-non-kvm-kernel
Browse files Browse the repository at this point in the history
tests/network: use 23.10 as the real NIC is passed onto the VM and -k…
  • Loading branch information
tomponline authored Dec 11, 2023
2 parents 46e713f + 90052d8 commit cf73496
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions bin/helpers
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ runsMinimumKernel() (

# cleanup: report if the test passed or not and return the appropriate return code.
cleanup() {
# Run any extra cleanup function
if command -v extra_cleanup > /dev/null; then
extra_cleanup || true
fi

echo ""
if [ "${FAIL}" = "1" ]; then
echo "Test failed"
Expand Down
2 changes: 1 addition & 1 deletion bin/local-run
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ test_name="$(basename "${script}")"

echo "==> Running the job ${test_name} against ${lxd_snap_channel}" >&2
sed -e "1 a LXD_SNAP_CHANNEL=${lxd_snap_channel}" -e "1 r bin/helpers" "${script}" > "${_script}"
exec bash "${_script}" "${*}"
exec bash "${_script}" "${@}"
10 changes: 6 additions & 4 deletions tests/cluster
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh
set -eu
set -eux

# Install LXD
install_lxd

PREFIX="cluster-$$"

Expand All @@ -22,18 +25,17 @@ print_log() {

# Cleanup on shutdown
SIZE="$1"
cleanup() {
extra_cleanup() {
# Delete the cluster
echo "==> Deleting the cluster"
for i in $(seq "${SIZE}"); do
print_log "${PREFIX}-$i"
lxc delete --force "${PREFIX}-$i"
done
}
trap cleanup EXIT HUP INT TERM

# Launch the container
lxc launch ubuntu-daily:22.04 "${PREFIX}-1" -c security.nesting=true
lxc launch ubuntu-daily:22.04 "${PREFIX}-1" -c security.nesting=true -c security.devlxd.images=true

sleep 10

Expand Down
4 changes: 2 additions & 2 deletions tests/network
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ lxc profile device add default root disk path=/ pool=default

# Launch instances with physical NICs
echo "==> VM on default VLAN with physical"
lxc init ubuntu-daily:22.04 v1-physical --vm -c limits.cpu=3
lxc init ubuntu-daily:23.10 v1-physical --vm -c limits.cpu=3
lxc config device add v1-physical eth0 nic nictype=physical parent="${parentNIC}v1" name=eth0
lxc start v1-physical

Expand All @@ -40,7 +40,7 @@ lxc start c1-macvlan

# Launch instances with sriov NICs
echo "==> VM on default VLAN with sriov"
lxc init ubuntu-daily:22.04 v1-sriov --vm -c limits.cpu=3
lxc init ubuntu-daily:23.10 v1-sriov --vm -c limits.cpu=3
lxc config device add v1-sriov eth0 nic nictype=sriov parent="${parentNIC}" name=eth0
lxc start v1-sriov

Expand Down

0 comments on commit cf73496

Please sign in to comment.