Commit graph

1360 commits

Author SHA1 Message Date
Tomáš Hozza
218a784778 Test/base_tests.sh: workaround missing osbuild-depsolve-dnf in nightly
The RHEL nightly composes still contain old osbuild-composer version,
which does not have an explicit dependency on osbuild-depsolve-dnf
package.

As a result, running the latest upstream base_tests.sh on RHEL nightly
composes fails due to osbuild-depsolve-dnf not being installed.

Workaround this in the test case by explicitly installing the
osbuild-depsolve-dnf package in case the osbuild-composer version is
lower than the one which has an explicit dependency on
osbuild-depsolve-dnf.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-02-20 15:55:47 +01:00
Diaa Sami
82add84c31 Test/old-worker-new-composer: use latest composer for verification
To avoid incompatibility between older image-info and latest osbuild
2024-02-20 15:55:47 +01:00
Achilleas Koutsou
bbbb3278f8 test: update fedora-39 test repositories
Required for bootc for iot-bootable-container.
2024-02-02 10:34:41 +01:00
Achilleas Koutsou
76a699653a test: add iot-bootable-container to api tests
The image type supports uploading to both s3 and container registries.
Right now we only care about getting it in Koji, so let's just add it to
the s3 upload section.

The container registry test also embeds containers in the image, which
the iot-bootable-container doesn't support (yet).
2024-02-02 10:34:41 +01:00
Tom Koscielniak
d97f54cc5c Add RHEL 9.3 and 8.9 GA to pipeline 2024-02-01 16:07:27 +01:00
Tomáš Hozza
1fa72f262e test/api.sh/vsphere: specify the resource pool for image import
Specify the resource pool when importing the VMDK to the VCenter.
This should prevent the following error:

govc: default resource pool resolves to multiple instances, please specify

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Tomáš Hozza
e664d49541 Test/old-worker-new-composer: don't wait for composer indefinitely
The test would loop for the job timeout limit waiting for composer
container, in case the composer API does not come up for whatever
reason. Modify the test case to wait only for 12x 10s before failing.
In case the composer API does not come up, print the logs from the
composer container and exit with non-zero code.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Tomáš Hozza
a33da152da Test/weldr: add test for dot-notation and distro aliases
Add test case for verifying that distros and repo configurations work
with and without the dot-notation in the on-prem scenario. Run the test
case on the latest RHEL 8 and 9 versions in development and verify the
default distro aliases behavior on them.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Tomáš Hozza
2fe5e01d4d Test/api.sh: test distro aliases and names without dot-notation
Extend the `api.sh` to allow testing compose requests with distro name
which does not use dot-notation (specifically when the dot is removed
from the distro name as it used to be in the past). In addition to that,
allow also testing the distro alias using distro name without the minor
version in compose requests.

Enable these two new test variants in the CI.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Tomáš Hozza
fb6acbbe83 test/data/repositories: update GA releases and add SAP repos
Update RHEL 8.9 and 9.3 repo definitions to use the CDN repos, since
these are already GA.

Add SAP repositories to all RHEL repo configs, to be able to build the
SAP image for testing purposes.

Fix minor issues found in repos (e.g. 8.8 RT repo pointing to 8.7,
etc.).

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Tomáš Hozza
9252e2525c Test/azure.sh: don't use dot-notation for image name
Using the DISTRO_CODE with dot to separate major and minor version is
breaking cloud-image-val testing. Specifically, the tool is using
regular expression to search for an uploaded image, but the expression
is not expecting any dot in the version.

This will be fixed in [1], but merging it will take some time due to CIV
CI being currently broken. Due to this, workaround the problem for now
by making sure that the TEST_ID, which is used to construct the
IMAGE_NAME, does not contain any dot in the DISTRO_CODE.

