Skip to content

Commit

Permalink
generate-test-cases: drop --with-customizations option
Browse files Browse the repository at this point in the history
Generating image test case with all possible blueprint customizations is
supported only for `qcow2` image type. Generating `qcow2` images with
customizations was not a lot of fun. One had to use a special CLI option
for this case.

To streamline the generation of image test cases, drop the
`--with-customizations` option from the `generate-test-cases` script and
move the functionality to `format-request-map.json` by defining a new
`qcow2-customize` test case. This is very similar to what `*edge-rt`
test case already uses. This mean that when the test case for `qcow2`
image type is being generated, actually two test cases will be
generated. The filesystem customizations since RHEL-8.5 are handled
through distro-specific `overrides`.

Signed-off-by: Tomas Hozza <[email protected]>
  • Loading branch information
thozza committed Sep 23, 2021
1 parent 6502f52 commit 008dfcc
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 147 deletions.
12 changes: 0 additions & 12 deletions tools/test-case-generators/distro-arch-imagetype-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"fedora-iot-commit",
"openstack",
"qcow2",
"qcow2-customize",
"vhd",
"vmdk"
],
Expand All @@ -18,7 +17,6 @@
"ami",
"openstack",
"qcow2",
"qcow2-customize",
"tar",
"vhd",
"vmdk"
Expand All @@ -32,7 +30,6 @@
"ami",
"openstack",
"qcow2",
"qcow2-customize",
"rhel-edge-commit",
"tar",
"vhd",
Expand Down Expand Up @@ -60,7 +57,6 @@
"openstack",
"tar",
"qcow2",
"qcow2-customize",
"rhel-edge-commit",
"rhel-edge-container",
"vhd",
Expand Down Expand Up @@ -90,7 +86,6 @@
"openstack",
"tar",
"qcow2",
"qcow2-customize",
"edge-commit",
"edge-container",
"image_installer",
Expand All @@ -102,19 +97,16 @@
"ec2",
"openstack",
"qcow2",
"qcow2-customize",
"edge-commit",
"edge-container",
"tar"
],
"ppc64le": [
"qcow2",
"qcow2-customize",
"tar"
],
"s390x": [
"qcow2",
"qcow2-customize",
"tar"
]
},
Expand All @@ -125,7 +117,6 @@
"edge-container",
"openstack",
"qcow2",
"qcow2-customize",
"tar",
"vhd",
"vmdk"
Expand All @@ -136,17 +127,14 @@
"edge-container",
"openstack",
"qcow2",
"qcow2-customize",
"tar"
],
"ppc64le": [
"qcow2",
"qcow2-customize",
"tar"
],
"s390x": [
"qcow2",
"qcow2-customize",
"tar"
]
}
Expand Down
173 changes: 173 additions & 0 deletions tools/test-case-generators/format-request-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,179 @@
},
"overrides": {}
},
"qcow2-customize": {
"compose-request": {
"distro": "",
"arch": "",
"image-type": "qcow2",
"repositories": [],
"filename": "disk.qcow2",
"blueprint": {
"name": "qcow2-customize-boot-test",
"description": "Image for boot test",
"packages": [
{
"name": "bash",
"version": "*"
}
],
"modules": [],
"groups": [
{
"name": "core"
}
],
"customizations": {
"hostname": "my-host",
"kernel": {
"append": "debug"
},
"sshkey": [
{
"user": "user1",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61wMCjOSHwbVb4VfVyl5sn497qW4PsdQ7Ty7aD6wDNZ/QjjULkDV/yW5WjDlDQ7UqFH0Sr7vywjqDizUAqK7zM5FsUKsUXWHWwg/ehKg8j9xKcMv11AkFoUoujtfAujnKODkk58XSA9whPr7qcw3vPrmog680pnMSzf9LC7J6kXfs6lkoKfBh9VnlxusCrw2yg0qI1fHAZBLPx7mW6+me71QZsS6sVz8v8KXyrXsKTdnF50FjzHcK9HXDBtSJS5wA3fkcRYymJe0o6WMWNdgSRVpoSiWaHHmFgdMUJaYoCfhXzyl7LtNb3Q+Sveg+tJK7JaRXBLMUllOlJ6ll5Hod root@localhost"
}
],
"user": [
{
"name": "user2",
"description": "description 2",
"password": "$6$BhyxFBgrEFh0VrPJ$MllG8auiU26x2pmzL4.1maHzPHrA.4gTdCvlATFp8HJU9UPee4zCS9BVl2HOzKaUYD/zEm8r/OF05F2icWB0K/",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61wMCjOSHwbVb4VfVyl5sn497qW4PsdQ7Ty7aD6wDNZ/QjjULkDV/yW5WjDlDQ7UqFH0Sr7vywjqDizUAqK7zM5FsUKsUXWHWwg/ehKg8j9xKcMv11AkFoUoujtfAujnKODkk58XSA9whPr7qcw3vPrmog680pnMSzf9LC7J6kXfs6lkoKfBh9VnlxusCrw2yg0qI1fHAZBLPx7mW6+me71QZsS6sVz8v8KXyrXsKTdnF50FjzHcK9HXDBtSJS5wA3fkcRYymJe0o6WMWNdgSRVpoSiWaHHmFgdMUJaYoCfhXzyl7LtNb3Q+Sveg+tJK7JaRXBLMUllOlJ6ll5Hod root@localhost",
"home": "/home/home2",
"shell": "/bin/sh",
"groups": [
"group1"
],
"uid": 1020,
"gid": 1050
}
],
"group": [
{
"name": "group1",
"gid": 1030
},
{
"name": "group2",
"gid": 1050
}
],
"timezone": {
"timezone": "Europe/London",
"ntpservers": [
"time.example.com"
]
},
"locale": {
"languages": [
"el_CY.UTF-8"
],
"keyboard": "dvorak"
},
"services": {
"enabled": [
"sshd.socket"
],
"disabled": [
"bluetooth.service"
]
}
}
}
},
"overrides": {
"rhel-85": {
"blueprint": {
"name": "qcow2-customize-boot-test",
"description": "Image for boot test",
"packages": [
{
"name": "bash",
"version": "*"
}
],
"modules": [],
"groups": [
{
"name": "core"
}
],
"customizations": {
"hostname": "my-host",
"kernel": {
"append": "debug"
},
"sshkey": [
{
"user": "user1",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61wMCjOSHwbVb4VfVyl5sn497qW4PsdQ7Ty7aD6wDNZ/QjjULkDV/yW5WjDlDQ7UqFH0Sr7vywjqDizUAqK7zM5FsUKsUXWHWwg/ehKg8j9xKcMv11AkFoUoujtfAujnKODkk58XSA9whPr7qcw3vPrmog680pnMSzf9LC7J6kXfs6lkoKfBh9VnlxusCrw2yg0qI1fHAZBLPx7mW6+me71QZsS6sVz8v8KXyrXsKTdnF50FjzHcK9HXDBtSJS5wA3fkcRYymJe0o6WMWNdgSRVpoSiWaHHmFgdMUJaYoCfhXzyl7LtNb3Q+Sveg+tJK7JaRXBLMUllOlJ6ll5Hod root@localhost"
}
],
"user": [
{
"name": "user2",
"description": "description 2",
"password": "$6$BhyxFBgrEFh0VrPJ$MllG8auiU26x2pmzL4.1maHzPHrA.4gTdCvlATFp8HJU9UPee4zCS9BVl2HOzKaUYD/zEm8r/OF05F2icWB0K/",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61wMCjOSHwbVb4VfVyl5sn497qW4PsdQ7Ty7aD6wDNZ/QjjULkDV/yW5WjDlDQ7UqFH0Sr7vywjqDizUAqK7zM5FsUKsUXWHWwg/ehKg8j9xKcMv11AkFoUoujtfAujnKODkk58XSA9whPr7qcw3vPrmog680pnMSzf9LC7J6kXfs6lkoKfBh9VnlxusCrw2yg0qI1fHAZBLPx7mW6+me71QZsS6sVz8v8KXyrXsKTdnF50FjzHcK9HXDBtSJS5wA3fkcRYymJe0o6WMWNdgSRVpoSiWaHHmFgdMUJaYoCfhXzyl7LtNb3Q+Sveg+tJK7JaRXBLMUllOlJ6ll5Hod root@localhost",
"home": "/home/home2",
"shell": "/bin/sh",
"groups": [
"group1"
],
"uid": 1020,
"gid": 1050
}
],
"group": [
{
"name": "group1",
"gid": 1030
},
{
"name": "group2",
"gid": 1050
}
],
"timezone": {
"timezone": "Europe/London",
"ntpservers": [
"time.example.com"
]
},
"locale": {
"languages": [
"el_CY.UTF-8"
],
"keyboard": "dvorak"
},
"services": {
"enabled": [
"sshd.socket"
],
"disabled": [
"bluetooth.service"
]
},
"filesystem": [
{
"mountpoint": "/usr",
"minsize": 2147483648
},
{
"mountpoint": "/var",
"minsize": 1073741824
},
{
"mountpoint": "/",
"minsize": 2147483648
}
]
}
}
}
}
},
"vhd": {
"compose-request": {
"distro": "",
Expand Down
9 changes: 0 additions & 9 deletions tools/test-case-generators/generate-all-test-cases
Original file line number Diff line number Diff line change
Expand Up @@ -849,18 +849,9 @@ class BaseTestCaseMatrixGenerator(contextlib.AbstractContextManager):
for image_type in img_type_list:
log.info("Generating test case for '%s' '%s' image on '%s'", distro, image_type, arch)

# is the image with customizations?
if image_type.endswith("-customize"):
with_customizations = True
image_type = image_type.rstrip("-customize")
else:
with_customizations = False

gen_test_cases_cmd = f"cd {runner_sources_dir}; sudo tools/test-case-generators/generate-test-cases" + \
f" --distro {distro} --arch {arch} --image-types {image_type}" + \
f" --store {runner_osbuild_store_dir} --output {runner_output_dir}"
if with_customizations:
gen_test_cases_cmd += " --with-customizations"

# allow fixed number of retries if the command fails for a specific reason
for i in range(1, go_tls_timeout_retries+1):
Expand Down
Loading

0 comments on commit 008dfcc

Please sign in to comment.