Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/bin/ci_phase_iso_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ run_image_build() {

# Conditional per-layer builds when running in CI.
# The build_images.sh script skips any images that have been downloaded from the cache.
$(dry_run) bash -x ./bin/build_images.sh -l ./image-blueprints/layer1-base
$(dry_run) bash -x ./bin/build_images.sh -l ./image-blueprints/layer2-presubmit
$(dry_run) bash -x ./bin/build_images.sh -f -l ./image-blueprints/layer1-base
$(dry_run) bash -x ./bin/build_images.sh -f -l ./image-blueprints/layer2-presubmit

if [[ "${CI_JOB_NAME}" =~ .*periodic.* ]]; then
$(dry_run) bash -x ./bin/build_images.sh -l ./image-blueprints/layer3-periodic
Expand Down
53 changes: 53 additions & 0 deletions test/resources/optional-config.resource
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
*** Settings ***
Documentation Keywords for reconfiguring MicroShift with per-suite
... optional components via kustomizePaths.

Library Collections
Library String
Resource common.resource
Resource microshift-config.resource
Resource microshift-process.resource
*** Keywords ***
Setup MicroShift With Optionals
[Documentation] Reconfigure MicroShift to load only the specified optional
... manifests.d directories, clean all data, and restart fresh.
... Each argument is a directory name under /usr/lib/microshift/manifests.d/
... (e.g. 001-microshift-olm). Call with no arguments to run base MicroShift
... without any optional components.
[Arguments] @{manifests_dirs}
Save Default MicroShift Config
${kustomize_yaml}= Build Optionals Config @{manifests_dirs}
${config}= Replace MicroShift Config ${kustomize_yaml}
Stop MicroShift
Upload MicroShift Config ${config}
Cleanup MicroShift --all --keep-images
Systemctl start microshift.service
Wait For MicroShift Service
Wait Until Keyword Succeeds 10x 10s
... Setup Kubeconfig
Wait For MicroShift

Teardown MicroShift With Optionals
[Documentation] Restore the original MicroShift config after a suite.
... If setup never completed, the default config variable may not exist,
... so fall back to clearing the config file.
${exists}= Run Keyword And Return Status Variable Should Exist ${DEFAULT_MICROSHIFT_CONFIG}
IF ${exists}
Restore Default MicroShift Config
ELSE
Clear MicroShift Config
END

Build Optionals Config
[Documentation] Build a config.yaml string with kustomizePaths containing
... only the base manifests path and the specified manifests.d entries.
[Arguments] @{manifests_dirs}
@{lines}= Create List
... manifests:
... \ \ kustomizePaths:
... \ \ \ \ - /usr/lib/microshift/manifests
FOR ${dir} IN @{manifests_dirs}
Append To List ${lines} \ \ \ \ - /usr/lib/microshift/manifests.d/${dir}
END
${config}= Catenate SEPARATOR=\n @{lines}
RETURN ${config}
17 changes: 15 additions & 2 deletions test/suites/optional/cert-manager.robot
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ Resource ../../resources/oc.resource
Resource ../../resources/microshift-config.resource
Resource ../../resources/microshift-network.resource
Resource ../../resources/microshift-process.resource
Resource ../../resources/optional-config.resource
Resource ../../resources/ostree-health.resource

Suite Setup Setup Suite With Namespace
Suite Teardown Teardown Suite With Namespace
Suite Setup Setup
Suite Teardown Teardown

Test Tags cert-manager certificates tls

Expand Down Expand Up @@ -96,6 +97,18 @@ Test Cert manager with local acme server


*** Keywords ***
Setup
[Documentation] Setup cert-manager suite with only its required optionals
Setup Suite
Setup MicroShift With Optionals 060-microshift-cert-manager
${ns}= Create Unique Namespace
VAR ${NAMESPACE}= ${ns} scope=SUITE

Teardown
[Documentation] Restore config and teardown suite
Teardown MicroShift With Optionals
Teardown Suite With Namespace

Deploy Hello MicroShift
[Documentation] Deploys the hello microshift application (service included)
... in the given namespace.
Expand Down
18 changes: 16 additions & 2 deletions test/suites/optional/gateway-api.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
Documentation Test Gateway API functionality

Resource ../../resources/microshift-network.resource
Resource ../../resources/microshift-process.resource
Resource ../../resources/optional-config.resource
Resource ../../resources/oc.resource

Suite Setup Setup Suite With Namespace
Suite Teardown Teardown Suite With Namespace
Suite Setup Setup
Suite Teardown Teardown

Test Tags optional gateway-api

Expand Down Expand Up @@ -38,6 +40,18 @@ Test Simple HTTP Route


*** Keywords ***
Setup
[Documentation] Setup gateway-api suite with only its required optionals
Setup Suite
Setup MicroShift With Optionals 000-microshift-gateway-api
${ns}= Create Unique Namespace
VAR ${NAMESPACE}= ${ns} scope=SUITE

Teardown
[Documentation] Restore config and teardown suite
Teardown MicroShift With Optionals
Teardown Suite With Namespace

Deploy Hello MicroShift
[Documentation] Deploys the hello microshift application (service included)
... in the given namespace.
Expand Down
19 changes: 13 additions & 6 deletions test/suites/optional/generic-device-plugin.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ Documentation Generic Device Plugin

Resource ../../resources/microshift-config.resource
Resource ../../resources/microshift-process.resource
Resource ../../resources/optional-config.resource
Resource ../../resources/ostree-health.resource
Variables strings.py
Library strings.py

Suite Setup Setup Suite With Namespace
Suite Teardown Teardown Suite With GDP Cleanup
Suite Setup Setup Suite With Optionals
Suite Teardown Teardown Suite With GDP Cleanup And Optionals

Test Tags generic-device-plugin

Expand Down Expand Up @@ -244,11 +245,17 @@ Create Pod And Verify Allocation
# Verify node shows correct allocation
Verify Node Device Allocation ${expected_total_allocated}

Teardown Suite With GDP Cleanup
[Documentation] Suite teardown that cleans up GDP configuration and restarts MicroShift
# Clean up any remaining GDP configuration
Setup Suite With Optionals
[Documentation] Setup suite with base MicroShift only (no optional components)
Setup Suite
Setup MicroShift With Optionals
${ns}= Create Unique Namespace
VAR ${NAMESPACE}= ${ns} scope=SUITE

Teardown Suite With GDP Cleanup And Optionals
[Documentation] Suite teardown that cleans up GDP configuration and restores optionals config
Remove Drop In MicroShift Config 10-gdp
# Restart MicroShift to clean state for next suite
Restart MicroShift
Wait For MicroShift Healthcheck Success
Teardown MicroShift With Optionals
Teardown Suite With Namespace
17 changes: 15 additions & 2 deletions test/suites/optional/healthchecks-disabled-service.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ Documentation Test if healthcheck exits quickly when MicroShift service is

Resource ../../resources/common.resource
Resource ../../resources/microshift-process.resource
Resource ../../resources/optional-config.resource
Library DateTime

Suite Setup Setup Suite
Suite Teardown Teardown Suite
Suite Setup Setup
Suite Teardown Teardown


*** Test Cases ***
Expand Down Expand Up @@ -36,3 +37,15 @@ Healthchecks Should Exit Fast And Successful When MicroShift Is Disabled
Should Contain ${stderr} microshift.service is not enabled
END
[Teardown] Enable MicroShift


*** Keywords ***
Setup
[Documentation] Setup suite with base MicroShift only (no optional components)
Setup Suite
Setup MicroShift With Optionals

Teardown
[Documentation] Restore config and teardown suite
Teardown MicroShift With Optionals
Teardown Suite
13 changes: 11 additions & 2 deletions test/suites/optional/multus.robot
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ Resource ../../resources/common.resource
Resource ../../resources/multus.resource
Resource ../../resources/microshift-process.resource
Resource ../../resources/microshift-rpm.resource
Resource ../../resources/optional-config.resource

Suite Setup Setup
Suite Teardown Teardown Suite With Namespace
Suite Teardown Teardown

Test Tags vm-only

Expand Down Expand Up @@ -111,7 +112,10 @@ Ipvlan
*** Keywords ***
Setup
[Documentation] Setup test suite
Setup Suite With Namespace
Setup Suite
Setup MicroShift With Optionals
${ns}= Create Unique Namespace
VAR ${NAMESPACE}= ${ns} scope=SUITE

${out}= Command Should Work ip route list default | cut -d' ' -f5
@{enps}= String.Split To Lines ${out}
Expand All @@ -121,6 +125,11 @@ Setup
VAR ${IPVLAN_MASTER}= ${enps[1]} scope=SUITE
Verify MicroShift RPM Install

Teardown
[Documentation] Restore config and teardown suite
Teardown MicroShift With Optionals
Teardown Suite With Namespace

Template And Create NAD And Pod
[Documentation] Template NAD and create it along with Pod
[Arguments] ${nad_tpl} ${pod}
Expand Down
8 changes: 7 additions & 1 deletion test/suites/optional/observability.robot
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Library ../../resources/prometheus.py
Library ../../resources/loki.py
Resource ../../resources/kubeconfig.resource
Resource ../../resources/common.resource
Resource ../../resources/microshift-process.resource
Resource ../../resources/optional-config.resource
Resource ../../resources/systemd.resource
Resource ../../resources/observability.resource
Resource ../../resources/microshift-network.resource
Expand Down Expand Up @@ -68,7 +70,10 @@ Logs Should Not Contain Receiver Errors
Setup Suite And Prepare Test Host
[Documentation] The service starts after MicroShift starts and thus will start generating pertinent log data
... right away. When the suite is executed, immediately get the cursor for the microshift-observability unit.
Setup Suite With Namespace
Setup Suite
Setup MicroShift With Optionals
${ns}= Create Unique Namespace
VAR ${NAMESPACE}= ${ns} scope=SUITE
# Configure the firewall for the Prometheus exporter
Command Should Work sudo firewall-cmd --permanent --zone=public --add-port=8889/tcp
Command Should Work sudo firewall-cmd --reload
Expand Down Expand Up @@ -124,6 +129,7 @@ Set Test OTEL Configuration
Teardown Suite And Revert Test Host
[Documentation] Set back original OTEL config and teardown Suite
Set Back Original OTEL Configuration
Teardown MicroShift With Optionals
Teardown Suite With Namespace

Set Back Original OTEL Configuration
Expand Down
3 changes: 3 additions & 0 deletions test/suites/optional/olm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Documentation Operator Lifecycle Manager on MicroShift
Resource ../../resources/common.resource
Resource ../../resources/microshift-process.resource
Resource ../../resources/microshift-rpm.resource
Resource ../../resources/optional-config.resource
Resource ../../resources/oc.resource
Library DataFormats.py

Expand Down Expand Up @@ -148,6 +149,7 @@ Setup
Login MicroShift Host
Setup Kubeconfig
Verify MicroShift RPM Install
Setup MicroShift With Optionals 001-microshift-olm

Setup Test
[Documentation] Test setup
Expand All @@ -164,6 +166,7 @@ Setup Test

Teardown
[Documentation] Test suite teardown
Teardown MicroShift With Optionals
Logout MicroShift Host
Remove Kubeconfig

Expand Down
15 changes: 13 additions & 2 deletions test/suites/optional/sriov.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
Documentation MicroShift SR-IOV tests

Resource ../../resources/microshift-process.resource
Resource ../../resources/optional-config.resource

Suite Setup Setup Suite
Suite Teardown Teardown Suite
Suite Setup Setup
Suite Teardown Teardown

Test Tags optional sriov slow

Expand Down Expand Up @@ -47,6 +48,16 @@ Create VFs And Verify


*** Keywords ***
Setup
[Documentation] Setup sriov suite with only its required optionals
Setup Suite
Setup MicroShift With Optionals 070-microshift-sriov

Teardown
[Documentation] Restore config and teardown suite
Teardown MicroShift With Optionals
Teardown Suite

Cleanup SR-IOV Policy
[Documentation] Deletes the policy
Run With Kubeconfig oc delete -f ${OUTPUT_DIR}/final-sriov-policy.yaml -n sriov-network-operator
Expand Down
18 changes: 16 additions & 2 deletions test/suites/optional/tls-scanner.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ Library Process
Library String
Resource ../../resources/common.resource
Resource ../../resources/kubeconfig.resource
Resource ../../resources/microshift-process.resource
Resource ../../resources/optional-config.resource
Resource ../../resources/oc.resource

Suite Setup Setup Suite With Namespace
Suite Teardown Teardown Suite With Namespace
Suite Setup Setup
Suite Teardown Teardown

Test Tags tls-scanner security optional

Expand Down Expand Up @@ -51,6 +53,18 @@ TLS Scanner Host Scan Completes And Produces Artifacts


*** Keywords ***
Setup
[Documentation] Setup suite with base MicroShift only (no optional components)
Setup Suite
Setup MicroShift With Optionals
${ns}= Create Unique Namespace
VAR ${NAMESPACE}= ${ns} scope=SUITE

Teardown
[Documentation] Restore config and teardown suite
Teardown MicroShift With Optionals
Teardown Suite With Namespace

Check Required Scanner Variables
[Documentation] Fail if SCANNER_IMAGE is not set.
Should Not Be Empty ${SCANNER_IMAGE}
Expand Down