Commit graph

640 commits

Author SHA1 Message Date
Sanne Raymaekers
b05723a37e templates/composer: Verify against mass sso and rh sso 2022-02-24 09:48:12 +01:00
Achilleas Koutsou
91d9417f5a distro/rhel90: use new unified grub2 stage options
With the new grub2 stage options we have the following changes to the
grub2 stage:
- Set the WriteCmdLine flag to false to not write kernel command line
  options to grubenv.
- Don't set the kernel command line options in the stage options.

The kernel command line options are now only specified in the Kernel
command line stage (org.osbuild.kernel-cmdline) so we add all options
there:
- Image type options
- Blueprint options
- Partition-table-specific options

Updated manifests and image info.

Co-Authored-By: Christian Kellner <christian@kellner.me>
2022-02-23 22:42:59 +01:00
Xiaofeng Wang
05cbbf0cc5 test: Skip rollback test only on UEFI VM of ostree-rebase.sh 2022-02-23 11:08:24 +01:00
Xiaofeng Wang
45ee6c297f test: Remove ANSIBLE_STDOUT_CALLBACK=yaml in ostree-rebase.sh 2022-02-23 11:08:24 +01:00
Xiaofeng Wang
bc9d1431bc test: Add OSTree rebase test for OSTree parent ref support
To run ostree-rebase.sh, like RHEL 8.6 and RHEL 9, the CS8 VM
needs "large" flavor for more CPU and memory resource.
2022-02-23 11:08:24 +01:00
Achilleas Koutsou
be382ecef8 test/ostree: update ostree compose request to match new requirements
Specifying a parent commit ID without a URL isn't allowed now.  The
upgrade commit is built without a parent.  The OS upgrade should still
work without it.
Getting the ID of the first commit is not necessary now.
2022-02-23 11:08:24 +01:00
Alexander Todorov
646fbe93c7 Revert "tests: Conditionally enable osbuild-dnf-json-tests"
Current version is 45.

This reverts commit 966692be11.
2022-02-22 21:57:30 +01:00
Achilleas Koutsou
602111dedd osbuild2: generalise copy stage option generation
Use entity based method `ForEachMountable` and `getDevices` to generate
all mounts and devices in a generic way, which then allows for mounts on
arbitrarily nested devices.

Update manifests and image info:
- New device names generated by `pathdot()` to avoid basename
  collisions.
- Some partitions are generated in a different order now which changes
  the order they appear in the manifest and their UUIDs.

Co-Authored-By: Christian Kellner <christian@kellner.me>
2022-02-22 19:23:41 +00:00
Christian Kellner
b7abef54e8 disk: calculate padding for secondary GPT header
Instead of hard coding a padding of 100 sectors for all layouts, i.e.
MBR and GTP, adjust the needed space depending on the layout: for MBR 
we don't need to reserve any space at all since it does not have a 
secondary header. For GTP we reserve 33 sectors, as indicated in the
UEFI specific, which allows for the header itself and up to 128 entries.
To not modify the layout of already released distributions, like RHEL
8.4 and 8.5, a new member called `ExtraPadding` is added to `Partition
Table` and then used in the corresponding layouts to preserve the
existing padding of 100.
2022-02-22 19:23:41 +00:00
Christian Kellner
d9ef268809 disk: use GenerateUUIDs in CreatePartitionTable
Instead of generating the UUIDs directly when new partitions are
created and separately for the boot and root partition, use the
new `PartitionTable.GenerateUUIDs` method to generate all UUIDs
that are missing in one go. Since this changes the order in
which the uuids are generated the test manifests UUIDs changed
and needed to be updated:
I used to following patch to get the updated manifests:

