Skip to content

Commit

Permalink
test if all the running pods are annotated for workload partitioning
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeny Slutsky <eslutsky@redhat.com>
  • Loading branch information
eslutsky committed Jul 9, 2024
1 parent c57af7d commit 0ac6042
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions test/suites/optional/workload.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
*** Settings ***
Documentation Tests for Workload Partioning
Resource ../../resources/common.resource
Resource ../../resources/microshift-process.resource
Resource ../../resources/microshift-network.resource

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


*** Test Cases ***
Control Plane Pods Must Be Annotated
[Documentation] Verify that all the Control Plane pods are properly annotated.
All Pods Should Be Annotated As Management


*** Keywords ***
All Pods Should Be Annotated As Management
[Documentation] Obtains list of Deployments created by CSV.
${pods_raw}= Oc Get All Pods
@{pods}= Split String ${pods_raw}
FOR ${pod} IN @{pods}
${ns} ${pod}= Split String ${pod} \@
${csv_dss}= Oc Get Pod Annotation ${ns} ${pod}
END

Oc Get Pod Annotation
[Documentation] Run 'oc get' for a specific instance of a type in a namespace
... with jsonpath provided. Returns output of the command without any parsing.
[Arguments] ${ns} ${pod}
${networks_str}= Oc Get JsonPath
... pod
... ${ns}
... ${pod}
... .metadata.annotations.target\\.workload\\.openshift\\.io/management
Should Not Be Empty ${networks_str}

Oc Get All Pods
[Documentation] Runs 'oc get pods -A`
... Returns the command output as formatted string <name-space>@<pod-name>
${data}= Run With Kubeconfig
... oc get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"@"}{.metadata.name}{"\\n"}{end}'
RETURN ${data}

0 comments on commit 0ac6042

Please sign in to comment.