Commit graph

37 commits

Author SHA1 Message Date
Jakub Rusz
1af3bd6e34 tests/libvirt: disable secure boot for el-10
Related bug: CNV-41858
2024-08-12 08:39:05 +03:00
Jakub Rusz
27a8145d66 tests/libvirt: define el-10 variants 2024-08-12 08:39:05 +03:00
Tom Koscielniak
b4dcfc4480 Remove libvirt workaround 2024-03-04 15:39:08 +01:00
Xiaofeng Wang
967570a2a6 test: Add workaround for BZ#2213660 and #2225667 2023-07-26 22:23:41 +08:00
Alexander Todorov
38ed9a39be Start collecting logs from virt-install 2023-07-21 12:11:02 +02:00
Ondřej Budai
6e756eb76b tools/libvirt_test.sh: add fedora support
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-06-26 17:56:20 +02:00
Ondřej Budai
6b1f1848e4 tools/libvirt_test.sh: remove hardcoded os-variant
Using rhel8-unknown for all distros was really weird, let's use the proper
variants.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-06-26 17:56:20 +02:00
Ondřej Budai
2c4215a2d0 tools/libvirt_test.sh: fix weird indentation
There were 5 spaces instead of 4.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-06-26 17:56:20 +02:00
Ondřej Budai
89b71d339e tools/libvirt_test.sh: merge two similar switch statements
No need for more switching than just one.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-06-26 17:56:20 +02:00
Alexander Todorov
83cec26a5a Remove cloud-init/network-config file from tests
- not used in oscap.sh test at all
- causes VM in libvirt.sh test to acquire a different IP address instead
  of the hard-coded one inside the test, which causes SSH to fail

- not used anywhere else
2023-06-15 08:54:57 +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
Ondřej Budai
25161a8316 libvirt_test: stop setting nvram in virt-install on RHEL 9
We use CDN repositories when running tests on GA RHEL. Thus, our RHEL 9.1
machines are actually pulling packages from RHEL 9.2. Therefore, we are
now getting virt-install >= 4. This version brings firmware auto-detection
and doesn't support nvram_template anymore. Let's remove it then.

See 966049ec3c

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-05-12 11:02:49 +02:00
Alexander Todorov
e064c12449 Update test suite after rebase to weldr-client-35.9
in order to avoid failures in nightly pipelines b/c JSON format has
changed
2023-02-28 11:15:49 +01:00
Alexander Todorov
00dd497173 libvirt.sh: Adjust virt-install parameters for 9.2 2023-01-10 00:28:23 +01:00
Xiaofeng Wang
920431a679 test: Disable secure boot for CS9 on libvirt_test.sh 2022-11-25 03:47:30 +01:00
Alexander Todorov
3d6256a89d Specify additional package in blueprint for tests
Related RHBZ#2065734
2022-09-13 18:56:00 +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
Ygal Blum
8407c97d96 Upload to HTTPS S3 - Support self signed certificate
API
---
Allow the user to pass the CA public certification or skip the verification

AWSCloud
--------
Restore the old version of newAwsFromCreds for access to AWS
Create a new method newAwsFromCredsWithEndpoint for Generic S3 which sets the endpoint and optionally overrides the CA Bundle or skips the SSL certificate verification

jobimpl-osbuild
---------------
Update with the new parameters

osbuild-upload-generic-s3
-------------------------
Add ca-bunlde and skip-ssl-verification flags

tests
-----
Split the tests into http, https with certificate and https skip certificate check
Create a new base test for S3 over HTTPS for secure and insecure
Move the generic S3 test to tools to reuse for secure and insecure connections
All S3 tests now use the aws cli tool
Update the libvirt test to be able to download over HTTPS
Update the RPM spec

Kill container with sudo
2022-05-26 13:46:00 +03:00
Ygal Blum
bee14bf392 OSBuild - add support for generic S3 services
jobimpl-osbuild
---------------
Add GenericS3Creds to struct
Add method to create AWS with Endpoint for Generic S3 (with its own credentials file)
Move uploading to S3 and result handling to a separate method (along with the special VMDK handling)
adjust the AWS S3 case to the new method
Implement a new case for uploading to a generic S3 service

awscloud
--------
Add wrapper methods for endpoint support
Set the endpoint to the AWS session
Set s3ForcePathStyle to true if endpoint was set

Target
------
Define a new target type for the GenericS3Target and Options
Handle unmarshaling of the target options and result for the Generic S3

Weldr
-----
Add support for only uploading to AWS S3
Define new structures for AWS S3 and Generic S3 (based on AWS S3)
Handle unmarshaling of the providers settings' upload settings

main
----
Add a section in the main config for the Generic S3 service for credentials
If provided pass the credentials file name to the osbuild job implementation

Upload Utility
--------------
Add upload-generic-s3 utility

Makefile
------
Do not fail if the bin directory already exists

Tests
-----
Add test cases for both AWS and a generic S3 server
Add a generic s3_test.sh file for both test cases and add it to the tests RPM spec
Adjust the libvirt test case script to support already created images
GitLabCI - Extend the libvirt test case to include the two new tests
2022-04-07 15:01:01 +02:00
Juan Abia
4c5de045ff test: add test purpose
Most test scripts don't have any documentation regarding it's purpose,
although it can be guessed by the code. There's value in adding this
small comment.

[skip-ci]
2022-03-09 22:46:25 +01:00
Jakub Rusz
3fb80d199d tests/libvirt: add some regression checks
This is just a simple check to verify rhbz#2004401 and
rhbz#2003038
2022-02-25 13:25:06 +02:00
Jakub Rusz
6e5642c2d2 tests: add sudo to get_metadata function
With new weldr-client package the metadata tar archive created has
permissions set to 600 instead of 644 which causes permission failures
when interacting with it. Adding sudo to resolve that.
2021-12-08 12:12:53 +01:00
Achilleas Koutsou
aea77ed3de test: timestamp messages in test scripts
The commonly used 'greenprint' function now adds a date + timestamp to
each message for debugging and tracking the duration of segments of each
scripts.
2021-10-24 16:13:53 +01:00
Ondřej Budai
4c5d1ae45a test: move env variables into set-env-variables helper
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-24 17:03:53 +02:00
Diaa Sami
4389c8e381 Undo changes added by mistake 2021-09-10 15:17:54 +02:00
Diaa Sami
f87d8325d9 Allow running script locally without schutzbot 2021-09-10 15:17:54 +02:00
Diaa Sami
66a6e4de8c rhel90: fix libvirt_test
Test was adapted to both weldr-client and composer-cli
2021-09-03 11:15:32 +02:00
Juan Abia
c4fa4e4bb7 test: Replace hard coded ssh keys on some test
Generate a new ssh key each time. Only implemented on bash test scripts,
go tests pending.
2021-07-29 09:38:03 +03:00
Ondřej Budai
bc1a7dc30c tests: fix journalctl killing once again
3a8c6c8a introduced a new logic for killing journalctl. Unfortunately, it
doesn't work properly. In ostree tests, multiple journalctls are spawned
but there can be only one trap active at a time. This caused all but the last
journalctls to hang indefinitely. Unfortunately, hanging background processes
is something that causes the GitLab CI to hang indefinitely as well.

This commit modifies the logic a bit: The trap is still set. However, there's
also an explicit kill of journalctl after the compose is finished. After the
process is successfully killed, the trap is removed.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-10 07:40:36 +02:00
Jakub Rusz
3a8c6c8ab8 tests: kill journalctl even if compose fails
This prevents Gitlab CI from getting stuck if something
goes wrong with the compose.
2021-06-04 14:18:11 +03:00
Ondřej Budai
bb60905309 test/libvirt: remove dead code
We don't test vmdk images in libvirt.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-05-17 14:55:50 +02:00
Ondřej Budai
3bf04d12f8 test/libvirt: use a minimal blueprint
All our images now support and have enabled cloud-init, there's no need
to explicitly enable it and install it in a kickstart.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-05-17 14:55:50 +02:00
Jakub Rusz
8dcf859473 tests: move some integration tests to gitlab CI
This also includes several modifications to tests scripts to
enable them running in gitlab CI.
2021-05-12 15:38:30 +03:00
Alexander Todorov
ef0105945a tests: Revert a lorax patch
BZ 1843704 has been fixed and shipped in 8.3. We shouldn't need this
patch anymore!
2021-04-22 15:03:42 +03:00
Ondřej Budai
e7b3063f7e test: properly kill journalctl
sudo journalctl -af -n 1 -u "${WORKER_UNIT}" &
WORKER_JOURNAL_PID=$!

In this snippet, WORKER_JOURNAL_PID is set to the PID of the sudo process.
Sudo doesn't propagate any signals - therefore the child process of sudo
(journalctl in this case) isn't killed when a signal is sent to the parent.

Use pkill -P instead which kills all processes where sudo is the parent.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-04-14 09:18:06 +02:00
Ondřej Budai
54a458af5c test: replace genisoimage with mkisofs
genisoimage might be removed from RHEL 9. The users are advised to switch
to mkisofs tools from the xorriso package. It should be a drop-in replacement.

The same change was recently done by libguestfs:

efb8a766ca
2216ab2e32

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-04-02 14:21:29 +02:00
Ondřej Budai
cbc9082fac tests: move the libvirt test logic out of Jenkinsfile
All tests in /usr/libexec/tests/osbuild-composer should be able to run without
any arguments. This was not a case of libvirt.sh - it required two arguments
set by some Jenkinsfile logic.

This commit moves test/cases/libvirt.sh to tools/libvirt_test.sh and extracts
the logic controlling the test case from Jenkinsfile to test/cases/libvirt.sh.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-02 08:44:33 +01:00