provision.sh: add none authentication method for on-premise scenario

`tools/provision.sh` is provisioning SUT always in the same way for
both, the Service scenario and the on-premise scenario. While this is
not causing any issues, it does not realistically represent how we
expect osbuild-composer and worker to be used in these scenarios.

The script currently supports the following authentication options:
- `none`
  - Intended for the on-premise scenario with Weldr API.
  - NO certificates are generated.
  - NO osbuild-composer configuration file is created.
  - NO osbuild-worker configuration file is created. This means that no
    cloud provider credentials are configured directly in the worker.
  - Only the local worker is started and used.
  - Only the Weldr API socker is started.
  - Appropriate repository definitions are copied to
    `/etc/osbuild-composer/repositories/`.
- `jwt`
  - Intended for the Service scenario with Cloud API.
  - Should be the only method supported in the Service scenario in the
    future.
  - Certificates are generated and copied to `/etc/osbuild-composer`.
  - osbuild-composer configuration file is created and configured for
    JWT authentication.
  - osbuild-worker configuration file is created, configured for JWT
    authentication and with appropriate cloud provider credentials.
  - Local worker unit is masked. Only the remote worker is used (the
    socket is started and one remote-worker instance is created).
  - Only the Cloud API socket is started (Weldr API socket is stopped).
  - NO repository definitions are copied to
    `/etc/osbuild-composer/repositories/`.
- `tls`
  - Intended for the Service scenario with Cloud API.
  - Should eventually go away.
  - Certificates are generated and copied to `/etc/osbuild-composer`.
  - osbuild-composer configuration file is created and configured for
    TLS client cert authentication.
  - osbuild-worker configuration file is created, configured for TLS
    authentication and with appropriate cloud provider credentials.
  - Services and sockets are started as they used to be originally:
    - Both local and remote worker sockets are started.
    - Both Weldr and Cloud API sockets are started.
    - Only the local worker unit will be started automatically.
  - NO repository definitions are copied to
    `/etc/osbuild-composer/repositories/`.
This commit is contained in:
Tomas Hozza 2022-08-03 10:04:10 +02:00 committed by Ondřej Budai
parent 31b1a383f0
commit a4b0efb278
28 changed files with 129 additions and 109 deletions

View file

@ -29,7 +29,7 @@ function get_build_info() {
CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest"
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Check available container runtime
if which podman 2>/dev/null >&2; then

View file

@ -19,7 +19,7 @@ set -euo pipefail
CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest"
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Check available container runtime
if which podman 2>/dev/null >&2; then

View file

@ -33,7 +33,7 @@ function get_build_info() {
CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest"
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Check available container runtime
if which podman 2>/dev/null >&2; then

View file

@ -45,7 +45,7 @@ run_test_case () {
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Change to the working directory.
cd $WORKING_DIRECTORY

View file

@ -21,7 +21,7 @@ source /usr/libexec/osbuild-composer-test/set-env-variables.sh
# Provision the software under test.
#
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
TEMPDIR=$(mktemp -d)
function cleanup() {

View file

@ -21,7 +21,7 @@ source /usr/libexec/osbuild-composer-test/set-env-variables.sh
# Provision the software under test.
#
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
ARTIFACTS="${ARTIFACTS:-/tmp/artifacts}"
TEMPDIR=$(mktemp -d)

View file

@ -46,7 +46,7 @@ esac
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
echo "====> Finished Provisioning system"
echo "====> Starting $(basename "$0")"

View file

@ -8,7 +8,7 @@ set -euo pipefail
source /etc/os-release
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Colorful output.
function greenprint {

View file

@ -40,7 +40,7 @@ function get_build_info() {
CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest"
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Check available container runtime
if which podman 2>/dev/null >&2; then

View file

@ -20,7 +20,7 @@ CONTAINER_MINIO_CLIENT="quay.io/minio/mc:latest"
CONTAINER_MINIO_SERVER="quay.io/minio/minio:latest"
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Check available container runtime
if which podman 2>/dev/null >&2; then

View file

@ -89,7 +89,7 @@ run_test_case () {
}
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Change to the working directory.
cd $WORKING_DIRECTORY

View file

@ -9,7 +9,7 @@ set -euo pipefail
#
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Get OS data.
source /usr/libexec/osbuild-composer-test/set-env-variables.sh

View file

@ -9,7 +9,7 @@ set -euo pipefail
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Test the images
/usr/libexec/osbuild-composer-test/libvirt_test.sh qcow2

View file

@ -14,7 +14,7 @@ test_divider () {
}
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Change to the working directory.
cd $WORKING_DIRECTORY

View file

@ -2,7 +2,7 @@
set -euo pipefail
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Get OS data.
source /usr/libexec/osbuild-composer-test/set-env-variables.sh

View file

@ -2,7 +2,7 @@
set -euo pipefail
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Get OS data.
source /etc/os-release

View file

@ -10,7 +10,7 @@ if [[ ${ID} == "rhel" ]] && ! sudo subscription-manager status; then
fi
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Colorful output.
function greenprint {

View file

@ -2,7 +2,7 @@
set -euo pipefail
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Get OS data.
source /etc/os-release

View file

@ -10,7 +10,7 @@ if [[ ${ID} == "rhel" ]] && ! sudo subscription-manager status; then
fi
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Set os-variant and boot location used by virt-install.
case "${ID}-${VERSION_ID}" in

View file

@ -31,7 +31,7 @@ function get_build_info() {
}
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
BLUEPRINT_FILE=/tmp/blueprint.toml
COMPOSE_START=/tmp/compose-start.json
COMPOSE_INFO=/tmp/compose-info.json

View file

@ -47,7 +47,7 @@ if [[ "$ID" == rhel ]] && sudo subscription-manager status; then
fi
# Provision the software under tet.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Discover what system is installed on the runner
case "${ID}" in

View file

@ -76,7 +76,7 @@ if [[ "$ID" == rhel ]] && sudo subscription-manager status; then
fi
# Provision the software under tet.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
# Discover what system is installed on the runner
case "${ID}" in

View file

@ -36,7 +36,7 @@ function get_build_info() {
}
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
BLUEPRINT_FILE=/tmp/blueprint.toml
COMPOSE_START=/tmp/compose-start.json
COMPOSE_INFO=/tmp/compose-info.json

View file

@ -22,7 +22,7 @@ if [[ "${ID}" == "fedora" ]]; then
fi
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
BLUEPRINT_FILE=/tmp/blueprint.toml
COMPOSE_START=/tmp/compose-start.json
COMPOSE_INFO=/tmp/compose-info.json

View file

@ -13,7 +13,7 @@ function greenprint {
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
greenprint "Registering clean ups"
kill_pids=()

View file

@ -17,7 +17,7 @@ esac
set -xeuo pipefail
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
function get_build_info() {

View file

@ -32,7 +32,7 @@ if [ "$ID" != "rhel" ]; then
fi
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
/usr/libexec/osbuild-composer-test/provision.sh none
GOVC_CMD=/tmp/govc