--- a/internal/distro/distro_test_common/distro_test_common.go
+++ b/internal/distro/distro_test_common/distro_test_common.go
@@ -105,6 +105,12 @@ func TestDistro_Manifest(t *testing.T, pipelinePath string, prefix string, regis
                                require.NoError(t, err)

                                diff := cmp.Diff(expected, actual)
+                               if diff != "" {
+                                       tt.Manifest = got
+                                       data, _ := json.MarshalIndent(tt, "", "  ")
+                                       path := filepath.Join("/tmp", filepath.Base(fileName))
+                                       _ = ioutil.WriteFile(path, data, 0644)
+                               }
                                require.Emptyf(t, diff, "Distro: %s\nArch: %s\nImage type: %s\nTest case file: %s\n", d.Name(), arch.Name(), imageType.Name(), fileName)
                        }
                })

And the following fish snippet to update the existing ones, using the
jq and sponge utilities:

for file in /tmp/rhel_85-*.json
  set filename (basename $file)
  jq -s '.[0].manifest = .[1].manifest | .[0]' test/data/manifests/$filename /tmp/$filename | sponge test/data/manifests/$filename
end
2022-02-22 19:23:41 +00:00
Tom Gundersen
351d06aecf tests/cases/api.sh: make /var at least 256MB
We (mistakenly) don't enforce a minimum size for /var,
so setting it to 1024 (1kB) causes the image build to fail.

CI does not expose this in a helpful way at the moment,
so this is a bit tricky to debug.

Also skip customizations for the AWS.S3 upload type. Not all the
image types with this upload type support filesystem customizations
and that's as expected. We could make a more fine-grained test in
the future, but testing with a coulpe of targets should be
sufficient.
2022-02-19 11:13:55 +00:00
Chloe Kaubisch
0619ffa588 cloudapi: expose filesystem customizations 2022-02-19 11:13:55 +00:00
Achilleas Koutsou
2a504db9ed test: drop ANSIBLE_STDOUT_CALLBACK
Leftover from 1a6f6fdc4b
2022-02-18 10:39:08 +00:00
Achilleas Koutsou
12cbae3891 test: wait longer for reboot during ostree rollback test
Co-Authored-By: Xiaofeng Wang <henrywangxf@me.com>
2022-02-18 10:39:08 +00:00
Achilleas Koutsou
22f23ec38e test: update manifests and image info 2022-02-18 10:39:08 +00:00
Achilleas Koutsou
96e09e0322 Update cs9 test repos to latest snapshot 2022-02-18 10:39:08 +00:00
Achilleas Koutsou
85383ca950 test/cases: add centos OS_VARIANTS to installers test
Set conditional OS_VARIANT, copied from ostree-ng.sh.
Add CentOS Stream 9 variant.
2022-02-18 10:39:08 +00:00
Achilleas Koutsou
d271de346f test/ostree: use production compose for virt boot location 2022-02-18 10:39:08 +00:00
Achilleas Koutsou
a087fc5c86 test/cases: use correct OS_VARIANT for CentOS Stream 9
Correct name is 'centos-stream9'
See 'osinfo-query os'
2022-02-18 10:39:08 +00:00
Achilleas Koutsou
ff992e00f2 tests/libvirt: test uefi on cs9 2022-02-18 10:39:08 +00:00
Achilleas Koutsou
6bc4afbcbd test,repositories: add cs9 repositories
Add rpmrepo repositories for testing.
Symlink centos-9 to centos-stream-9.
Add rpmrepo snapshot repositories to test and
test-case-generator repos.
Remove unused repositories from cs9 test repositories.
2022-02-18 10:39:08 +00:00
Alexander Todorov
c877f14379 tests: Use human readable size for mountpoint
Follow up to
https://github.com/osbuild/osbuild-composer/pull/1921 and
https://bugzilla.redhat.com/show_bug.cgi?id=2023635
2022-02-18 09:28:01 +01:00
Jakub Rusz
43bfcc5389 tests/upgrade: gather more logs
Also disable firwalld AllowZoneDrifting because it's not supported in
RHEL-9.
2022-02-18 09:25:01 +01:00
Xiaofeng Wang
b378fee2e5 test: conditional greenboot package checks in ansible playbooks
Co-Authored-By: Achilleas Koutsou <achilleas@koutsou.net>
2022-02-16 10:49:55 +01:00
Achilleas Koutsou
1b0b54f853 test: regenerate RHEL 8.6 and 9.0 manifests
Repositories were update for the two distros so we've regenerated all
the manifests.
2022-02-16 10:49:55 +01:00
Achilleas Koutsou
e0822bff44 repos: update repos for test case generators
test/data/repositories:
    new snapshots for RHEL 8.6 (20220201) and 9.0 (20220208)

