Skip to content
Merged
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
5 changes: 5 additions & 0 deletions test/resources/microshift-process.resource
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ MicroShift Is Live

Wait For MicroShift
[Documentation] Wait for various checks to ensure MicroShift is online.
Wait For MicroShift Service
Wait Until Keyword Succeeds 30x 10s
... MicroShift Is Ready
Wait Until Keyword Succeeds 30x 10s
Expand Down Expand Up @@ -93,6 +94,8 @@ Stop MicroShift
Start MicroShift
[Documentation] Start the MicroShift service
Systemctl With Retry start microshift.service
# Kubeconfig may change between restarts, ensure we are taking the latest one.
Setup Kubeconfig

Enable MicroShift
[Documentation] Enable the MicroShift service
Expand All @@ -107,3 +110,5 @@ Cleanup MicroShift
... return_stdout=True return_stderr=True return_rc=True
Log Many ${stdout} ${stderr} ${rc}
Should Be Equal As Integers ${rc} 0

Enable MicroShift
5 changes: 3 additions & 2 deletions test/suites/greenboot/greenboot.robot
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ Simulate Service Failure
Restart Greenboot And Wait For Success
Disrupt Service
Cleanup MicroShift --all --keep-images
# not using 'Start MicroShift' kw because it retries
Run Keyword And Expect Error 0 != 1
... Systemctl enable --now microshift
... Systemctl start microshift
Run Keyword And Expect Error 0 != 1
... Restart Greenboot And Wait For Success

Expand Down Expand Up @@ -133,6 +134,6 @@ Disrupt Pod Network
Cleanup And Start
[Documentation] Wipe Microshift data and start it.
Cleanup MicroShift --all --keep-images
Systemctl enable --now microshift
Start MicroShift
Setup Kubeconfig
Restart Greenboot And Wait For Success
2 changes: 1 addition & 1 deletion test/suites/standard/hostname.robot
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ Setup Hostname
IF "${hostname}"=="${EMPTY}" RETURN
${old}= Change Hostname ${hostname}
Cleanup MicroShift --all --keep-images
Restart MicroShift
Start MicroShift
RETURN ${old}
81 changes: 46 additions & 35 deletions test/suites/standard/kustomize.robot
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,14 @@ Load From /etc/microshift/manifestsd
[Documentation] Subdir of /etc/microshift/manifests.d
ConfigMap Path Should Match ${ETC_SUBDIR_NAMESPACE} ${ETC_SUBDIR}

# The metal CI automation currently _only_ works for ostree deployments,
# and /usr/lib is not writable there.
#
# Load From /usr/lib/microshift/manifests
# [Documentation] /usr/lib/microshift/manifests
# ConfigMap Path Should Match ${USR_NAMESPACE} /usr/lib/microshift/manifests
#
# Load From /usr/lib/microshift/manifestsd
# # Keyword names cannot have '.' in them
# [Documentation] Subdir of /usr/lib/microshift/manifests.d
# ConfigMap Path Should Match ${USR_SUBDIR_NAMESPACE} ${USR_SUBDIR}
Load From /usr/lib/microshift/manifests
[Documentation] /usr/lib/microshift/manifests
ConfigMap Path Should Match ${USR_NAMESPACE} /usr/lib/microshift/manifests

Load From /usr/lib/microshift/manifestsd
# Keyword names cannot have '.' in them
[Documentation] Subdir of /usr/lib/microshift/manifests.d
ConfigMap Path Should Match ${USR_SUBDIR_NAMESPACE} ${USR_SUBDIR}

Load From Configured Dir
[Documentation] Non-default directory
Expand Down Expand Up @@ -70,6 +67,7 @@ Setup Suite # robocop: disable=too-long-keyword
Check Required Env Variables
Login MicroShift Host
Setup Kubeconfig # for readiness checks
Make Usr Writable If OSTree System

# Used by "Load From /etc/microshift/manifests"
${ns}= Generate Manifests /etc/microshift/manifests
Expand All @@ -81,18 +79,15 @@ Setup Suite # robocop: disable=too-long-keyword
${ns}= Generate Manifests ${ETC_SUBDIR}
Set Suite Variable \${ETC_SUBDIR_NAMESPACE} ${ns}

# The metal CI automation currently _only_ works for ostree deployments,
# and /usr/lib is not writable there.
#
# # Used by "Load From /usr/lib/microshift/manifests"
# ${ns}= Generate Manifests /usr/lib/microshift/manifests
# Set Suite Variable \${USR_NAMESPACE} ${ns}
#
# # Used by "Load From /usr/lib/microshift/manifestsd"
# ${rand}= Generate Random String
# Set Suite Variable \${USR_SUBDIR} /usr/lib/microshift/manifests.d/${rand}
# ${ns}= Generate Manifests ${USR_SUBDIR}
# Set Suite Variable \${USR_SUBDIR_NAMESPACE} ${ns}
# Used by "Load From /usr/lib/microshift/manifests"
${ns}= Generate Manifests /usr/lib/microshift/manifests
Set Suite Variable \${USR_NAMESPACE} ${ns}

# Used by "Load From /usr/lib/microshift/manifestsd"
${rand}= Generate Random String
Set Suite Variable \${USR_SUBDIR} /usr/lib/microshift/manifests.d/${rand}
${ns}= Generate Manifests ${USR_SUBDIR}
Set Suite Variable \${USR_SUBDIR_NAMESPACE} ${ns}

# Used by "Load From Configured Dir"
${ns}= Generate Manifests ${NON_DEFAULT_DIR}
Expand Down Expand Up @@ -136,11 +131,8 @@ Teardown Suite # robocop: disable=too-many-calls-in-keyword

Clear Manifest Directory /etc/microshift/manifests
Remove Manifest Directory ${ETC_SUBDIR}
# The metal CI automation currently _only_ works for ostree deployments,
# and /usr/lib is not writable there.
#
# Clear Manifest Directory /usr/lib/microshift/manifests
# Remove Manifest Directory ${USR_SUBDIR}
Clear Manifest Directory /usr/lib/microshift/manifests
Remove Manifest Directory ${USR_SUBDIR}
Remove Manifest Directory ${NON_DEFAULT_DIR}
Remove Manifest Directory ${UNCONFIGURED_DIR}
Remove Manifest Directory ${YAML_PATH}
Expand All @@ -149,11 +141,8 @@ Teardown Suite # robocop: disable=too-many-calls-in-keyword

Run With Kubeconfig oc delete namespace ${ETC_NAMESPACE} allow_fail=True
Run With Kubeconfig oc delete namespace ${ETC_SUBDIR_NAMESPACE} allow_fail=True
# The metal CI automation currently _only_ works for ostree deployments,
# and /usr/lib is not writable there.
#
# Run With Kubeconfig oc delete namespace ${USR_NAMESPACE} allow_fail=True
# Run With Kubeconfig oc delete namespace ${USR_SUBDIR_NAMESPACE} allow_fail=True
Run With Kubeconfig oc delete namespace ${USR_NAMESPACE} allow_fail=True
Run With Kubeconfig oc delete namespace ${USR_SUBDIR_NAMESPACE} allow_fail=True
Run With Kubeconfig oc delete namespace ${NON_DEFAULT_NAMESPACE} allow_fail=True
Run With Kubeconfig oc delete namespace ${UNCONFIGURED_NAMESPACE} allow_fail=True
Run With Kubeconfig oc delete namespace ${YAML_NAMESPACE} allow_fail=True
Expand All @@ -164,6 +153,11 @@ Teardown Suite # robocop: disable=too-many-calls-in-keyword
Logout MicroShift Host
Remove Kubeconfig

Make Usr Writable If OSTree System
[Documentation] Makes /usr directory writable if host is an OSTree system.
${is_ostree}= Is System OSTree
IF ${is_ostree} Create Usr Directory Overlay

Generate Manifests
[Documentation] Create a namespace and the manifests in the given path.
... Return the namespace.
Expand Down Expand Up @@ -214,6 +208,13 @@ ConfigMap Should Be Missing
... shell=True
Should Be Equal As Integers ${result.rc} 1

Create Usr Directory Overlay
[Documentation] Make /usr dir writable by creating an overlay, rebooting will go back to being immutable.
${stdout} ${rc}= Execute Command
... rpm-ostree usroverlay
... sudo=True return_rc=True
Should Be Equal As Integers 0 ${rc}

Clear Manifest Directory
[Documentation] Remove the contents of the manifest directory
[Arguments] ${manifest_dir}
Expand All @@ -233,5 +234,15 @@ Remove Manifest Directory
Restore Default Config
[Documentation] Remove any custom config and restart MicroShift
Restore Default MicroShift Config
Restart MicroShift
Sleep 10 seconds # Wait for systemd to catch up

# When restoring, we check if ostree is active, if so we reboot
# to convert everything back to normal, MicroShift restart should not
# be needed in that instance
${is_ostree}= Is System OSTree
IF ${is_ostree}
Reboot MicroShift Host
Wait For MicroShift
ELSE
Restart MicroShift
Sleep 10 seconds # Wait for systemd to catch up
END