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

init_test_env misuses `dirname $0` to locate server modules

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.6.0
    • Lustre 2.5.0
    • 3
    • 10897

    Description

      In init_test_env we have the following code to locate server modules:

          if [ ! -f /lib/modules/$(uname -r)/kernel/fs/lustre/mdt.ko -a \
              ! -f /lib/modules/$(uname -r)/updates/kernel/fs/lustre/mdt.ko -a \
              ! -f `dirname $0`/../mdt/mdt.ko ]; then
              export CLIENTMODSONLY=yes
          fi
      

      When running from a build directory (with modules not installed in /lib/modules/...) this is broken when init_test_env is called by rpc.sh through do_rpc_nodes:

      do_rpc_nodes () {
              local list=$1
              shift
      
              [ -z "$list" ] && return 0
      
              # Add paths to lustre tests for 32 and 64 bit systems.                                                 
      	local LIBPATH="/usr/lib/lustre/tests:/usr/lib64/lustre/tests:"
              local TESTPATH="$RLUSTRE/tests:"
              local RPATH="PATH=${TESTPATH}${LIBPATH}${PATH}:/sbin:/bin:/usr/sbin:"
              do_nodesv $list "${RPATH} NAME=${NAME} sh rpc.sh $@ "
      }
      

      No matter where rpc.sh is found, when it executes it will have $0 set to 'rpc.sh' and not to the full path.

      So `dirname $0`/../mdt/mdt.ko should be replaced with $LUSTRE/mdt/mdt.ko.

      I also see that CONFIG is not propagated to rpc.sh.

      Attachments

        Activity

          People

            jhammond John Hammond
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: