Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to ubuntu-daily: for integration tests inside LXD containers #574

Merged
merged 4 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions integration/run-integration-tests
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ save_trust_list() {
OLD_TRUST_LIST="$(mktemp)"
save_trust_list > "${OLD_TRUST_LIST}"

# Report which LXD version is being tested
snap list lxd || true
lxc version

# finally run the integration tests
tox -e integration

Expand Down
6 changes: 4 additions & 2 deletions integration/run-integration-tests-in-lxd
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@ DIR="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
declare -A RELEASE_IMAGES=(
[focal]="20.04"
[jammy]="22.04"
[noble]="24.04"
)

function run_tests {
local target="$1"
local image="${RELEASE_IMAGES[$target]}"
local container_name="pylxd-${target}-$$"
local container_image="ubuntu:${image}"
local container_image="ubuntu-daily:${image}"
echo "Running ${image} integration tests"

lxc launch --ephemeral "$container_image" "$container_name" -c security.nesting=true

lxc exec "$container_name" -- mkdir -p /opt/pylxd
{ cd "$DIR/.." && git archive --format=tar HEAD; } | lxc exec "$container_name" -- tar -xf - -C /opt/pylxd

lxc exec "$container_name" -- cloud-init status --long --wait
# Workaround https://github.com/canonical/cloud-init/pull/4970
lxc exec "$container_name" -- cloud-init status --long --wait || true
lxc exec "$container_name" --cwd /opt/pylxd -- integration/run-integration-tests
lxc delete --force "$container_name"
}
Expand Down