Switching RHEL 8.6 and RHEL 9.0 to the latest rpmrepo snapshots:
    We need updated packages for greenboot, used by edge image types, so
    we technically only need to change the architectures that are
    supported by edge, but let's update all of them for consistency.

test/data/repositories:
    Remove rhel-90 symlink to beta

Keep the rhel-90-beta.json repository definitions, but make rhel-90.json
a file that contains the previously named rhel-90-ga.json definitions.
2022-02-16 10:49:55 +01:00
Tomas Hozza
1273ef7b35 Regenerate all image test cases with the enhanced image-info
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-15 15:56:56 +01:00
Tomas Hozza
ece6452e2a Use the latest RPMRepo snapshot for RHEL-9.0 image tests
This is needed to satisfy RPM dependencies of GCP guest tools, which
will be installed on the `gce` image type.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-14 12:39:12 +01:00
Christian Kellner
b18b4e80a0 distro/{rhel86,rhel90}: specify a remote for deployments
When deploying an ostree commit, specify a remote, currently hard-
coded to `rhel-edge`, so that updates work automatically, if they
are served from the same location as the initial commit is pulled
from.

NB: now that the remote is specified in the raw image, remove the
corresponding bits form the tests.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-02-11 12:30:44 +01:00
Juan Abia
3699c52b59 test: update govc env variables documentation
govc cli no longer uses GOVMOMI_* enviroment variables. As the govc
documentation indicates, this variables should be GOVC_*.

https://github.com/vmware/govmomi/blob/master/govc/README.md#usage

[skip-ci]
2022-02-09 16:00:37 +01:00
Tomas Hozza
f43d9f4744 Add missing F34 and F35 image test cases
Add F34 and F35 image test cases for all remaining image types, which
were previously not tested. With this PR, image test cases are now
generated for all image types on all architectures as supported by the
Fedora distro definition.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-09 15:29:33 +01:00
Tomas Hozza
1401a7a659 test: add image test cases for Fedora 34 and 35
Delete Fedora 33 image test cases.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-08 10:19:52 +01:00
Tomas Hozza
617572ad6c test/api.sh: remove parts related to Fedora 33
We no longer test Cloud API on Fedora and Fedora 33 is EOL anyway.
Remove all Fedora 33 related lines from the test case.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-08 10:19:52 +01:00
Tomas Hozza
91097fa007 test: regenerate RHEL 8.5 and 8.6 EC2 image test cases
Fix missing missing `image-info` report updates after PR#2235.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-07 20:33:54 +01:00
Juan Abia
cf72a8963e test: update README with cloud cleaner info
update testing documentation with the purpose of 'cloud cleaner' and
'scheduled cloud cleaner'
2022-02-07 10:51:47 +01:00
Jakub Rusz
409eb3f33b tests/cross-distro: filter out beta and stream repos
Currently these repositories are not recognized by composer which is a
bug described in issue #2257. This commit will be reverted when related
issue is fixed.
2022-02-07 11:37:13 +02:00
Jakub Rusz
17f84ad6cc tests: expand cross-distro tests
This test now checks if all the installed repositories are recognized,
there are no extra or missing and that blueprint push with unsupported
distro fails gracefuly.
2022-02-07 11:37:13 +02:00
Tomas Hozza
eb36b86161 RHEL-90: Remove deprecated crashkernel=auto option
Setting of the `crashkernel` option to the appropriate value is now done
by the `kexec-tools` package when installed and when any new kernel is
installed.

Regenerate relevant image test cases.

