Commit Graph

110 Commits

Author SHA1 Message Date
David Cassany Viladomat 5f996b5dba
Expand downgrade test by upgrading back to origin after downgrading (#2224)
* Expand downgrade test by upgrading back to origin after downgrading

Signed-off-by: David Cassany <dcassany@suse.com>

* Adapt github worflow to handle cache for downgrade tests and import the container images

Signed-off-by: David Cassany <dcassany@suse.com>

---------

Signed-off-by: David Cassany <dcassany@suse.com>
2024-11-12 11:12:51 +01:00
David Cassany 51a85a7113 Remove unused steps in workflow
Signed-off-by: David Cassany <dcassany@suse.com>
2024-07-18 16:55:18 +02:00
David Cassany Viladomat 644cdc72ef
Refactor ci (#2137)
* Refactor CI to use a local registry
* Cache image and fetch image tarballs
* Composite fetch images
* Push to insecure registry with podman
* Simplify workflow runs
* Improve cache cleanup
* Improve ip detection

Signed-off-by: David Cassany <dcassany@suse.com>
2024-07-11 09:32:42 +00:00
David Cassany 6f0b28e113 Set legacy password for upgrade test
Signed-off-by: David Cassany <dcassany@suse.com>
2024-05-02 14:29:54 +02:00
David Cassany fd757e6160 Fix downgrade test
Signed-off-by: David Cassany <dcassany@suse.com>
2024-03-11 10:13:19 +01:00
Fredrik Lönnegren ca17862e39
Embed file permissions for features (#1961)
* Generate tarballs

This commit generates tarballs for each feature and embeds that in the
elemental binary.

The tarballs are generated before build using 'go generate ./...' and
are not checked in to source control.

When a feature is installed using elemental init the tarball will be extracted
to the filesystem.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2024-02-19 12:34:06 +00:00
Fredrik Lönnegren 81015ee7ab
Improved upgrade test (#1960)
* Use older disk version for preparing upgrade-test

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Run upgrade command in podman

This commit uses podman to run the latest version of the elemental-cli
to run the update command.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Pass UPGRADE_ARGS in test-upgrade workflow

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Some cleanup

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

* Add downgrade test

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>

---------

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2024-02-16 15:41:14 +01:00
David Cassany 6290bf3f85 Improve CI stability
Adds several improvements:

* Check VM pid on 'EventuallyConnects'. So it does not wait for a
  command to succeed if the underlaying VM crashed and it is not
  running.

* Does not use '-daemonize' flag of qemu, now it simply runs on the
  background and the stdout and stderr are redirected to vmstdout file.

* Does not install QEMU, the runner already has a recent QEMU version
  installed. This saves several minutes on each macos job.

* Fixes some of the stability issues on macOS by disabling hugepages on
  the kernel. This is not supported on macOS.

Signed-off-by: David Cassany <dcassany@suse.com>
2023-10-31 11:00:55 +01:00
David Cassany 80828a213d Add installer test
This commit adds an installer test and moves the smoke
test to be executed on the installed system rather than the
disk build.

Signed-off-by: David Cassany <dcassany@suse.com>
2023-10-30 10:34:03 +01:00
Fredrik Lönnegren 9c55b9d7da
Use build-disk command (#1847)
* Use build-disk command

This commit changes the way we build our test disks.

It uses the new build-disk command instead of losetup and the install
command. This means we can run build-disk without privileges and
also build expandable images.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-10-27 10:41:32 +02:00
Fredrik Lönnegren 1262bcd099 Move elemental-cli into elemental-toolkit module
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-05-16 09:43:57 +02:00
David Cassany a48825775c Fix Makefile.test
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany f855fd698f Refactor tests
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany 648048ddff Add reset and local upgrade tests
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany 732a61423e Add fallback test
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany a648458976 add recovery test
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
Fredrik Lönnegren 8db48e6b6f Try to fix tests
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-05-11 15:31:28 +02:00
Fredrik Lönnegren ddacca1a94 Run tests based on which media is built
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-05-11 15:31:28 +02:00
Fredrik Lönnegren 968bc7b9a8 Rename tests to test target
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-05-11 15:31:28 +02:00
Fredrik Lönnegren 89640138bf Update tests
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany c64c0fe384 Adding hooks test
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany 7d6033dabc Remove unused workflows
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany b64a0ba768 Prepare Makefile for further tests
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
David Cassany ac6bc0af33 Add installer test
Signed-off-by: David Cassany <dcassany@suse.com>
2023-05-11 15:31:28 +02:00
Itxaka 7a3c74b596
Split sign into build and run (#1698)
Build the signer without root privs so it works on any runner that
installs go as the current user.

Also run the signer as root in a different target so we can build it
once without privs and then run the binary with root as its needed due
to luet chowning files

Signed-off-by: Itxaka <igarcia@suse.com>

Signed-off-by: Itxaka <igarcia@suse.com>
2023-01-11 18:58:50 +01:00
David Cassany Viladomat ad98640adc
Fix CI issues (#1638)
* use ginkgo and gomega from go.mod

* Fix raw disk repository setup

Signed-off-by: David Cassany <dcassany@suse.com>
2022-11-04 11:06:37 +01:00
Itxaka b213a73786
Drop vbox and use qemu everywhere with EFI (#1624)
- Move packer+vagrant to use qemu only
     - Use EFI everywhere
     - Use no compression with squash
     - Output serial of packer to a file and upload it on CI
     - Drop features tests (using external rosources that made no sense
       anymore)
     - Split recovery tests into 4 tests for parallel testing
     - Bump elemental-cli
     - Bump cos version
     - Bump go.mod deps for tests
     - Use ginkgo modules from tests instead of binary
     - Drop vbox image
     - Bump packer version to latest
2022-10-18 15:27:09 +02:00
Itxaka 51861ad360
Fix signing referenceId (#1617)
When pushing the artifacts and signing them we use 2 different
apporaches to getting the current referenceID/tag/commit.

This could result in pushing one reference and using a different
one for signing.

This patch fixes that by moving the signing to the makefile,
as it should have been from the start, and reusing the same
reference for both pushing the artifacts and signing them, so
there is no possibility of mixing them up

Signed-off-by: itxaka <igarcia@suse.com>

Signed-off-by: itxaka <igarcia@suse.com>
2022-10-11 12:08:00 +02:00
Fredrik Lönnegren 6e7767a2e6 ci: change PACKAGES
Remove autogenerate from manifest, instead set default to --all and
allow overriding to be consistent with the docs.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2022-06-23 15:16:15 +02:00
Fredrik Lönnegren 355eb941f2 ci: fix error on nightly
Seems like PACKAGES is not set correctly, also /cOS in Dockerfile will
be owned by another user, which logs warnings in CI.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2022-06-23 15:16:15 +02:00
Fredrik Lönnegren ee69c3696a ci: do not upload odroid-images
Add upload-image to matrix and use in Release-step.

Also small changes to ginkgo-flag

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
2022-06-22 10:46:51 +02:00
Itxaka f223f44ac4
Split recovery tests in individual tests (#1507)
* Split recovery tests in individual tests

Using labels so we can run them individually for arm64, as they take too
long

It also uses a bit of trickery to determine if we are running the tests
with labels, which would indicate that we are running them individually
and skips the reset part to speed them up even further.

Currently only done for arm64, x86 tests are still run on the whole
suite

Signed-off-by: Itxaka <igarcia@suse.com>

* Fix label picking up 2 tests

Signed-off-by: Itxaka <igarcia@suse.com>
2022-06-14 13:42:51 +02:00
Ettore Di Giacinto 6574656c49
Update testhelpers (#1479)
* Update testhelpers

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* tests: increase default ginkgo timeout

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-06-06 16:25:46 +00:00
Itxaka a7a2841fa8
Move everything to yq4 (#1481) 2022-06-06 15:51:05 +00:00
David Cassany Viladomat 1501bcc18e
Revert cos-img package removal (#1464)
This commit is required in order to fix the raw disk creation

Signed-off-by: David Cassany <dcassany@suse.com>
2022-06-01 22:26:02 +02:00
Ettore Di Giacinto 1eba88dad1
Docs fixups (#1468)
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-06-01 15:21:59 +02:00
David Cassany Viladomat c1cd19241c
Remove squashfs recovery image build and ISO
* Remove squashfs iso
* Adding squashfs build sources in packer
* Verify squashfs recovery is used in installation tests
* Bump elemental
2022-05-30 16:14:27 +00:00
Itxaka 95de5dd769
Fix raw_disk building (#1345)
* Fix raw_disk building

Set the proper values on the manifest so it picks up the repos.
Also set the FINAL_REPO for the ARCH on raw_image build with a priority
of 30 so its below the local build repository

Signed-off-by: Itxaka <igarcia@suse.com>

* Bump elemental

Signed-off-by: Itxaka <igarcia@suse.com>

* set config dir to . to pick up the manifest.yaml

Signed-off-by: Itxaka <igarcia@suse.com>
2022-05-20 12:38:33 +02:00
Itxaka f3a370f37d
Change green for teal as the default base (#1321)
* Change green for teal as the default base

Signed-off-by: Itxaka <igarcia@suse.com>

* Revert auto bumped go.mod/sum

Signed-off-by: Itxaka <igarcia@suse.com>

* Rememeber that pr-docker jobs are deactivated

Signed-off-by: Itxaka <igarcia@suse.com>

* revert standard dockerfile for now

Signed-off-by: Itxaka <igarcia@suse.com>

* go.mod shenanigans

Signed-off-by: Itxaka <igarcia@suse.com>

* debuig: Add final repo to build iso for now

Signed-off-by: Itxaka <igarcia@suse.com>

* Add final repo to manifest when building local iso

So any missing packages on local build are obtained from the repo of our
flavor, instead of relyaing in the green repo

Signed-off-by: Itxaka <igarcia@suse.com>

* debug

Signed-off-by: Itxaka <igarcia@suse.com>

* bump cos & luet-mtree

Signed-off-by: Itxaka <igarcia@suse.com>

* Remove final repo on build images

We now use the manifest to add the proper repo with the proper priority

Signed-off-by: Itxaka <igarcia@suse.com>

* Fix repo url on iso build

Signed-off-by: Itxaka <igarcia@suse.com>

* Fix standard example

Signed-off-by: Itxaka <igarcia@suse.com>

* update docs

Signed-off-by: Itxaka <igarcia@suse.com>

* Bump version for tests

Signed-off-by: Itxaka <igarcia@suse.com>

* Debug

Signed-off-by: Itxaka <igarcia@suse.com>

* Fix tests to use the new --system-uri from elemental

Signed-off-by: Itxaka <igarcia@suse.com>
2022-05-19 21:56:16 +02:00
Ettore Di Giacinto 982d796be2
Use hugo from toolchain (#1331)
* Use hugo from toolchain

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* Bump bootstrap luet version

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-05-17 21:30:05 +02:00
Itxaka c981c45e3f
Tag create-repo and publish-repo repositories (#1312) 2022-05-12 09:24:45 +02:00
Ettore Di Giacinto f960a00b6e
Small docs enhancements (#1299)
* Add hugo to toolchain

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* Add makefile.docs

Allow to build docs from top level, and consume that from the pipelines

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-05-06 17:14:53 +00:00
Itxaka b108a85d6c
Fix PACKAGES selection from makefile (#1293) 2022-05-05 07:35:54 +00:00
David Cassany Viladomat c24192a76d
Use elemental's build-iso command instead of luet-makeiso (#1245)
* Use elemental's build-iso command instead of luet-makeiso
* Update workflows
* Bump elemental to latest

Signed-off-by: David Cassany <dcassany@suse.com>
2022-04-28 10:53:11 +00:00
Itxaka 9110d890b2
Use elemental to build raw images (#1261) 2022-04-28 09:51:06 +02:00
Ettore Di Giacinto 3847893e1f
Cleanups rdeps (#1249)
* Clean up deps from cOS packages

Fixes: https://github.com/rancher-sandbox/cOS-toolkit/issues/1232

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* Bump cOS (for testing)

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* Reference final repo while building to consume final images

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-04-22 16:00:03 +02:00
David Cassany Viladomat 95430e4819
Drop cos.sh script (#1168)
* Update config files to new elemental variables

* Drop cos.sh script and cos-rebrand

  This commit makes `cos-deploy` to be a wrapper of `elemental reset` and
  drops `cos.sh` and `cos-rebrand` scripts.

* OEM partition should be also mounted when booting from a squashfs recovery

* Name EFI partition as COS_GRUB as the elemental installer does

* Remove deploys from active tests, no longer supported

* Backport installer v0.30.0

  This is expected to be the last installer backport. This backport
  includes the old cos.sh but also pulls elemental and uses it in some
  `cos-*` wrappers commands.

Signed-off-by: David Cassany <dcassany@suse.com>
2022-03-14 11:10:22 +00:00
Ettore Di Giacinto a5802ae917
Don't attempt to replace recovery when running in recovery mode on squashfs (#1035)
* Do not attempt to rewrite recovery

Fixes #1034

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* tests: split deploy-images test

Otherwise, the second test will run the code inside the recovery, as the
first test replaces the recovery in the VM too.

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* ci: cleanup all images after artifact build

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* Downgrade elemental-cli fips

Seems it fails to build
Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* ci: Try to run on self-hosted

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* tests: tests-raw-disk only runs on macOS runners

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* ci: use local runners for master and release pipelines

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2022-01-05 17:14:35 +01:00
Ettore Di Giacinto 76d26faaed
ci: add cleanup images plugin (#934)
* ci: add cleanup images plugin

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* ci: update workflows

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* ci: fixup plugin installation

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* ci: cleanup cache after package is built or pushed

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>

* fixup cos-setup constraint

This breaks validation as ver-1 is lower than ver

See: https://github.com/rancher-sandbox/cOS-toolkit/pull/923

Signed-off-by: Ettore Di Giacinto <edigiacinto@suse.com>
2021-12-07 20:56:28 +01:00
David Cassany Viladomat d8d1d2b4dd
Make OEM partition label customizable at build time (#894)
* Make OEM partition label customizable at build time

This commit sets the basis to make OEM partition label customizable.
Currently it can only be customized a build time, it already was,
however the value was hardcoded in several places. Now the label
value is included in /etc/cos/config file and all other packages
read it from there at build time and install time.

In the future it should not be complex to make it configurable at
install time. For that some little extensions to the installer are
required.

Signed-off-by: David Cassany <dcassany@suse.com>

* Make PERSISTENT partition label customizable at build time

Signed-off-by: David Cassany <dcassany@suse.com>

* Make RECOVERY partition label customizable at build time

Signed-off-by: David Cassany <dcassany@suse.com>

* Make STATE partition label customizable at build time

Signed-off-by: David Cassany <dcassany@suse.com>

* Make ACTIVE partition label customizable at build time

Signed-off-by: David Cassany <dcassany@suse.com>

* Make PASSIVE partition label customizable at build time

Signed-off-by: David Cassany <dcassany@suse.com>

* Make SYSTEM partition label customizable at build time

Signed-off-by: David Cassany <dcassany@suse.com>

* Adapt arm builder script

Signed-off-by: David Cassany <dcassany@suse.com>

* Make config file optional in imaging scripts

Signed-off-by: David Cassany <dcassany@suse.com>
2021-12-01 17:06:10 +00:00