[1] https://github.com/osbuild/cloud-image-val/pull/290

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Tomáš Hozza
499cda4a57 Test/manifests: rename files to use dot-notation
Otherwise, the image tests will fail on globing for testing manifests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Tomáš Hozza
66571784d1 Use dot-notation for repo configs and in test cases.
Where applicable, modify all repo config filenames to use a dot
to separate the release major and minor version. Modify test cases
to not remove dot from the distro version any more.

Existing tests will be extended (or new tests added) to explicitly test
backward compatibility and ensure that using old distro names without a
dot still works.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Tomáš Hozza
c82c0ae6b5 Test/api.sh: pass TEST_MODULE_HOTFIXES as an env variable
While I was the one to push for TEST_MODULE_HOTFIXES to be passed as an
argument to `api.sh`, when it was implemented, this is turning our to be
impractical. I would like to extend `api.sh` to test distro names with
and without the dot to separate major and minor version and also to test
the ability to specify distro name explicitly (e.g. a distro alias).
Passing all of these new options and their combinations would make the
CLI go wild.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Tomáš Hozza
625b1578fa Port osbuild/images v0.33.0 with dot-notation to composer
Update the osbuild/images to the version which introduces "dot notation"
for distro release versions.

 - Replace all uses of distroregistry by distrofactory.
 - Delete local version of reporegistry and use the one from the
   osbuild/images.
 - Weldr: unify `createWeldrAPI()` and `createWeldrAPI2()` into a single
   `createTestWeldrAPI()` function`.
 - store/fixture: rework fixtures to allow overriding the host distro
   name and host architecture name. A cleanup function to restore the
   host distro and arch names is always part of the fixture struct.
 - Delete `distro_mock` package, since it is no longer used.
 - Bump the required version of osbuild to 98, because the OSCAP
   customization is using the 'compress_results' stage option, which is
   not available in older versions of osbuild.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-01-26 11:32:34 +01:00
Alexander Todorov
35c4d3efba Revert "test/cases: Add workaround for oscap firewalld rules"
b/c https://github.com/ComplianceAsCode/content/issues/11275 has been
fixed. This reverts commit c77b73a888.
2024-01-22 15:22:34 +04:00
Alexander Todorov
6735e74897 Invert wrong boolean condition in filesystem test
the conditionals have been introduced in
8960a51d2f
which states (emphasys mine):

> The new partition rules are **in** osbuild-composer v94 and higher.

but the condition was "not v94 or higher" and as a result it fails on
8.10 nightly with osbuild-composer v92 with:

failed to initialize osbuild manifest: The following custom mountpoints are not supported [\"/boot/firmware\" \"/foobar\"]

see https://gitlab.com/redhat/services/products/image-builder/ci/osbuild-composer/-/jobs/5905865402
2024-01-11 20:57:46 +04:00
Michael Vogt
5f678b1d7b test: add debug output to filesystem.sh if mounting fails 2024-01-10 15:47:42 +01:00
Alexander Todorov
ba2f5a7ecb Fix a boolean condition in filesystem.sh 2024-01-10 15:47:42 +01:00
schutzbot
f25bbda32d schutzfile: Update snapshots to 20240101 2024-01-04 11:29:43 +01:00
Tomáš Hozza
cfc63297eb Test: delete "diff manifests" test case
This is not adding any value any more, since all image definitions are
defined in the osbuild/images repository and just vendored in this one.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-12-22 12:21:59 +01:00
Alexander Todorov
42a90914ab Surround composer-cli call with set +e/set -e as a workaround
because apparently calling nvrGreaterOrEqual inside a for loop doesn't
behave as expected and this fails on the second iteration.
2023-12-22 11:07:52 +01:00
Alexander Todorov
b47e741895 Add even more debug output
loop iterates overt centos-8 and then goes onto centos-9 and everything
fails silently
2023-12-22 11:07:52 +01:00
Alexander Todorov
8b91cf6060 Add debugging information for cross-distro.sh 2023-12-22 11:07:52 +01:00
Alexander Todorov
d6aff2f103 Adjust expected response based on osbuild-composer version 2023-12-22 11:07:52 +01:00
Ondrej Ezr
d5483ccfb0 test: Add nginx to the image request 2023-12-20 09:02:06 +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
Sanne Raymaekers
c6aa7d88d2 internal/weldr: specify architecture of compose
This is useful in environments with multi-arch remote workers.
Defaults to the host architecture.
2023-12-14 21:25:32 +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
Miguel Martín
10ccb3b385 feature: check FIPS mode within the ostree images
Check if the os has the system FIPS mode enabled
when `fips="true"` is passed as an ansible variable.

Signed-off-by: Miguel Martín <mmartinv@redhat.com>
2023-12-13 10:19:47 +01:00
Xiaofeng Wang
0e08ecf079 test: fix ansible playbook conditional statements error 2023-12-12 15:25:29 +01:00
Xiaofeng Wang
15a94899a8 test: remove persistent log checking on minimal raw test
Persistent log is not related with minimal raw image itself and
it is not stable. After discuss with team, remove this test
2023-12-11 15:12:04 +01:00
Jakub Rusz
4050aa92fe test/cases: Additional migration updates
Mostly addressing comments from review.
2023-11-27 10:04:47 +01:00
Jakub Rusz
5cbc87eade test/cases: clean up older distros in ostree.sh 2023-11-27 10:04:47 +01:00
Jakub Rusz
0bdc94ea94 test/cases: run upgrade test using new nightlies 2023-11-27 10:04:47 +01:00
Xiaofeng Wang
1cbcba92e1 test: fix repo file for 9.4 and 8.10 and fix check-minimal 2023-11-27 10:04:47 +01:00
Jakub Rusz
8960a51d2f Fix filesystems test
The new partition rules are in osbuild-composer v94 and higher.
2023-11-27 10:04:47 +01:00
Jakub Rusz
04ba4b81d8 Switch testing to 8.10 and 9.4 nightly 2023-11-27 10:04:47 +01:00
Jakub Rusz
c77b73a888 test/cases: Add workaround for oscap firewalld rules
The oscap remediation is failing due to an issue with remediating the
firewall loopback traffic. The remediation fails and bails out early
resulting in a lower score and causing a regression in the test. This
will need to be fixed on the OpenSCAP side, so as a workaround, we can
remove this rule from the remediation.
2023-11-24 16:29:32 +01:00
Jakub Rusz
bb76ddb2b1 tests/repositories: Update snapshtos for 9.4 and 8.10
We need this to udpate CIV testing.
2023-11-21 13:43:16 +01:00
Achilleas Koutsou
901393d791 test/api: add some greenprints 2023-11-17 16:48:16 +01:00
Achilleas Koutsou
894c7046d9 test: compare upload_statuses[0] with upload_status
Check that the first element of the upload_statuses array matches the
top-level upload_status.
We only test one upload target for now.
2023-11-17 16:48:16 +01:00
Achilleas Koutsou
d3921dcc31 test: use upload_targets for edge in api s3.sh
When making the upload request for edge commit image types, use the new
upload_targets array to define the aws.s3 upload options.
Leave other upload target definitions as is for now to test the old
options.
2023-11-17 16:48:16 +01:00
Tomáš Hozza
6649e7b36e Test/filesystem.sh: update the test case to the new policy
The mountpoint policy changed as a result of COMPOSER-2030 [1]. Modify
the test case accordingly, to comprehensively test the updated
mountpoint policy.

[1] https://issues.redhat.com/browse/COMPOSER-2030

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-11-15 15:51:14 +01:00
Tomáš Hozza
5f04544af7 Test/filesystem.sh: remove mentions of RHEL-8.5
There is really nothing specific to RHEL-8.5 in the test case.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-11-15 15:51:14 +01:00
Sanne Raymaekers
7d339b2989 test/cases/ubi-wsl: query Windows VM ip address via vm show
`vm list-ip-addresses` has proven to be quite unreliable.
2023-11-15 15:12:08 +01:00