Fix #1819
Fix rhbz#2006692

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-07 09:29:07 +01:00
Alexander Todorov
966692be11 tests: Conditionally enable osbuild-dnf-json-tests
based on package version
2022-02-04 23:43:43 +01:00
Alexander Todorov
8b3a1367be tests: Add nvr checking into a shared library
can be used for conditionally enabling parts of the test scripts:

source /usr/libexec/tests/osbuild-composer/shared_lib.sh

if nvrGreaterOrEqual "osbuild-composer" "41"; then
    .... do some more testing ...
fi
2022-02-04 23:43:43 +01:00
Alexander Todorov
43738d6caa tests: Fix for unbound variable 2022-02-04 23:43:43 +01:00
Christian Kellner
9302befa67 distro/rhel90: disable pw auth for EC2 images
Disable loging in via password authentication since this is an
official Amazon marketplace requirement

  Linux-based AMIs must not allow SSH password authentication.
  Disable password authentication via your sshd_config file by
  setting PasswordAuthentication to NO.

  Section "Security policies" from
  https://docs.aws.amazon.com/marketplace/latest/userguide/product-and-ami-policies.html
2022-02-03 14:57:16 +01:00
Christian Kellner
90cebf0337 distro/rhel86: disable pw auth for EC2 images
Disable loging in via password authentication since this is an
official Amazon marketplace requirement

  Linux-based AMIs must not allow SSH password authentication.
  Disable password authentication via your sshd_config file by
  setting PasswordAuthentication to NO.

  Section "Security policies" from
  https://docs.aws.amazon.com/marketplace/latest/userguide/product-and-ami-policies.html
2022-02-03 14:57:16 +01:00
Christian Kellner
8aede24057 distro/rhel85: disable pw auth for EC2 images
Disable loging in via password authentication since this is an
official Amazon marketplace requirement

  Linux-based AMIs must not allow SSH password authentication.
  Disable password authentication via your sshd_config file by
  setting PasswordAuthentication to NO.

  Section "Security policies" from
  https://docs.aws.amazon.com/marketplace/latest/userguide/product-and-ami-policies.html
2022-02-03 14:57:16 +01:00
Tomas Hozza
8b8c7bbbbe Fix FS label of the ESP in Fedora distro definition
The QEMU assembler in Fedora distro definition for UEFI systems used
longer than allowed label for the VFAT filesystem of the EFI System
Partition. The maximum allowed label length is 11 characters.

This worked before with dosfstools, but in 2018, they added a label
validation [1]. This change got into the v4.2 release of dosfstools,
released in Jan 2021. And subsequently since F34, this new version of
dosfstools is present in Fedora repositories.

[1] ca54953476

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-03 14:51:07 +01:00
sanne
08f668200a .gitlabci.yml: Add fedora-35 testing
Enable F34 testing on AWS as there is nothing blocking it. F34 is not
yet supported on `rhos-01` as there is no runner definition.

Remove F33 repositories for testing and add repo definitions for F34 and
F35.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-03 14:51:07 +01:00
Sanne Raymaekers
1a6f6fdc4b test: Drop ANSIBLE_STDOUT_CALLBACK
There's conflicting ansible versions in the 86 nightlies and epel. There
should be a correct combination of plugins which fixes the callback on
86. But let's drop it to unblock for now.
2022-02-03 00:24:59 +01:00
Achilleas Koutsou
93c0485531 tools/provision: remove json_query usage from ansible playbooks
`json_query` requires python3-jmespath which, while available in the
repos, it can sometimes cause issues when the ansible interpreter is
different from the system interpreter.
The `json_query` is only used in a handful of locations that can easily
be served by `jq`, which we use in other places already.
2022-02-03 00:24:59 +01:00
sanne
fe00e1efd3 containers/osbuild-composer: Allow dnf-json to accept http connections
Revert 83e16afda4: With dnf-json running
in a container it's easy to run it standalone.
2022-02-02 11:15:46 +01:00
Tom Gundersen
11e2ae4528 cloudapi/v2: add koji-specific tests
These are based on the existing tests for the koji API, making sure the coverage is the same.
2022-02-01 20:28:40 +00:00