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
12 changes: 12 additions & 0 deletions test/assets/otp-workloads/icsp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
name: example
spec:
repositoryDigestMirrors:
- mirrors:
- ec2-3-133-161-121.us-east-2.compute.amazonaws.com:5000/ocp/release
source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
- mirrors:
- ec2-3-133-161-121.us-east-2.compute.amazonaws.com:5000/ocp/release
source: registry.ci.openshift.org/ocp/release
12 changes: 12 additions & 0 deletions test/assets/otp-workloads/idms.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: config.openshift.io/v1
kind: ImageDigestMirrorSet
metadata:
name: example
spec:
imageDigestMirrors:
- mirrors:
- ec2-3-133-161-121.us-east-2.compute.amazonaws.com:5000/ocp/release
source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
- mirrors:
- ec2-3-133-161-121.us-east-2.compute.amazonaws.com:5000/ocp/release
source: registry.ci.openshift.org/ocp/release
48 changes: 48 additions & 0 deletions test/assets/otp-workloads/statefulset-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: v1
kind: Service
metadata:
name: foo
labels:
app: hello-pod
spec:
ports:
- port: 80
name: web
clusterIP: None
selector:
app: hello-pod
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: hello-statefulset
spec:
serviceName: "foo"
replicas: 1
selector:
matchLabels:
app: hello-pod
template:
metadata:
labels:
app: hello-pod
spec:
terminationGracePeriodSeconds: 0
containers:
- image: quay.io/microshift/busybox:1.36
imagePullPolicy: IfNotPresent
name: hello-pod
command: ["sh", "-c", "sleep infinity"]
resources: {}
volumeMounts:
- mountPath: /tmp
name: www
restartPolicy: Always
volumeClaimTemplates:
- metadata:
name: www
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ scenario_remove_vms() {
}

