Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-9474

tests: register traps in a correct order

    XMLWordPrintable

Details

    • 3
    • 9223372036854775807

    Description

      trap is used in many tests to set actions to perform on cleanup.

      IMHO, trap should be registered in this order:

      cleanup_test_XX()
      {
          undo_something
      }
      
      test_XX()
      {
          trap cleanup_test_XX EXIT
          do_something
          ...
      }
      

      Currently many tests do not respect this template.
      Among those, some:

      • register the trap after do_something();
      • explicitly call cleanup_test_XX() at the end of the test;
      • call trap 0 at the start of cleanup_test_XX() (this one may be controversial, I believe the test harness should provide, and probably already provides, trap isolation between tests).

      Attachments

        Issue Links

          Activity

            People

              standan Saurabh Tandan (Inactive)
              cealustre CEA
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: