| 1 |
############################################################################## |
| 2 |
# Modules Revision 3.0 |
| 3 |
# Providing a flexible user environment |
| 4 |
# |
| 5 |
# File: modules.20-locate/%M% |
| 6 |
# Revision: %I% |
| 7 |
# First Edition: 1995/12/06 |
| 8 |
# Last Mod.: %U%, %G% |
| 9 |
# |
| 10 |
# Authors: Jens Hamisch, [email protected] |
| 11 |
# |
| 12 |
# Description: Testuite testsequence |
| 13 |
# Command: load |
| 14 |
# Modulefiles: loc_sym/version13, loc_sym/version14, loc_sym/getvers8 |
| 15 |
# Sub-Command: |
| 16 |
# |
| 17 |
# Comment: %C{ |
| 18 |
# Tests error conditions with the module version command |
| 19 |
# depending on different user levels. |
| 20 |
# }C% |
| 21 |
# |
| 22 |
############################################################################## |
| 23 |
|
| 24 |
# |
| 25 |
# Variables. This test forces a module load command. It will result in the |
| 26 |
# environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to |
| 27 |
# be set up |
| 28 |
# |
| 29 |
|
| 30 |
set module_1 "loc_sym/version13" |
| 31 |
set modulefile_1 "$modpath/$module_1" |
| 32 |
|
| 33 |
set module_2 "loc_sym/version14" |
| 34 |
set modulefile_2 "$modpath/$module_2" |
| 35 |
|
| 36 |
set module_3 "loc_sym/getvers8" |
| 37 |
set modulefile_3 "$modpath/$module_3" |
| 38 |
|
| 39 |
# |
| 40 |
# The warning messages |
| 41 |
# |
| 42 |
|
| 43 |
# different behavior than C-version: error or warning messages for resolution |
| 44 |
# loop or an already defined symbolic version are a bit different on Tcl-version |
| 45 |
set prob_dup "$warn_msgs: Symbolic version 'loc_sym/foo' already defined" |
| 46 |
set err_loop "$error_msgs: Resolution loop on 'loc_sym/1.0' detected" |
| 47 |
|
| 48 |
# |
| 49 |
# Only checked for the csh |
| 50 |
# |
| 51 |
|
| 52 |
lappend ans [list set _LMFILES_ $modulefile_1] |
| 53 |
lappend ans [list set LOADEDMODULES $module_1] |
| 54 |
lappend ans [list set testsuite "bar:blah:foo"] |
| 55 |
testouterr_cmd "csh" "load $module_1" $ans [msg_load $module_1 $prob_dup] |
| 56 |
|
| 57 |
# different behavior than C-version: resolution loop is found at module-version |
| 58 |
# registering time on Tcl-version, so loop is not saved and error message is |
| 59 |
# output at that time. Then the 'module-info symbols' will not return the |
| 60 |
# looping symbol '1.0' as it has not been registered. |
| 61 |
set ans [list] |
| 62 |
lappend ans [list set _LMFILES_ $modulefile_2] |
| 63 |
lappend ans [list set LOADEDMODULES $module_2] |
| 64 |
lappend ans [list set testsuite "bar:foo"] |
| 65 |
lappend ans [list ERR] |
| 66 |
testouterr_cmd "csh" "load $module_2" $ans [msg_load $module_2 $err_loop] |
| 67 |
|
| 68 |
# different behavior than C-version: resolution loop is found at module-version |
| 69 |
# registering time on Tcl-version, so loop is not saved and error message is |
| 70 |
# output at that time. Then the 'module-info version' will not return the |
| 71 |
# '*undef*' value as no loop has been registered. |
| 72 |
set ans [list] |
| 73 |
lappend ans [list set _LMFILES_ $modulefile_3] |
| 74 |
lappend ans [list set LOADEDMODULES $module_3] |
| 75 |
lappend ans [list set testsuite "loc_sym/1.0"] |
| 76 |
lappend ans [list ERR] |
| 77 |
testouterr_cmd "csh" "load $module_3" $ans [msg_load $module_3 $err_loop] |
| 78 |
|
| 79 |
# |
| 80 |
# Cleanup |
| 81 |
# |
| 82 |
|
| 83 |
reset_test_env |