scenario_run_tests() {
run_tests host1 suites/osconfig/lifecycle.robot
run_tests host1 \
suites/osconfig/lifecycle.robot \
suites/otp-workloads/oc-cli.robot \
suites/otp-workloads/statefulset-pvc.robot
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ scenario_run_tests() {
run_tests host1 \
suites/osconfig/clusterid.robot \
suites/osconfig/systemd-resolved.robot \
suites/router/
suites/router/ \
suites/otp-workloads/oc-cli.robot \
suites/otp-workloads/statefulset-pvc.robot
}
26 changes: 26 additions & 0 deletions test/scenarios-bootc/el10/releases/el102-lrel@otp-workloads.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Sourced from scenario.sh and uses functions defined there.

start_image="rhel102-bootc-brew-lrel-optional"

scenario_create_vms() {
exit_if_image_not_found "${start_image}"

prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
launch_vm rhel102-bootc --vm_vcpus 4
}

scenario_remove_vms() {
exit_if_image_not_found "${start_image}"

remove_vm host1
}

scenario_run_tests() {
exit_if_image_not_found "${start_image}"

run_tests host1 \
suites/otp-workloads/sos-report-plugins.robot \
suites/otp-workloads/kcm-flags.robot
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ scenario_remove_vms() {
}

scenario_run_tests() {
run_tests host1 suites/osconfig/lifecycle.robot
run_tests host1 \
suites/osconfig/lifecycle.robot \
suites/otp-workloads/oc-cli.robot \
suites/otp-workloads/statefulset-pvc.robot
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ scenario_run_tests() {
run_tests host1 \
suites/osconfig/clusterid.robot \
suites/osconfig/systemd-resolved.robot \
suites/router/
suites/router/ \
suites/otp-workloads/oc-cli.robot \
suites/otp-workloads/statefulset-pvc.robot
}
26 changes: 26 additions & 0 deletions test/scenarios-bootc/el9/releases/el98-lrel@otp-workloads.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Sourced from scenario.sh and uses functions defined there.

start_image="rhel98-bootc-brew-lrel-optional"

scenario_create_vms() {
exit_if_image_not_found "${start_image}"

prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
launch_vm rhel98-bootc --vm_vcpus 4
}

scenario_remove_vms() {
exit_if_image_not_found "${start_image}"

remove_vm host1
}

scenario_run_tests() {
exit_if_image_not_found "${start_image}"

run_tests host1 \
suites/otp-workloads/sos-report-plugins.robot \
suites/otp-workloads/kcm-flags.robot
}
5 changes: 4 additions & 1 deletion test/scenarios/periodics/el98-src@osconfig-lifecycle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ scenario_remove_vms() {
}

scenario_run_tests() {
run_tests host1 suites/osconfig/lifecycle.robot
run_tests host1 \
suites/osconfig/lifecycle.robot \
suites/otp-workloads/oc-cli.robot \
suites/otp-workloads/statefulset-pvc.robot
}
4 changes: 3 additions & 1 deletion test/scenarios/releases/el98-lrel@osconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ scenario_run_tests() {

run_tests host1 \
suites/osconfig/clusterid.robot \
suites/osconfig/systemd-resolved.robot
suites/osconfig/systemd-resolved.robot \
suites/otp-workloads/oc-cli.robot \
suites/otp-workloads/statefulset-pvc.robot
}
26 changes: 26 additions & 0 deletions test/scenarios/releases/el98-lrel@otp-workloads.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Sourced from scenario.sh and uses functions defined there.

start_image="rhel98-brew-lrel-optional"

scenario_create_vms() {
exit_if_commit_not_found "${start_image}"

prepare_kickstart host1 kickstart.ks.template "${start_image}"
launch_vm rhel-9.8 --vm_vcpus 4
}

scenario_remove_vms() {
exit_if_commit_not_found "${start_image}"

remove_vm host1
}

scenario_run_tests() {
exit_if_commit_not_found "${start_image}"

run_tests host1 \
suites/otp-workloads/sos-report-plugins.robot \
suites/otp-workloads/kcm-flags.robot
}
87 changes: 87 additions & 0 deletions test/suites/otp-workloads/kcm-flags.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
*** Settings ***
Documentation Tests verifying kube-controller-manager runs with
... OpenShift flavor flags.
...
... Ported from openshift-tests-private:
... OCP-56673

Resource ../../resources/common.resource
Resource ../../resources/microshift-config.resource
Resource ../../resources/microshift-process.resource
Resource ../../resources/oc.resource
Library ../../resources/journalctl.py

Suite Setup Setup
Suite Teardown Teardown

Test Tags restart slow


*** Variables ***
${KCM_LOG_VLEVEL} SEPARATOR=\n
... ---
... debugging:
... \ \ logVLevel: 2


*** Test Cases ***
Verify KCM Runs With OpenShift Flavor Flags
[Documentation] Verify that kube-controller-manager runs with the
... OpenShift flavor flags logged in MicroShift journal.
... OCP-56673
[Setup] Setup KCM Log VLevel

${kcm_flags}= Command Should Work
... journalctl -u microshift --no-pager | grep kube-controller-manager | grep FLAG

FOR ${flag} IN
... --enable-dynamic-provisioning\="true"
... --allocate-node-cidrs\="true"
... --use-service-account-credentials\="true"
... --leader-elect\="false"
... --leader-elect-retry-period\="3s"
... --leader-elect-resource-lock\="leases"
... --cluster-signing-duration\="720h0m0s"
... --secure-port\="10257"
... --cert-dir\="/var/run/kubernetes"
... --root-ca-file\="/var/lib/microshift/certs/ca-bundle/service-account-token-ca.crt"
... --service-account-private-key-file\="/var/lib/microshift/resources/kube-apiserver/secrets/service-account-key/service-account.key"
... --cluster-signing-cert-file\="/var/lib/microshift/certs/kubelet-csr-signer-signer/csr-signer/ca.crt"
... --cluster-signing-key-file\="/var/lib/microshift/certs/kubelet-csr-signer-signer/csr-signer/ca.key"
... --kube-api-qps\="150"
... --kube-api-burst\="300"
Should Contain ${kcm_flags} ${flag}
END

Should Match Regexp ${kcm_flags} --controllers\="\\[.*-bootstrapsigner.*-tokencleaner.*-ttl.*\\]"

${openshift_config}= Command Should Work
... journalctl -u microshift --no-pager | grep kube-controller-manager | grep openshift-config
Should Contain ${openshift_config} --openshift-config=""

[Teardown] Teardown KCM Log VLevel


*** Keywords ***
Setup
[Documentation] Test suite setup
Check Required Env Variables
Login MicroShift Host
Setup Kubeconfig

Teardown
[Documentation] Test suite teardown
Remove Drop In MicroShift Config 10-kcm-vlevel
Restart MicroShift
Logout MicroShift Host
Remove Kubeconfig

Setup KCM Log VLevel
[Documentation] Set verbose log level and restart to capture KCM flags
Drop In MicroShift Config ${KCM_LOG_VLEVEL} 10-kcm-vlevel
Restart MicroShift

Teardown KCM Log VLevel
[Documentation] Remove KCM verbose log level drop-in and restart
Remove Drop In MicroShift Config 10-kcm-vlevel
Restart MicroShift
Loading