Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-13048

ch02s07: lab needs clarification of read-only message

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • DO380 - OCP4.14-en-1-20240220
    • DO380
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • 2
    • ROLE
    • en-US (English)

      Please fill in the following information:


      URL: https://role.rhu.redhat.com/rol-rhu/app/courses/do380-4.14/pages/ch02s07
      Reporter RHNID: rhn-support-ablum
      Section Title:  Lab: Backup, Restore, and Migration of Applications with OADP                                                        

      Issue description

      `lab grade backup-review` expects a very specific string in the lock file but that string is not identified in the original lab instructions.  This leads to a failure in one of the items validated.

      Currently here is what is given in the lab instructions:

      To lock the MediaWiki application in read-only mode, create a /data/images/lock_yBgMBwiR file in the mediawiki container. This lock file must contain a single line of text with the reason to display the lock to the users in the application.

      NOTE: No exact string is required.

      Yet, here is what is used in the grading code:

      /home/student/.venv/labs/lib/python3.9/site-packages/do380/common/backup_steps.py

      ```

      def grade_mw_in_maintenance_step(readonly, namespace):
      ...SNIP...
                  if readonly:
                      if "error" not in ret:
                          # write is successful
                          step.add_error("Mediawiki is not in read-only")
                      elif ret["error"]["code"] == "readonly" and not ret["error"][
                          "readonlyreason"
                      ].startswith("backup in progress"):
                          step.add_error("Read-only message is incorrect")

      ```

       

       

      Steps to reproduce:

       

      Create a schedule with some string other than what's in the grading script.

      [student@workstation backup-review]$ cat schedule.yml

                  - /bin/bash
                  - -c
                  - echo "backup foo in progress" > /data/images/lock_yBgMBwiR;
              post:

       

      Then, run the lab grade backup-review to see the error

      [student@workstation backup-review]$ lab grade backup-review
      PASS    Verify OADP configuration
      PASS    Verify OADP Backup Storage Location
      PASS    Verify ocs-external-storagecluster-cephfsplugin-snapclass configuration
      PASS    Verify ocs-external-storagecluster-rbdplugin-snapclass configuration
      PASS    Verify Backup Schedule
      PASS    Verify old backups and restores are cleaned up
      SUCCESS Cleaning grading backup and restore
      PASS    Verify Backup completes successfully
      PASS    Verify that snapshots are created on object storage
      PASS    Verify Restore completes successfully on wiki-grade project
      SUCCESS Cleaning grading backup and restore
      PASS    Verify restored resources on wiki-grade project
      FAIL    Verify Mediawiki instance on wiki-grade project is in read-only
              - Read-only message is incorrect
      PASS    Verify volumes on wiki-grade project are restored
      PASS    Verify restored resources on wiki-staging project
      PASS    Verify Mediawiki instance on wiki-staging project is in read-only
      PASS    Verify volumes on wiki-staging project are restored

       

      Workaround:

       

      A learner must look to the solution to see what message was expected and then update the velero schedule to include that in the lock file.

      [student@workstation backup-review]$ cat schedule.yml

                  - /bin/bash
                  - -c
                  - echo "backup in progress" > /data/images/lock_yBgMBwiR;
              post:

       

       

      Expected result:

      I'd recommend updating the lab instructions to say:

      To lock the MediaWiki application in read-only mode, create a /data/images/lock_yBgMBwiR file in the mediawiki container. This lock file must contain a single line with the string "backup in progress" to display the lock to the users in the application.

       

            rht-harpasin Harpal Singh
            rhn-support-ablum Andrew Blum
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: