"Fossies" - the Fresh Open Source Software Archive

Member "modules-3.2.10/testsuite/modules.50-cmds/085-info-flags.exp" (25 Oct 2012, 2376 Bytes) of archive /linux/misc/modules-3.2.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Express source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 ##############################################################################
    2 #   Modules Revision 3.0
    3 #   Providing a flexible user environment
    4 #
    5 #   File:       modules.50-cmds/%M%
    6 #   Revision:       %I%
    7 #   First Edition:  1995/12/06
    8 #   Last Mod.:      %U%, %G%
    9 #
   10 #   Authors:        Jens Hamisch, Jens.Hamisch@Strawberry.COM
   11 #
   12 #   Description:    Testuite testsequence
   13 #   Command:        load, display, unload, switch, help
   14 #   Modulefiles:    info/mode5, info/mode6
   15 #   Sub-Command:
   16 #
   17 #   Comment:    %C{
   18 #           Tests the 'module-info flags' module subcommand.
   19 #           This command does not change behaviour depending on
   20 #           the user shell. Tests are made for the bourne shell
   21 #           here.
   22 #       }C%
   23 #
   24 ##############################################################################
   25 
   26 #
   27 #  Variables. This test forces a module load command. It will result in the
   28 #    environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
   29 #    be set up
   30 #
   31 
   32 set module "info/mode5"
   33 set modulefile "$env(MODULEPATH)/$module"
   34 
   35 set module2 "info/mode6"
   36 set modulefile2 "$env(MODULEPATH)/$module2"
   37 
   38 #
   39 #  The _LMFILES_ and the LOADEDMODULES will be affected
   40 #
   41 
   42 set lmf_sh_ld "_LMFILES_=$modulefile ;export _LMFILES_;"
   43 set lm_sh_ld "LOADEDMODULES=$module ;export LOADEDMODULES;"
   44 
   45 set lmf_sh_rm "unset _LMFILES_;"
   46 set lm_sh_rm "unset LOADEDMODULES;"
   47 
   48 set lmf_sh_sw "_LMFILES_=$modulefile2 ;export _LMFILES_;"
   49 set lm_sh_sw "LOADEDMODULES=$module2 ;export LOADEDMODULES;"
   50 set switches "5\n8\n17\n"
   51 
   52 set lin_help "\n----------- Module Specific Help for '$module' -----------------\n"
   53 
   54 #
   55 #  The tests
   56 #
   57 
   58 # test loading
   59 test_cmd "sh" "load $module" "32800\n$lm_sh_ld$lmf_sh_ld"
   60 
   61 # test displaying
   62 testouterr_cmd "sh" "display $module" "2" "$modlin$modulefile:\n\n$modlin"
   63 
   64 # Set up the environment for test that require the moduel to be loaded
   65 set env(_LMFILES_) "$modulefile"
   66 set env(LOADEDMODULES) "$module"
   67 
   68 # test unloading
   69 test_cmd "sh" "unload $module" "32769\n$lm_sh_rm$lmf_sh_rm"
   70 
   71 # test switching
   72 test_cmd "sh" "switch $module $module2" "$switches$lm_sh_sw$lmf_sh_sw"
   73 
   74 # Clean up the just changed environment
   75 unset env(LOADEDMODULES)
   76 unset env(_LMFILES_)
   77 
   78 # test help
   79 testerr_cmd "sh" "help $module" "$lin_help\n256"
   80 
   81 #
   82 #  Cleanup
   83 #
   84 
   85 unset lin_help
   86 
   87 unset lm_sh_sw
   88 unset lmf_sh_sw
   89 unset switches
   90 
   91 unset lm_sh_rm
   92 unset lmf_sh_rm
   93 
   94 unset lm_sh_ld
   95 unset lmf_sh_ld
   96 
   97 unset modulefile2
   98 unset module2
   99 
  100 unset modulefile
  101 unset module