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

github: add system tests #281

Merged
merged 53 commits into from
Apr 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f3fcf41
test/includes/microcloud: allow using a dedicated storage source device
simondeziel Apr 10, 2024
460a715
test/includes/microcloud: only install zfsutils-linux and htop if CLO…
simondeziel Apr 10, 2024
894df61
test/includes/microcloud: stop adding ubuntu-minimal:
simondeziel Apr 13, 2024
a3db46f
test/includes/check: require instance_ready_state API on host LXD
simondeziel Apr 10, 2024
29d4fd4
test/suites/basic: use ubuntu-minimal for c1/v1
simondeziel Apr 10, 2024
5782411
test/suites/basic: poll less frequently when waiting on c1/v1
simondeziel Apr 10, 2024
6703cab
test/suites/basic: report when c1/v1 have booted successfully
simondeziel Apr 10, 2024
84af383
test/main: fix indentation
simondeziel Apr 10, 2024
d9c0bb7
github: fix check for compat with Go 1.22.0
simondeziel Apr 10, 2024
63aef4e
github: align tests job with LXD's
simondeziel Apr 10, 2024
65027ba
github: add initial (snap-based) system tests
simondeziel Apr 10, 2024
e37f1cb
github: require system tests to pass before triggering LP build
simondeziel Apr 10, 2024
312586a
test/includes/microcloud: nicer output when wiping/deleting disks
simondeziel Apr 15, 2024
1685e7d
test/suite/basic: nicer output when starting c1/v1
simondeziel Apr 15, 2024
a4e80b0
test/includes/microcloud: use lxd default channel (5.21/stable as of …
simondeziel Apr 11, 2024
8a82f7b
test/includes/microcloud: fix restore_system arg passing
simondeziel Apr 12, 2024
841546a
test/suites/basic: create smaller c1/v1 instances
simondeziel Apr 11, 2024
05d2021
test/suites/basic: rename test_instances to test_instances_launch
simondeziel Apr 15, 2024
6647c2f
test/main: rename test_instances to test_instances_launch
simondeziel Apr 15, 2024
6044ed4
test/includes/microcloud: set suitable PATH in the profile
simondeziel Apr 15, 2024
c26b1e6
test/includes/microcloud: call new_system() in new_systems()
simondeziel Apr 15, 2024
1fc2abc
test/includes/microcloud: use wait even if CONCURRENT_SETUP!=1
simondeziel Apr 15, 2024
210ba10
test/suites/basic: use less subshells in test_instances_launch()
simondeziel Apr 15, 2024
cc1f5f6
test/suites/basic: add test_instances_config() test
simondeziel Apr 15, 2024
28f140d
test/suites/preseed: use less subshells
simondeziel Apr 15, 2024
a21f3a6
test/main: add test_instances_config
simondeziel Apr 15, 2024
552cc7d
test/suites/basic: optionally skip launching VMs on microcloud
simondeziel Apr 15, 2024
603022d
github: skip launching VMs on top of microcloud VMs
simondeziel Apr 15, 2024
5718473
test/suites/basic: fix TEST_CONSOLE=0
simondeziel Apr 15, 2024
51bb646
test/suites/preseed: fix TEST_CONSOLE=0
simondeziel Apr 15, 2024
5913911
test/suites/add: reduce subshell use
simondeziel Apr 16, 2024
bb2da36
test/includes/microcloud: safer grep
simondeziel Apr 16, 2024
b357b8d
test/suites/add: less subshells
simondeziel Apr 16, 2024
8bf8980
test/suites/basic: safer grep
simondeziel Apr 16, 2024
05237c6
test/suites/basic: less subshells
simondeziel Apr 16, 2024
05edfae
test/main: running single test case also require the new_systems call
simondeziel Apr 16, 2024
acb3363
test/suites/basic: s/test_case/_test_case/ as it's not an actual test…
simondeziel Apr 16, 2024
ea238de
test/main: rework how individual/group test(s) are run
simondeziel Apr 16, 2024
4bc8ba5
github: split system tests into suites
simondeziel Apr 16, 2024
f488f18
test/includes/microcloud: only take a snapshot if SNAPSHOT_RESTORE=1
simondeziel Apr 16, 2024
2d2333d
test/includes/microcloud: use cohorts for micro{ceph,ovn,cloud} too
simondeziel Apr 16, 2024
1655238
test/includes/microcloud: workaround for LXD shutdown bug (debug)
simondeziel Apr 16, 2024
867fd0a
test/includes/microcloud: add some echos to set_debug_binaries()
simondeziel Apr 16, 2024
4badb3f
test/includes/microcloud: poll less aggressively in lxd_wait_vm()
simondeziel Apr 16, 2024
faf9cf1
test/includes/microcloud: less subshells
simondeziel Apr 17, 2024
f6cd47a
test/includes/microcloud: use LXD latest/edge (https://github.com/can…
simondeziel Apr 17, 2024
a4d84df
test/includes/microcloud: safer grep
simondeziel Apr 17, 2024
d4cd4c3
test/includes/microcloud: safer grep for matching numeric args
simondeziel Apr 18, 2024
c72c720
test/includes/microcloud: use quiet file pushes
simondeziel Apr 18, 2024
a74a6d9
github: sideload microcloud{,d} binaries for system-tests
simondeziel Apr 17, 2024
78f92bc
test/suites/basic: add test OVN connectivity
simondeziel Apr 18, 2024
c1eef92
test/suites/basic: use smaller rootfs
simondeziel Apr 18, 2024
a827156
test/includes/microcloud: simplify rm -rf globbing
simondeziel Apr 18, 2024
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
12 changes: 6 additions & 6 deletions microcloud/test/includes/microcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,8 @@ setup_lxd_project() {
fi

lxc remote switch local
lxc project create microcloud-test || true
lxc project switch microcloud-test
lxc project create microcloud-test || true
simondeziel marked this conversation as resolved.
Show resolved Hide resolved
lxc project switch microcloud-test

# Create a zfs pool so we can use fast snapshots.
if [ -z "${TEST_STORAGE_SOURCE:-}" ]; then
Expand Down Expand Up @@ -879,6 +879,7 @@ EOF

lxc profile set default environment.TEST_CONSOLE=1
lxc profile set default environment.DEBIAN_FRONTEND=noninteractive
lxc profile set default environment.PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
)
}

Expand Down Expand Up @@ -932,11 +933,10 @@ setup_system() {
lxc exec "${name}" -- apt-get install --no-install-recommends -y jq
fi

lxc exec "${name}" -- sh -c "PATH=\$PATH:/snap/bin snap install snapd"
lxc exec "${name}" -- snap install snapd

# Snaps can occasionally fail to install properly, so repeatedly try.
lxc exec "${name}" -- sh -c "
export PATH=\$PATH:/snap/bin
while ! test -e /snap/bin/microceph ; do
snap install microceph || true
sleep 1
Expand All @@ -959,9 +959,9 @@ setup_system() {

if [ -n "${MICROCLOUD_SNAP_PATH}" ]; then
lxc file push "${MICROCLOUD_SNAP_PATH}" "${name}"/root/microcloud.snap
lxc exec "${name}" -- sh -c "PATH=\$PATH:/snap/bin snap install --devmode /root/microcloud.snap"
lxc exec "${name}" -- snap install --devmode /root/microcloud.snap
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using --dangerous rather than --devmode as the latter isn't confined and isn't a representative test.

else
lxc exec "${name}" -- sh -c "PATH=\$PATH:/snap/bin snap install microcloud --channel latest/edge"
lxc exec "${name}" -- snap install microcloud --channel latest/edge
fi

set_debug_binaries "${name}"
Expand Down