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

Function module_loaded in test-framework.sh returns false positives

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.1.0
    • Lustre 2.1.0
    • None
    • RHEL6 based
    • 3
    • 5004

    Description

      The function module_loaded can easily produce false positives based on it's lenient way of grep'ing the output of lsmod.

      Tightening up the regex can improve upon this.

      For example, if checking to see if the 'ost' module is loaded.. It will report true if another module is already loaded and has 'ost' anywhere in its name (i.e. vhost_net).

      Function's match criteria could mort strict to avoid this kind of problem:

      module_loaded() {
              lsmod | grep ^$1 # Or perhaps even '^\b$1\b'
      }
      

      I will submit a patch to gerrit soon.

      Attachments

        Activity

          People

            yujian Jian Yu
            prakash Prakash Surya (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: