* Use site variables to update image flavor and name
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Typo
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Prefix variable names with distro name in os-release
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Adapt tests to read os-release with prefix
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Adapt docs to show how to read os-release with prefix
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Update SDK to be aware of attr prefixes
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Adapt test with new variable names
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Temporarily print the os-release
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Check KAIROS_VERSION on tests and fallback to VERSION
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Match kubo ID and VERSION_ID
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Make kubo extension match any ID
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Test still fails, trying with surrounding quotes
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Reduce tests wait time
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Use tumbleweed for bundles tests
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Update docs about systemd-sysext
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* reduce wait time in reset tests
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
---------
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Refactor tests to use the "VM" construct from peg
📖 Add cloud-config.json for v1.6.0 (#977)
:docs: Add cloud-config.json for v1.6.0
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
📖 Add documentation about schema validation (#978)
* 📖 Add documentation for cloud config validation
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Add image
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
* Move image to static dir
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
---------
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
🐛 Backport dracut patch for ubuntu 20 iscsi (#979)
🔧 Use random free port for Spice display and SSH
When running the install test with qemu, the second test will
fail because the 2nd machine will fail to start.
The failure is cause because the port of the previous machine is
still not freed.
Hence, let the install-test use a differnet random port if not
specified.
`GetFreePorts` copied from `kairos-io/kcrypt-challenger`.
Credits @jimmykarily.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Update peg and use new VM interface
This enables creating mulitple VMs in parallel
as done in kairos-io/kcrypt-challenger.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Handle possible collision of spice and SSH ports
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Migrate all tests to new PEG API
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Remove one more reference to old API.
Replace Machine.SendFile with vm.Scp
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Try and fix bundle_tests
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Temporarily disable many flavours
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Bump peg and fix code
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Remove unecessary output and fix test issues
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Make sure we install before we start checking things.
It seems that we were relying on previous tests to do the installation
because we only had one "Machine".
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Bump peg to better handle "Sudo", dedup tests
and make sure installation has happened before every check
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Wait until systemd service becomes active
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Merge multiple similar tests into one
because the big overhead comes from the BeforeEach block which is the
same in all tests. The tests themselves are just checking differnet
things on similar VMs. By merging them we same a lot of time in
preparing the same env again and again.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Fix forgotten "Machine"
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Bring all flavors back
This partly reverts commit aa029c20acd79c46122783aad030e2a5410a9374.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Merge similar tests an uncomment code
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Fix fogotten global Machine function
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Wait for systemd-sysext to do its thing
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Fix forgotten global Sudo and remove gatherLogs
which wasn't working anyway
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Fixes after rebase
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Fix `source` not present in ubuntu/debian `/bin/sh`
and add debug output to failed test
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Bump peg to fix "read only filesystem" error in tests
50b63c0bf8
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Use "." instead of "source" in vm's "/bin/sh"
because "source" is not recognised in debian based flavors
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Bump peg to fix vm.Sudo problems
and remove redundant check.
Now peg just pipes the ssh command without creating tmp scripts
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
---------
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Co-authored-by: Mauro Morales <mauro.morales@spectrocloud.com>
Co-authored-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* 🔧 merge custom mounts tests
Since the feature is now merged, we no longer need
a single label for this. This saves a few CI cycles.
To acheive this, we add the correct sections to the normal
install sections and assert that these paths exist.
The previous assertions are kept, but in order to make
code a bit more readable, I extracted the anonymous function
that collects the data from the installed VM.
Instead of repeating the installation 4 times, we now only
repeat the installation 2 times.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Refactor tests
Works with VBox, fails with QEMU
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Fix cloud-config identation
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
---------
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* ✨ custom user bind and ephemeral mounts
Users can now specify custom and ephemeral mounts in cloud-init under
the `install` section, e.g.:
```
users:
- name: kairos
...
install:
auto: true
device: "auto"
bind_mounts:
- /mnt/bind1
- /mnt/bind2
ephemeral_mounts:
- /mnt/ephemeral
- /mnt/ephemeral2
...
```
Ephemeral mounts are mounted as RW - but changes are discarded when the
machine is restart.
Bind mounts will persist changes after restarted.
This is a fix for #210
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Add the custom user mount to /cos/run/cos-layout.env
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Add docs for custom user mounts in configuration example
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Reuse test_install function
DRY the code, change how we call the function install_test
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Enable custom mount tests and install tests
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Enable tests in CI
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Remove duplicate if check
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Remove uneeded fmt.Println ...
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Use separate label for custom mounts
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 🔧 Earthfile - DRY ginkgo
We repeat this a more than twice so just extract to own
target...
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Correct return type for ContainElements
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Remove CLOUD_INIT from custom mounts test
This is not needed here.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Fix qemu-test-* earthly targets
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 🔧 Fix CPU passing to VM
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 🔧 remove apt cache after install qemu
Helps deal with space running out in the CI.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 📖 Document custom mounts
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
---------
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
* 🔧 Enable spice in scripts/start_vm_qemu.sh
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 🔧 add option specify display for qemu
This works only with https://github.com/spectrocloud/peg/pull/2
merged.
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* 🔧 add option to enable KVM
ISO=/home/oznt/Software/spectro-cloud/kairos/build/kairos-core-opensuse.iso \
CREATE_VM=true USE_QEMU=true \
MACHINE_DISPLAY="-vga qxl -spice port=5903,addr=127.0.0.1,disable-ticketing=yes" \
KVM=true ginkgo run -v tests
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Fix failing tests - qemu does not have /dev/sda
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
* Update peg dependency
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
seedling: test VM configure RAM and CPUs
Allow adding more CPU and RAM for the test machine.
This improves perfomance of tests.
You can now run the suite with the following command to
create a test VM with more CPUs and RAM:
```
MEMORY=9048 CPUS=4 ISO=.../kairos/kairos-...iso CREATE_VM=true ginkgo run tests/
```
Fix#689
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
Signed-off-by: Oz Tiram <oz@spectrocloud.com>
refactor: move from io/ioutil to io and os packages
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.
[1]: https://golang.org/doc/go1.16#ioutil
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Depending on the kernel being used, we build now 2 distinct images
(alpine-opensuse-leap and alpine-ubuntu).
Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
* 🤖 Run datasource tests on CircleCI
* 🤖 Run bundles tests on CircleCI
* 🤖 Fixups
* 🤖 Run cli tests to CircleCI
* 🤖 Extend wait time
* 🤖 Fail when VM is aborted
* 🤖 Enlart waiting time window
* 🤖 Do not set VM specs
* 🤖 Shift just some of the tests