Commit Graph

32 Commits

Author SHA1 Message Date
Itxaka
05ed54115f
Improve uki iso stuff (#1854) 2023-10-03 22:00:55 +02:00
Itxaka
ee22b45208
🤖 Add simple UKI test (#1619) 2023-07-20 15:51:26 +02:00
Itxaka
1b98143b4a
Build provider in kairos and bring provider-kairos tests (#1592)
Co-authored-by: Mauro Morales <contact@mauromorales.com>
2023-07-12 22:43:11 +02:00
Itxaka
22d7a418b5
Fully drop elemental from kairos (#1441) 2023-05-25 15:25:47 +02:00
Itxaka
d28d4d9a2b
🤖 Add encryption tests (#1394)
:rotbot: Add encryption tests

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-05-11 10:47:55 +02:00
Itxaka
9011e8c94a
🤖 ⬆️ Use latest agent and fix install tests (#1387) 2023-05-08 20:33:12 +02:00
Mauro Morales
2e1ff888c3
🌱 Prefix variable names with distro name in os-release (#1263)
* 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>
2023-04-19 22:37:00 +02:00
Itxaka
836d81eb00
🤖 Update immucore dev testing (#1059)
There is now less files to copy over

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-09 18:57:00 +01:00
Oz Tiram
99749ed679
🔧 Use random free port for Spice display and SSH (#832)
* 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>
2023-03-01 23:55:40 +01:00
Oz Tiram
b6fae30a0e
🔧 merge custom mounts tests (#814)
* 🔧 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>
2023-02-07 17:19:33 +01:00
Oz Tiram
f8aef9e1f5
custom user bind and ephemeral mounts (#692)
*  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>
2023-02-03 11:04:02 +01:00
Oz Tiram
5879135781
Add machine display (#726)
* 🔧 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>
2023-01-27 09:01:16 +01:00
Oz Tiram
1dbd14f7c9
🌱 test VM configure RAM and CPUs (#690)
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>
2023-01-20 09:30:18 +02:00
Oz Tiram
e378818a48
🌱 Add option to preserve the VM used for testing (#686)
Fix #685


Signed-off-by: Oz Tiram <oz@spectrocloud.com>
2023-01-19 15:52:25 +00:00
Dimitris Karakasilis
c9d239c032
🤖 Netboot testing (#523)
* Create earthly target and test for netboot

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* Add new tests to the pipeline

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* Fix typo

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* Update tests/tests_suite_test.go

Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
2022-12-03 11:30:15 +01:00
Eng Zer Jun
50d914397a
🎨 Move from io/ioutil to io and os packages (#470)
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>
2022-11-21 17:11:03 +00:00
Ettore Di Giacinto
57d914b2df
🐧 Split alpine images into dedicated channels (#457)
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>
2022-11-19 11:38:41 +01:00
Ettore Di Giacinto
3edf7a653e
Move some CI tests to CircleCI (#178)
* 🤖 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
2022-10-04 21:44:27 +02:00
Ettore Di Giacinto
b541b36fde
🤖 Enlarge default cpu and memory for tests (#176) 2022-10-04 00:34:46 +02:00
Ettore Di Giacinto
3d0a01da7a 📝 More minor fixups 2022-09-29 13:33:05 +00:00
Ettore Di Giacinto
0d698eb0c2
🤖 Cleanup and refactor tests (#157) 2022-09-28 23:52:30 +02:00
Ettore Di Giacinto
d68c9b7686
🤖 Run test suites on qemu/ubuntu (#142) 2022-09-23 00:32:50 +02:00
Ettore Di Giacinto
d656587655
🎨 Rebranding (#130)
See: https://github.com/c3os-io/c3os/issues/88
2022-09-17 18:43:51 +02:00
Ettore Di Giacinto
14adfd1709 🤖 Adapt tests 2022-08-14 17:18:37 +00:00
mudler
9c2747763f 🎨 Drop provider from c3os code
Part of: https://github.com/c3os-io/c3os/issues/68
2022-08-12 19:37:58 +00:00
Ettore Di Giacinto
2a8f73b2fa 🤖 Add target to run qemu tests locally 2022-07-20 20:41:26 +00:00
Ettore Di Giacinto
8468f37c56 🤖 Attempt to fix tests 2022-07-20 20:41:25 +00:00
Ettore Di Giacinto
cb12a0bfad 🤖 Add qrcode test 2022-07-17 13:04:15 +00:00
Ettore Di Giacinto
c14a50013b 🤖 Add upgrade tests from latest release 2022-05-29 20:02:43 +00:00
mudler
81fc8d82ed 🤖 Add tests for single clusters 2022-05-08 23:52:34 +02:00
Ettore Di Giacinto
da4089e98a 🤖 Generate config on each test run 2022-02-26 10:27:57 +01:00
Ettore Di Giacinto
3fb708fb48 🤖 Simplify tests 2022-02-19 13:59:00 +01:00