Validating the deployed cloud

Install the test-operator

Install the test-operator in the openstack-operators project.

Ensure that you are in the OpenStack project:

oc project openstack

Prepare the secret for installing the Test operators:

Login with your Red Hat account and create a secret:

podman login --username "6340056|osp-on-ocp-lb1374" --password "eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI1Y2EzM2NjNGY4NWM0MmZmYTI3YmU5Y2UyMWI3M2JjMCJ9.GAxgg6Ht2oCS8zxHdwQw9kSD6RHeQOWYaDOcnQB5RElewQKvZmcNWi-YJdInJ5iXTE9r9tGVIN7fhFJL7f-hhL1PK2RVzZHD8qyfkMWcCEF5GUvp8rDX4GDrSkqjpUD44teWYkOy9Nb-3pOGzRIC7qs88uSxMz7hfil4I_HmjF4AAPIi4j3QZhp0lqrXzzf7vt6NLlizDFa2XTcPf_vQqReFu3A_5iWfy8XmLlC7QIixeVv2IE-ahRqM_UDCf5Dg3n2WpYvmP5jcSPFOLoT7sMimyeaPBna793boiX2swmeGHQ23tx1nFavCUavGv_cDRAvzVXCJ2NROTJ5unHiN7CXEbzm4Rg-65tY4D0YynTU8L6t0gYtXYYY9_wi1xNs-cShAmCMh1ySJn9nBcq4ydvH7eQnhSEvoK0bPsN_vWJCgOQBQyOdpTfRMU6piAy9H1zJ0KzsSzuKSS8fX0m9oN7narZPl34DTiEUTDeW8_SS6vJjHr_Q9O_X4mVeeQhH2ocN_4M9R6A89tmQ2jObuWm-cu1Yk-G6FSPUONhsoC_99nQnICS4mAuCWWDHxFY61hIrreVZBSH053MgfSaG2sqTb26MkxKWx-TP1sx18pb1xmo4IQEwILIbLlSPA3vafbrbQO5RQcm3UYKtYwev0vAlL5taXiTuLEyPscdzv0Sc" registry.redhat.io --authfile auth.json

Create secret for the registry:

oc create secret generic osp-operators-secret \
 -n openstack-operators \
 --from-file=.dockerconfigjson=auth.json \
 --type=kubernetes.io/dockerconfigjson

Create a catalogsource, operatorgroup and subscription CR:

cat << EOF | oc apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: openstack-test-operator-index
  namespace: openstack-operators
spec:
  sourceType: grpc
  secrets:
    - "osp-operators-secret"
  gprcPodConfig:
    securityContextConfig: legacy
  # adjust the repolink below to match your environment:
  image: quay.io/redhat_emp1/pnavarro-ga-test-operator-index:latest
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: test-operator-openstack
  namespace: openstack-operators
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: openstack-test-operator
  namespace: openstack-operators
spec:
  name: openstack-test-operator
  channel: stable-v1.0
  source: openstack-test-operator-index
  sourceNamespace: openstack-operators
EOF

When the test-operator-controller-manager pod successfully spawns and the pod is running, you can communicate with the operator using the custom resources (CRs) that the test-operator accepts:

oc get pods -n openstack-operators

Execute Tempest tests

In the bastion terminal, make sure that you are in lab yamls directory:

+

cd labrepo/content/files

Apply the test-v1beta1-tempest file:

oc apply -f test-v1beta1-tempest.yaml

Access to the test pods

You can access the Tempest logs, for example for a test that successfully completed, or to troubleshoot a pod that has failed.

Get the name and status of the relevant pod:

oc get pods | grep -i tempest-tests

Get the logs. Replace <pod_name> with the name of the pod that you got in the previous step:

oc logs <pod_name>

Getting logs from inside the pod

You can access the Tempest logs, for example, for a test that successfully completed, or to troubleshoot a pod that has failed. You can access specific and more detailed Tempest logs from inside the pod.

Get the name and status of the relevant pod:

oc get pods | grep -i tempest-tests

Access the pod.Replace <pod_name> with the name of the pod that you got in the previous step:

oc debug <pod_name>

View available log files inside the pod:

sh-5.1$ ls -lah /var/lib/tempest/external_files

View available log files in the required directory:

sh-5.1$ ls -lah /var/lib/tempest/external_files/<tempest-tests>