From 4c5de045ffdcd504ac1b703821b42d15c1ee2506 Mon Sep 17 00:00:00 2001 From: Juan Abia Date: Wed, 23 Feb 2022 10:52:38 +0100 Subject: [PATCH] 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] --- test/cases/aws.sh | 8 ++++++++ test/cases/azure.sh | 8 ++++++++ test/cases/base_tests.sh | 4 ++++ test/cases/generation.sh | 7 +++++++ test/cases/installers.sh | 7 +++++++ test/cases/libvirt.sh | 4 ++++ ...regression-composer-works-behind-satellite-fallback.sh | 5 +++++ test/cases/regression-composer-works-behind-satellite.sh | 6 ++++++ test/cases/regression.sh | 4 ++++ test/cases/vmware.sh | 8 ++++++++ tools/libvirt_test.sh | 5 +++++ 11 files changed, 66 insertions(+) diff --git a/test/cases/aws.sh b/test/cases/aws.sh index 9f2fc1120..c08d2ab5b 100755 --- a/test/cases/aws.sh +++ b/test/cases/aws.sh @@ -1,4 +1,12 @@ #!/bin/bash + +# +# Test osbuild-composer 'upload to aws' functionality. To do so, create and +# push a blueprint with composer cli. Then, create an instance in aws +# from the uploaded image. Finally, verify that the instance is running and +# cloud init ran. +# + set -euo pipefail source /usr/libexec/osbuild-composer-test/set-env-variables.sh diff --git a/test/cases/azure.sh b/test/cases/azure.sh index fdad40dde..39339dfd0 100755 --- a/test/cases/azure.sh +++ b/test/cases/azure.sh @@ -1,4 +1,12 @@ #!/bin/bash + +# +# Test osbuild-composer 'upload to azure' functionality. To do so, create and +# push a blueprint with composer cli. Then, use terraform to create +# an instance in azure from the uploaded image. Finally, verify the instance +# is running with cloud-init ran. +# + shopt -s expand_aliases set -euo pipefail diff --git a/test/cases/base_tests.sh b/test/cases/base_tests.sh index ede5e1099..d262a2e94 100755 --- a/test/cases/base_tests.sh +++ b/test/cases/base_tests.sh @@ -1,6 +1,10 @@ #!/bin/bash set -euo pipefail +# +# Script that executes different high level sanity tests writen in GO. +# + WORKING_DIRECTORY=/usr/libexec/osbuild-composer TESTS_PATH=/usr/libexec/osbuild-composer-test mkdir --parents /tmp/logs diff --git a/test/cases/generation.sh b/test/cases/generation.sh index 43668f702..3733acf83 100755 --- a/test/cases/generation.sh +++ b/test/cases/generation.sh @@ -1,4 +1,11 @@ #!/usr/bin/bash + +# +# The objective of this script is to provide special requirement needed +# for generate-test-cases. For example, disable the dnf-json daemon +# and then execute generate-test-cases. +# + set -euxo pipefail # Provision the software under test. diff --git a/test/cases/installers.sh b/test/cases/installers.sh index 29334e140..ee0eeca85 100755 --- a/test/cases/installers.sh +++ b/test/cases/installers.sh @@ -1,6 +1,13 @@ #!/bin/bash set -euo pipefail +# +# This test builds a image-installer iso which is then used for OS installation. +# To do so, it creates an image-installer iso, then modifies the kickstart so it +# can be installed automatically, installs the VM with virt-install waits for it +# to boot and then run some test using ansible to check if everything is as expected +# + # Provision the software under test. /usr/libexec/osbuild-composer-test/provision.sh diff --git a/test/cases/libvirt.sh b/test/cases/libvirt.sh index d68535064..03f842988 100644 --- a/test/cases/libvirt.sh +++ b/test/cases/libvirt.sh @@ -1,6 +1,10 @@ #!/bin/bash set -euo pipefail +# +# Helper script that executes `tools/libvirt_test.sh` with the appropiate image type and boot type +# + # Get OS data. source /usr/libexec/osbuild-composer-test/set-env-variables.sh diff --git a/test/cases/regression-composer-works-behind-satellite-fallback.sh b/test/cases/regression-composer-works-behind-satellite-fallback.sh index 65aba1cc9..14dae7cd4 100644 --- a/test/cases/regression-composer-works-behind-satellite-fallback.sh +++ b/test/cases/regression-composer-works-behind-satellite-fallback.sh @@ -1,5 +1,10 @@ #!/bin/bash +# +# test osbuild-composer when the host system doesn't have redhat.repo file, +# but there is a certificate that can be used to access the repositories +# + set -exuo pipefail function greenprint { diff --git a/test/cases/regression-composer-works-behind-satellite.sh b/test/cases/regression-composer-works-behind-satellite.sh index 48d3937d3..8fd669478 100644 --- a/test/cases/regression-composer-works-behind-satellite.sh +++ b/test/cases/regression-composer-works-behind-satellite.sh @@ -1,5 +1,11 @@ #!/bin/bash +# +# osbuild-composer can work with multiple subscriptions on the host system. +# test this by simulating a custom repository with custom certificates and +# verifies that an image can be built using those. +# + set -exuo pipefail function greenprint { diff --git a/test/cases/regression.sh b/test/cases/regression.sh index 221f917ba..49523f863 100644 --- a/test/cases/regression.sh +++ b/test/cases/regression.sh @@ -1,6 +1,10 @@ #!/bin/bash set -euo pipefail +# +# script that servers as a base for all the regression tests +# + source /usr/libexec/osbuild-composer-test/set-env-variables.sh TESTS_PATH=/usr/libexec/tests/osbuild-composer/ diff --git a/test/cases/vmware.sh b/test/cases/vmware.sh index ac60b418a..fd7848019 100755 --- a/test/cases/vmware.sh +++ b/test/cases/vmware.sh @@ -1,4 +1,12 @@ #!/bin/bash + +# +# Test osbuild-composer 'upload to vmware' functionality. To do so, create and +# push a blueprint with composer cli. Then, create an instance in vSphere +# from the uploaded image. Finally, verify that the instance is running and +# cloud init ran. +# + set -euo pipefail source /usr/libexec/osbuild-composer-test/set-env-variables.sh diff --git a/tools/libvirt_test.sh b/tools/libvirt_test.sh index 0d136f6e4..1cbdc7f6d 100755 --- a/tools/libvirt_test.sh +++ b/tools/libvirt_test.sh @@ -1,6 +1,11 @@ #!/bin/bash set -euo pipefail +# +# tests that guest images are buildable using composer-cli and and verifies +# they boot with cloud-init using libvirt +# + OSBUILD_COMPOSER_TEST_DATA=/usr/share/tests/osbuild-composer/ # Get OS data.