Commit graph

78 commits

Author SHA1 Message Date
Yi He
85e176f438 ci: move edge test to testing-farm 2024-08-13 13:51:18 +02:00
Alexander Todorov
8d0eb8b0cb Replace 9.4 conditions with 9.5 conditions inside test scripts 2024-06-07 10:31:54 +02:00
Mario Cattamo
9164c9a8dd test: update osname for edge deployments 2024-05-14 21:12:36 +02:00
Alexander Todorov
85ce42570d Refactor how the 'trap' command is used to avoid double calls
in many files there was a secondary call to `trap` for the sole purpose
of killing jornalctl (watching worker logs) so that GitLab CI doesn't
hang.

The issue with this is that sometimes the cleared the trap which invokes
the cleanup() function without reinstating it again (not everywhere).

Instead of doing this back-and-forth just make sure we don't leave any
journalctl processes dangling in the background!

NOTES:

- for some scripts, mainly ostree- ones there was no cleanup trap
  present, but instead `trap` was configured inside the build_image() function.
  The trouble is that this function is executed multiple times and
  $WORKER_JOURNAL_PID changes value between these multiple executions.
  That's why these scripts introduce the cleanup_on_exit() function where
  we make sure to kill any possible dangling journalctl processes.
- The name `cleanup_on_exit()` is chosed because these same scripts
  often have a helper function named clean_up() which is sometimes used to remove
  virtual machines and other artifacts between calls of build_image().
2024-04-19 13:16:11 +03:00
Tom Koscielniak
b4dcfc4480 Remove libvirt workaround 2024-03-04 15:39:08 +01:00
Xiaofeng Wang
3c3445c832 test: fix fdo mac address test issue 2023-12-15 18:56:11 +01:00
Mario Cattamo
a4ebf53ad8 test: add test for fdo interface in simplified installer 2023-12-14 22:21:09 +01:00
Miguel Martín
38f9687cc1 Clean up libvirt network
Clean up libvirt network once the script has
finished successfully.
2023-12-13 10:19:47 +01:00
Miguel Martín
53955af7ca Do not run set-env-variables.sh
Do not run `set-env-variables.sh` to set ARCH and OS variables
to avoid the CI failing because of shellcheck lint problems.

Signed-off-by: Miguel Martín <mmartinv@redhat.com>
2023-12-13 10:19:47 +01:00
Miguel Martín
20c8892ec9 Do not harcode user's password hash in scripts
Generate user's password hash based on `EDGE_USER_PASSWORD`
variable instead of hardcoding it

Signed-off-by: Miguel Martín <mmartinv@redhat.com>
2023-12-13 10:19:47 +01:00
Miguel Martín
a0d357c66b Enable FIPS tests
Make it possible to test if system FIPS mode has been enabled
in the resulting images by running the scripts with a FIPS="true"
environment variable

Signed-off-by: Miguel Martín <mmartinv@redhat.com>
2023-12-13 10:19:47 +01:00
Xiaofeng Wang
7f2414caf4 test: remove fdo package workaround from PR#3690 2023-10-03 15:53:40 -07:00
Xiaofeng Wang
7259deea3a test: add workaround for bug https://issues.redhat.com/browse/RHEL-4992 2023-09-19 11:34:48 +02:00
Alexander Todorov
f2f1c8d0f0 Remove deprecated --os-type cli argument
test logs print:

[2023-08-22T10:18:14-04:00] 💿 Install image via installer(ISO) on VM
WARNING  --os-type is deprecated and does nothing. Please stop using it.
2023-09-01 13:22:30 +02:00
Xiaofeng Wang
8678125f89 test: add workaround for bug 2230537 and 2229722 2023-08-11 20:55:35 +08:00
Brian C. Lane
4c7b3dd25a test: Make log errors easier to find
We were using greenprint for failures, which makes it hard to quickly
find where the tests failed. This switches errors to use redprint, and
adds it to places that were simply using echo before doing an exit 1.
2023-08-02 14:46:35 +02:00
Xiaofeng Wang
967570a2a6 test: Add workaround for BZ#2213660 and #2225667 2023-07-26 22:23:41 +08:00
Xiaofeng Wang
2baaa20859 test: Four fixes for RHEL for Edge tests
1. Remove ansible-blocking-io.py workaround. It's not required.
2. Variable should be PROD_REPO_URL, not STAGE_REPO_URL in
ostree-raw-image.sh
3. Use --reboot in rpm-ostree install to reboot VM instead of
a reboot ansible task
4. Wait until config file serviceinfo_api_server.yml exists, to
avoid file not available to use flaky issue
2023-06-30 09:07:39 +08:00
Xiaofeng Wang
dda50003cb test: Remove ostree-rebase-bios/uefi.sh and add rebase test into
ostree-raw-image.sh and ostree-simplified-installer.sh

Don't need dedicated rebase test workflow, move rebase test into
other test script. That will save runner and reduce running time

Add BIOS rebase test in ostree-raw-image.sh
Add UEFI rebase test in ostree-simplified-installer.sh
2023-06-26 12:33:36 +02:00
Xiaofeng Wang
cf27954a0d test: Move ignition test out of simplified installer test
1. Remove ignition test from simplified installer and raw image
2. Use a new test job for ignition test
3. Add ignition test for raw image
2023-06-20 17:12:14 +08:00
Xiaofeng Wang
ae04d807a3 test: Some enhancements to make test stable
1. Checking FDO user created before running ansible playbook
2. Wait 10 seconds before and after VM rebooting to make VM stable
2023-06-15 17:09:41 +02:00
Alexander Todorov
1f28e50d21 Adjust tests for new distros
References:
- https://redhat-internal.slack.com/archives/C0235DZB0DT/p1685528139831589
- 1fbd9d975f
2023-06-15 08:54:57 +02:00
Tomáš Hozza
956e3b9b69 Test: reformat parts of ostree-simplified-installer.sh
Reformat calls of `ansible-playbook` by splitting them into multiple
lines. This makes it easier to read.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-05-22 16:30:14 +02:00
Ondřej Budai
156c411836 ostree-simplified-installer.sh: fix waiting loop for fdouser
`ssh grep fdouser /etc/passwd` returns 1 if the user doesn't exist yet.
We run this script with set -euo pipefail, which cause the script to exit
immediately. Thus, the waiting loop isn't actually waiting for anything.

By adding `|| true`, we ensure that the loop is indeed waiting for the fdouser
to be available.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-05-12 11:02:49 +02:00
Antonio Murdaca
01e7370c08 test/simplified-installer: fix yq installation on rhel8
Basically use the latest 3.2.1 version because of https://github.com/kislyuk/yq/issues/165

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2023-04-24 14:14:15 +02:00
yih
b90f51ff33 fix cs9 edge-simplified-installer test failure 2023-04-13 21:39:32 +02:00
Mario Cattamo
00de277d3a Add Butane test and Ignition logs 2023-03-24 17:07:36 +01:00
yih
4023b61e1a test fdo create user 2023-03-10 14:40:49 +01:00
yih
d7e2e5d740 add sysroot permission test 2023-03-09 18:54:06 +08:00
yih
266cfdcc44 fix ansible error on centos9 2023-03-02 16:03:11 +01:00
Xiaofeng Wang
eaee7870ba test: Add user in simplified installer blueprint
Run ansible playbook with user configured in simplified installer
blueprint
2023-02-22 12:18:12 +01:00
Antonio Murdaca
5ab00987cd test/cases: add ignition test to edge-raw-image
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
2023-02-07 13:30:22 +01:00
Achilleas Koutsou
c049499322 test: use kernel-rt-core in ostree tests for CS8 2023-01-18 11:50:35 +01:00
Antonio Murdaca
1672fb1cf6 wire ignition bp customization to simplified-installer and raw image
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
2023-01-17 14:02:02 +01:00
Antonio Murdaca
8b820abb4b adjust ignition kargs tests
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
2023-01-17 14:02:02 +01:00
Antonio Murdaca
cca0e773f6 support ignition in edge simplified-installer and raw-image
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
Signed-off-by: Irene Diez <idiez@redhat.com>
Co-authored-by: Irene Diez <idiez@redhat.com>
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
2023-01-17 14:02:02 +01:00
Jakub Rusz
fe554ad184 tests/ostree: use local install and lower memory
Download the boot.iso to the hypervisor to use local install instead of
networked which allows to use lower RAM.
2023-01-10 00:28:23 +01:00
Alexander Todorov
6d0c8ced8d Update more test conditions based on code review 2023-01-10 00:28:23 +01:00
Alexander Todorov
a8df4879ac Adjust tests for 8.8 and 9.2 2023-01-10 00:28:23 +01:00
Irene Diez
f711219f0a tests: update si tests with ignition blueprint
Signed-off-by: Irene Diez <idiez@redhat.com>
2022-12-15 11:34:17 +00:00
Antonio Murdaca
6d15dc144c distro/rhel: make edge images properly sysroot.readonly=true
Make edge raw images (both the raw image type and the same in the edge
simplified installer) mount the /sysroot as read-only.  This was already
done in Fedora 37+ (547f7a66b3).

Copied commit message from 6f89e9d499 to a
comment in all places where the accompanying "rw" kernel option is set
explaining the requirement, since the option is counter-intuitive.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
Co-Authored-By: Achilleas Koutsou <achilleas@koutsou.net>
2022-12-13 13:24:20 +01:00
Achilleas Koutsou
351576f362 test: update ostree-simplified-installer test
Uses sed to modify the grub configuration to test http boot and needs to
match the image name on the ISO.
2022-12-11 12:37:37 +00:00
Xiaofeng Wang
f732af9e8b test: Do not enable UEFI secure boot on CS9 2022-11-25 03:47:30 +01:00
Antonio Murdaca
a295ed7c90 check FDO re-encryption happens
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
2022-11-24 09:33:00 +00:00
Sarita Mahajan
dc3c0d9725 simplified-installer: do not mandate FDO section in simplified provisioning
- build simplified installer iso without mentioning FDO section.
  - change done for rhel8 and rhel9
  - add test case for this use case in test/case/ostree-simplified-installer.shovisioning
  - fixed review comments

Signed-off-by: Sarita Mahajan <sarmahaj@redhat.com>
2022-11-22 11:36:54 +01:00
Antonio Murdaca
50fb688d43 Use FDO AIO server for testing
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-10-19 12:08:34 +02:00
Achilleas Koutsou
bf83bbea38 test: move greenprint and redprint functions to shared_lib.sh
Since we're sharing functions between test scripts, move greenprint(),
the most rewritten function in the history of the project, to
shared_lib.sh and source it everywhere.
2022-09-13 16:06:19 +01:00
Achilleas Koutsou
3b14828669 test: new weldr client compatibility for test scripts
- Handle the array responses from the new weldr-client (>= 35.6).
- Move the `get_build_info` function to shared_libs.sh to source and
  reuse in multiple places.
2022-09-13 16:06:19 +01:00
Tomas Hozza
a4b0efb278 provision.sh: add none authentication method for on-premise scenario
`tools/provision.sh` is provisioning SUT always in the same way for
both, the Service scenario and the on-premise scenario. While this is
not causing any issues, it does not realistically represent how we
expect osbuild-composer and worker to be used in these scenarios.

The script currently supports the following authentication options:
- `none`
  - Intended for the on-premise scenario with Weldr API.
  - NO certificates are generated.
  - NO osbuild-composer configuration file is created.
  - NO osbuild-worker configuration file is created. This means that no
    cloud provider credentials are configured directly in the worker.
  - Only the local worker is started and used.
  - Only the Weldr API socker is started.
  - Appropriate repository definitions are copied to
    `/etc/osbuild-composer/repositories/`.
- `jwt`
  - Intended for the Service scenario with Cloud API.
  - Should be the only method supported in the Service scenario in the
    future.
  - Certificates are generated and copied to `/etc/osbuild-composer`.
  - osbuild-composer configuration file is created and configured for
    JWT authentication.
  - osbuild-worker configuration file is created, configured for JWT
    authentication and with appropriate cloud provider credentials.
  - Local worker unit is masked. Only the remote worker is used (the
    socket is started and one remote-worker instance is created).
  - Only the Cloud API socket is started (Weldr API socket is stopped).
  - NO repository definitions are copied to
    `/etc/osbuild-composer/repositories/`.
- `tls`
  - Intended for the Service scenario with Cloud API.
  - Should eventually go away.
  - Certificates are generated and copied to `/etc/osbuild-composer`.
  - osbuild-composer configuration file is created and configured for
    TLS client cert authentication.
  - osbuild-worker configuration file is created, configured for TLS
    authentication and with appropriate cloud provider credentials.
  - Services and sockets are started as they used to be originally:
    - Both local and remote worker sockets are started.
    - Both Weldr and Cloud API sockets are started.
    - Only the local worker unit will be started automatically.
  - NO repository definitions are copied to
    `/etc/osbuild-composer/repositories/`.
2022-08-04 11:55:43 +02:00
Jakub Rusz
efbd5ebd7b ci/tests: Change the way artifacts are collected
We want to be able to safely gather any artifacts without worrying about
any possible secrets leaking. Every artifacts that we want to upload
will now have to be placed in /tmp/artifacts which will then be uploaded
to S3 by the executor and link to the artifacts will be provided in the
logs. Only people with access to our AWS account can see them.
2022-07-18 11:33:57 +03:00