From 89ae855b3530cbcbe56d9b05d0ba121fa5847d63 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 9 Jul 2026 11:00:10 +0200 Subject: [PATCH 1/8] Reduce redundant restarts in dns resource tests --- .../configuration1/dns-resource-configuration.robot | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/suites/configuration1/dns-resource-configuration.robot b/test/suites/configuration1/dns-resource-configuration.robot index a312f1275e..169eadf150 100644 --- a/test/suites/configuration1/dns-resource-configuration.robot +++ b/test/suites/configuration1/dns-resource-configuration.robot @@ -132,7 +132,10 @@ Setup Setup Kubeconfig Teardown - [Documentation] Test suite teardown + [Documentation] Restart MicroShift to restore clean state after the last test + ... (per-test teardowns skip the restart), then clean up. + Remove Drop In MicroShift Config ${DNS_DROPIN} + Restart MicroShift Remove Kubeconfig Logout MicroShift Host @@ -169,20 +172,20 @@ DNS Resource Value Should Match Empty Apply DNS Resource Config [Documentation] Remove any existing drop-in, apply a new DNS resource config and restart MicroShift [Arguments] ${config} - Remove DNS Resource Config + Remove Drop In MicroShift Config ${DNS_DROPIN} Drop In MicroShift Config ${config} ${DNS_DROPIN} Restart MicroShift Apply Invalid DNS Resource Config [Documentation] Apply an invalid DNS resource config that should prevent MicroShift from starting [Arguments] ${config} - Remove DNS Resource Config + Remove Drop In MicroShift Config ${DNS_DROPIN} Drop In MicroShift Config ${config} ${DNS_DROPIN} ${cursor}= Get Journal Cursor VAR ${CURSOR}= ${cursor} scope=TEST Run Keyword And Expect Error 0 != 1 Restart MicroShift Remove DNS Resource Config - [Documentation] Remove the DNS resource drop-in config and restart MicroShift + [Documentation] Remove the DNS resource drop-in config without restarting. + ... The next test's setup will restart MicroShift. Remove Drop In MicroShift Config ${DNS_DROPIN} - Restart MicroShift From 07e24a5c5a31a3176e12a5e3c30558f0ee7de1d4 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 9 Jul 2026 11:19:31 +0200 Subject: [PATCH 2/8] Reduce redundant restarts in kustomize tests --- .../configuration2/kustomize-sources.robot | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/suites/configuration2/kustomize-sources.robot b/test/suites/configuration2/kustomize-sources.robot index 7248a8b863..26477c30a4 100644 --- a/test/suites/configuration2/kustomize-sources.robot +++ b/test/suites/configuration2/kustomize-sources.robot @@ -91,7 +91,6 @@ Multiple Kustomize Paths ... AND Remove Manifest Directory ${MANIFEST_DIR_2} ... AND Oc Delete namespace ksrc-multi-ns-1 --ignore-not-found ... AND Oc Delete namespace ksrc-multi-ns-2 --ignore-not-found - ... AND Restart MicroShift Path Without Kustomization File Is Ignored [Documentation] A path that exists but has no kustomization.yaml should be silently ignored. @@ -103,7 +102,6 @@ Path Without Kustomization File Is Ignored [Teardown] Run Keywords ... Remove Drop In MicroShift Config 10-kustomize ... AND Remove Manifest Directory ${MANIFEST_DIR_1} - ... AND Restart MicroShift Non Existent Path Is Ignored [Documentation] A non-existent path in kustomizePaths should be silently ignored. @@ -111,9 +109,7 @@ Non Existent Path Is Ignored Restart MicroShift - [Teardown] Run Keywords - ... Remove Drop In MicroShift Config 10-kustomize - ... AND Restart MicroShift + [Teardown] Remove Drop In MicroShift Config 10-kustomize Unset Kustomize Paths Uses Defaults [Documentation] Setting kustomizePaths to null should result in the default paths. @@ -146,7 +142,6 @@ Glob Patterns In Kustomize Paths ... AND Remove Manifest Directory ${GLOB_BASE} ... AND Oc Delete namespace ksrc-glob-ns-a --ignore-not-found ... AND Oc Delete namespace ksrc-glob-ns-b --ignore-not-found - ... AND Restart MicroShift *** Keywords *** @@ -157,15 +152,18 @@ Setup Setup Kubeconfig Teardown - [Documentation] Test suite teardown - Logout MicroShift Host + [Documentation] Restart MicroShift to restore clean state after the last test + ... (per-test teardowns skip the restart), then clean up. + Remove Drop In MicroShift Config 10-kustomize + Restart MicroShift Remove Kubeconfig + Logout MicroShift Host Cleanup Kustomize Test - [Documentation] Standard cleanup for a single-path kustomize test + [Documentation] Standard cleanup for a single-path kustomize test without restarting. + ... The next test's setup will restart MicroShift. [Arguments] ${namespace} ${manifest_dir} Run Keywords ... Remove Drop In MicroShift Config 10-kustomize ... AND Remove Manifest Directory ${manifest_dir} ... AND Oc Delete namespace ${namespace} --ignore-not-found - ... AND Restart MicroShift From 64a5d74d82f1fe42e3bf70b2a0b9e07372ed4155 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 9 Jul 2026 11:24:34 +0200 Subject: [PATCH 3/8] Reduce redundant restarts in audit log tests --- test/suites/configuration2/audit-log.robot | 30 ++++++---------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/test/suites/configuration2/audit-log.robot b/test/suites/configuration2/audit-log.robot index c1f70a77cd..e74fd31839 100644 --- a/test/suites/configuration2/audit-log.robot +++ b/test/suites/configuration2/audit-log.robot @@ -65,10 +65,7 @@ Invalid Audit Profile Prevents Startup Stop MicroShift Command Should Fail timeout 30 systemctl start microshift - [Teardown] Run Keywords - ... Remove Drop In MicroShift Config 10-audit - ... AND - ... Restart MicroShift + [Teardown] Remove Drop In MicroShift Config 10-audit Invalid Audit Rotation Values Prevent Startup [Documentation] Non-integer rotation parameters should prevent MicroShift from starting. @@ -76,10 +73,7 @@ Invalid Audit Rotation Values Prevent Startup Stop MicroShift Command Should Fail timeout 30 systemctl start microshift - [Teardown] Run Keywords - ... Remove Drop In MicroShift Config 10-audit - ... AND - ... Restart MicroShift + [Teardown] Remove Drop In MicroShift Config 10-audit Audit Profile None Produces No Logs [Documentation] With profile None, no audit entries should be written. @@ -96,8 +90,6 @@ Audit Profile None Produces No Logs ... Oc Delete configmap ${cm_name} -n ${TEST_NS} --ignore-not-found ... AND ... Remove Drop In MicroShift Config 10-audit - ... AND - ... Restart MicroShift Audit Profile Default Logs Metadata Only [Documentation] Default profile should log metadata but not request/response bodies. @@ -118,8 +110,6 @@ Audit Profile Default Logs Metadata Only ... Oc Delete configmap ${cm_name} -n ${TEST_NS} --ignore-not-found ... AND ... Remove Drop In MicroShift Config 10-audit - ... AND - ... Restart MicroShift Audit Profile WriteRequestBodies Logs Write Operations [Documentation] WriteRequestBodies should log request bodies for write operations @@ -141,8 +131,6 @@ Audit Profile WriteRequestBodies Logs Write Operations ... Oc Delete configmap ${cm_name} -n ${TEST_NS} --ignore-not-found ... AND ... Remove Drop In MicroShift Config 10-audit - ... AND - ... Restart MicroShift Audit Profile AllRequestBodies Logs All Operations [Documentation] AllRequestBodies should log request bodies for all operations. @@ -163,8 +151,6 @@ Audit Profile AllRequestBodies Logs All Operations ... Oc Delete configmap ${cm_name} -n ${TEST_NS} --ignore-not-found ... AND ... Remove Drop In MicroShift Config 10-audit - ... AND - ... Restart MicroShift Audit Log File Exists With Correct Permissions [Documentation] Verify the audit log file exists at the expected path with correct @@ -182,10 +168,7 @@ Audit Log Rotation Respects Max File Size And Count Wait Until Keyword Succeeds 60x 5s ... Audit Backup Files Should Match 2 - [Teardown] Run Keywords - ... Remove Drop In MicroShift Config 10-audit - ... AND - ... Restart MicroShift + [Teardown] Remove Drop In MicroShift Config 10-audit *** Keywords *** @@ -198,10 +181,13 @@ Setup Oc Create namespace ${TEST_NS} Teardown - [Documentation] Test suite teardown + [Documentation] Restart MicroShift to restore clean state after the last test + ... (per-test teardowns skip the restart), then clean up. + Remove Drop In MicroShift Config 10-audit + Restart MicroShift Oc Delete namespace ${TEST_NS} --ignore-not-found - Logout MicroShift Host Remove Kubeconfig + Logout MicroShift Host Grep Audit Log Count [Documentation] Count audit log entries matching the resource name From 83a019018fc095e82d2717af4a734bc3739c8c3f Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 9 Jul 2026 11:24:45 +0200 Subject: [PATCH 4/8] Reduce redundant restarts in telemetry tests --- test/suites/telemetry/telemetry.robot | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/suites/telemetry/telemetry.robot b/test/suites/telemetry/telemetry.robot index e4ab2be172..97be757a4e 100644 --- a/test/suites/telemetry/telemetry.robot +++ b/test/suites/telemetry/telemetry.robot @@ -110,10 +110,14 @@ Setup Setup Kubeconfig Teardown - [Documentation] Test suite teardown + [Documentation] Restart MicroShift to restore clean state after the last test + ... (per-test teardowns skip the restart), then clean up. + Remove Drop In MicroShift Config 10-telemetry + Restore Pull Secrets + Restart MicroShift Wait For MicroShift Healthcheck Success - Logout MicroShift Host Remove Kubeconfig + Logout MicroShift Host Check Required Telemetry Variables [Documentation] Check if the required telemetry variables are set @@ -140,10 +144,9 @@ Setup Telemetry Configuration Remove Telemetry Configuration [Documentation] Removes the telemetry feature from MicroShift configuration file - ... and restarts microshift.service + ... without restarting. The next test's setup will restart MicroShift. Remove Drop In MicroShift Config 10-telemetry Restore Pull Secrets - Restart MicroShift Configure Pull Secrets [Documentation] Sets up the pull secrets for the MicroShift cluster. From 93403fef07217d019772c339d50fec3dafb6e5d0 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 9 Jul 2026 11:31:51 +0200 Subject: [PATCH 5/8] Ensure protective restarts in tests --- .../configuration1/dns-resource-configuration.robot | 7 ++++--- test/suites/configuration2/audit-log.robot | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/test/suites/configuration1/dns-resource-configuration.robot b/test/suites/configuration1/dns-resource-configuration.robot index 169eadf150..ccfc337948 100644 --- a/test/suites/configuration1/dns-resource-configuration.robot +++ b/test/suites/configuration1/dns-resource-configuration.robot @@ -66,7 +66,7 @@ ${DNS_LIMIT_LESS_THAN_REQUEST} SEPARATOR=\n *** Test Cases *** Default DNS Resources [Documentation] Verify default DNS resources when no custom config is applied - [Setup] Remove DNS Resource Config + [Setup] Run Keywords Remove DNS Resource Config AND Restart MicroShift DNS Resource Value Should Be ${DNS_RESOURCE_PATH}.requests.cpu 50m DNS Resource Value Should Be ${DNS_RESOURCE_PATH}.requests.memory 70Mi @@ -107,13 +107,13 @@ Invalid Resource Quantity Prevents Start [Documentation] Verify MicroShift fails to start with invalid resource quantity [Setup] Apply Invalid DNS Resource Config ${DNS_INVALID_QUANTITY} Pattern Should Appear In Log Output ${CURSOR} invalid dns resource request - [Teardown] Remove DNS Resource Config + [Teardown] Run Keywords Remove DNS Resource Config AND Restart MicroShift Limit Less Than Request Prevents Start [Documentation] Verify MicroShift fails to start when limit is less than request [Setup] Apply Invalid DNS Resource Config ${DNS_LIMIT_LESS_THAN_REQUEST} Pattern Should Appear In Log Output ${CURSOR} must be greater than or equal to request - [Teardown] Remove DNS Resource Config + [Teardown] Run Keywords Remove DNS Resource Config AND Restart MicroShift DNS Resolution After Resource Change [Documentation] Verify CoreDNS resolves cluster-local services after resource change @@ -180,6 +180,7 @@ Apply Invalid DNS Resource Config [Documentation] Apply an invalid DNS resource config that should prevent MicroShift from starting [Arguments] ${config} Remove Drop In MicroShift Config ${DNS_DROPIN} + Restart MicroShift Drop In MicroShift Config ${config} ${DNS_DROPIN} ${cursor}= Get Journal Cursor VAR ${CURSOR}= ${cursor} scope=TEST diff --git a/test/suites/configuration2/audit-log.robot b/test/suites/configuration2/audit-log.robot index e74fd31839..9f6a1dd797 100644 --- a/test/suites/configuration2/audit-log.robot +++ b/test/suites/configuration2/audit-log.robot @@ -65,7 +65,9 @@ Invalid Audit Profile Prevents Startup Stop MicroShift Command Should Fail timeout 30 systemctl start microshift - [Teardown] Remove Drop In MicroShift Config 10-audit + [Teardown] Run Keywords + ... Remove Drop In MicroShift Config 10-audit + ... AND Restart MicroShift Invalid Audit Rotation Values Prevent Startup [Documentation] Non-integer rotation parameters should prevent MicroShift from starting. @@ -73,7 +75,9 @@ Invalid Audit Rotation Values Prevent Startup Stop MicroShift Command Should Fail timeout 30 systemctl start microshift - [Teardown] Remove Drop In MicroShift Config 10-audit + [Teardown] Run Keywords + ... Remove Drop In MicroShift Config 10-audit + ... AND Restart MicroShift Audit Profile None Produces No Logs [Documentation] With profile None, no audit entries should be written. From 844615f4d96c20d68e5b6b9729f79d602ba67883 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 9 Jul 2026 11:43:34 +0200 Subject: [PATCH 6/8] Reduce redundant restarts in configuration tests --- test/suites/configuration1/configuration.robot | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/test/suites/configuration1/configuration.robot b/test/suites/configuration1/configuration.robot index 5a79c3f6f2..44d14d5b87 100644 --- a/test/suites/configuration1/configuration.robot +++ b/test/suites/configuration1/configuration.robot @@ -106,9 +106,7 @@ Deploy MicroShift With LVMS By Default [Setup] Deploy Storage Config ${LVMS_DEFAULT} LVMS Is Deployed CSI Snapshot Controller Is Deployed - [Teardown] Run Keywords - ... Remove Storage Drop In Config - ... Restart MicroShift + [Teardown] Remove Storage Drop In Config Deploy MicroShift Without LVMS [Documentation] Verify that LVMS is not deployed when storage.driver == none, and that CSI snapshotting @@ -119,9 +117,7 @@ Deploy MicroShift Without LVMS # Reduce the default timeout to 2 minutes for a quicker failure Run Keyword And Expect Error 1 != 0 ... LVMS Is Deployed timeout=${DEFAULT_WAIT_TIMEOUT} - [Teardown] Run Keywords - ... Remove Storage Drop In Config - ... Restart MicroShift + [Teardown] Remove Storage Drop In Config Deploy MicroShift Without CSI Snapshotter [Documentation] Verify that only LVMS is deployed when .storage.optionalCsiComponents is an empty array. @@ -132,9 +128,7 @@ Deploy MicroShift Without CSI Snapshotter Run Keyword And Expect Error 1 != 0 ... CSI Snapshot Controller Is Deployed timeout=${DEFAULT_WAIT_TIMEOUT} - [Teardown] Run Keywords - ... Remove Storage Drop In Config - ... Restart MicroShift + [Teardown] Remove Storage Drop In Config Crio Uses Crun Runtime [Documentation] Verify that crio uses crun as its default runtime @@ -163,12 +157,14 @@ Setup Save Journal Cursor Teardown - [Documentation] Test suite teardown + [Documentation] Restart MicroShift to restore clean state after the last test + ... (per-test teardowns skip the restart), then clean up. Remove Drop In MicroShift Config 10-loglevel Remove Drop In MicroShift Config 10-audit + Remove Drop In MicroShift Config 10-storage Restart MicroShift - Logout MicroShift Host Remove Kubeconfig + Logout MicroShift Host Save Journal Cursor [Documentation] From 1317a55773f258b20fa45a2ffe0ebc94414a9e63 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 9 Jul 2026 11:43:40 +0200 Subject: [PATCH 7/8] Reduce redundant restarts in etcd tests --- test/suites/standard1/etcd.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/suites/standard1/etcd.robot b/test/suites/standard1/etcd.robot index 1941637b57..3c1fa9835d 100644 --- a/test/suites/standard1/etcd.robot +++ b/test/suites/standard1/etcd.robot @@ -79,7 +79,7 @@ Set MemoryHigh Limit Unlimited [Tags] configuration restart slow [Setup] Setup With Custom Config ${MEMLIMIT0} Expect MemoryHigh infinity - [Teardown] Restore Default Config + [Teardown] Remove Drop In MicroShift Config 10-etcd Set MemoryHigh Limit 256MB [Documentation] Set the memory limit for etcd to 256MB and ensure it takes effect @@ -87,7 +87,7 @@ Set MemoryHigh Limit 256MB [Setup] Setup With Custom Config ${MEMLIMIT256} # Expecting the setting to be 256 * 1024 * 1024 Expect MemoryHigh 268435456 - [Teardown] Restore Default Config + [Teardown] Remove Drop In MicroShift Config 10-etcd *** Keywords *** From c6fd94b9ca313f5066490baf386a4ec362e71089 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 9 Jul 2026 11:43:47 +0200 Subject: [PATCH 8/8] Reduce redundant restarts in feature gates tests --- test/suites/standard2/feature-gates.robot | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/suites/standard2/feature-gates.robot b/test/suites/standard2/feature-gates.robot index 75e04679a4..9b31b508a9 100644 --- a/test/suites/standard2/feature-gates.robot +++ b/test/suites/standard2/feature-gates.robot @@ -84,9 +84,13 @@ Setup Setup Kubeconfig # for readiness checks Teardown - [Documentation] Test suite teardown - Logout MicroShift Host + [Documentation] Start MicroShift to restore clean state after the last test + ... (per-test teardowns leave MicroShift stopped), then clean up. + Remove Drop In MicroShift Config 10-featuregates + Remove Feature Gate Lock File If Exists + Restart MicroShift Remove Kubeconfig + Logout MicroShift Host Save Journal Cursor [Documentation] @@ -105,11 +109,11 @@ Setup Custom Feature Gates Test Feature Gate Lock File Should Exist Teardown Custom Feature Gates Test - [Documentation] Remove custom feature gates config and restart MicroShift + [Documentation] Remove custom feature gates config without restarting. + ... The next test's setup will start MicroShift. Stop MicroShift Remove Drop In MicroShift Config 10-featuregates Remove Feature Gate Lock File If Exists - Start MicroShift Remove Feature Gate Lock File If Exists [Documentation] Remove the feature gate lock file if it exists, for test cleanup