Uploaded image for project: 'Managed Service - API'
  1. Managed Service - API
  2. MGDAPI-3864

J08B - [DESTRUCTIVE] - backup-restore - Verify User SSO Backup and Restore

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Won't Do
    • Icon: Normal Normal
    • 1.20.0
    • 1.20.0
    • Testing
    • False
    • Hide

      None

      Show
      None
    • False
    • No
    • RC2

      Origin: tests/backup-restore/j08b-verify-user-sso-backup-and-restore.md

      Description

      Note: this test should only be performed at a time it will not affect other ongoing testing, or on a separate cluster.
      In case the current cluster is not available for some reason, you can perform this test case on the "fresh install" cluster

      Steps

      Postgres

      1. Login via oc as kubeadmin
      2. Verify Clients and Realms exist in postgres.

      Create a throwaway Postgres instance to access the User SSO Postgres instance

      cat << EOF | oc create -f - -n redhat-rhoam-operator
        apiVersion: integreatly.org/v1alpha1
        kind: Postgres
        metadata:
          name: throw-away-postgres
          labels:
            productName: productName
        spec:
          secretRef:
            name: throw-away-postgres-sec
          tier: development
          type: workshop
      EOF
      
      # Get postgres db host and password to use it later for logging into postgres db
      oc get secret rhssouser-postgres-rhoam -n redhat-rhoam-operator -o json | jq -r .data.host | base64 --decode
      oc get secret rhssouser-postgres-rhoam -n redhat-rhoam-operator -o json | jq -r .data.password | base64 --decode
      # Wait until the throwaway Postgres instance is running
      oc get pods -n redhat-rhoam-operator | grep throw-away | awk '{print $3}'
      # oc rsh to the pod
      oc rsh -n redhat-rhoam-operator $(oc get pods -n redhat-rhoam-operator | grep throw-away | awk '{print $1}')
      # Log in using host and password retrieved with commands above. psql will prompt for password
      psql --host=<postgres_db_host> --port=5432 --username=postgres --password --dbname=postgres
      select * from client;
      select * from realm;
      

      Once verified. Delete the throwaway Postgres

      oc delete -n redhat-rhoam-operator postgres/throw-away-postgres
      
      1. Run the backup and restore script
      cd test/scripts/backup-restore
      NS_PREFIX=redhat-rhoam ./j08-verify-user-sso-backup-and-restore.sh | tee test-output.txt
      
      1. Wait for the script to finish without errors
      2. Verify in the test-output.txt log that the test finished successfully.

      Note
      Sometimes there could be a difference between the DB dump files, caused by a changed order of lines in these files. That is not considered to be an issue. More details: https://issues.redhat.com/browse/MGDAPI-2380

      General guidelines for testing

      https://github.com/integr8ly/integreatly-operator/tree/master/test-cases/common/general-guidelines.md

              Unassigned Unassigned
              trepel Tomas Repel
              RHOAM Engineering
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: