| 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: 2012/12/17 |
| 8 |
# Last Mod.: %U%, %G% |
| 9 |
# |
| 10 |
# Authors: R.K. Owen, <[email protected]> |
| 11 |
# |
| 12 |
# Description: recursive load/unload test - lots of modulefiles |
| 13 |
# Command: load |
| 14 |
# Modulefiles: recurs/modA |
| 15 |
# recurs/modA |
| 16 |
# Sub-Command: |
| 17 |
# |
| 18 |
# Comment: %C{ |
| 19 |
# Recursive load a lot of modulefiles |
| 20 |
# }C% |
| 21 |
# |
| 22 |
############################################################################## |
| 23 |
|
| 24 |
skip_if_quick_mode |
| 25 |
|
| 26 |
set tm00 "load/00" |
| 27 |
set tp00 "$modpath/$tm00" |
| 28 |
set tmall "$tm00" |
| 29 |
set tpall "$tp00" |
| 30 |
set env(mload) "foobar" |
| 31 |
lappend tmpreall "load/all" |
| 32 |
|
| 33 |
for {set t 10} {$t <= 30} {incr t} { |
| 34 |
set m "load/$t" |
| 35 |
set p "$modpath/$m" |
| 36 |
|
| 37 |
append tmall ":$m" |
| 38 |
append tpall ":$p" |
| 39 |
lappend tmnuaall $m |
| 40 |
lappend tmpreall $m |
| 41 |
} |
| 42 |
|
| 43 |
set mall "load/all" |
| 44 |
set pall "$modpath/$mall" |
| 45 |
|
| 46 |
append tmall ":$mall" |
| 47 |
append tpall ":$pall" |
| 48 |
|
| 49 |
# |
| 50 |
# set up a limited environment |
| 51 |
# |
| 52 |
setenv_loaded_module $tm00 $tp00 |
| 53 |
|
| 54 |
# |
| 55 |
# load |
| 56 |
# For the different shells ... |
| 57 |
# |
| 58 |
set ans [list] |
| 59 |
lappend ans [list set t13 t13] |
| 60 |
lappend ans [list set t14 t14] |
| 61 |
lappend ans [list set LOADEDMODULES $tmall] |
| 62 |
lappend ans [list set _LMFILES_ $tpall] |
| 63 |
lappend ans [list set t15 t15] |
| 64 |
lappend ans [list set __MODULES_LMTAG [join $tmnuaall "&auto-loaded:"]&auto-loaded] |
| 65 |
lappend ans [list set t16 t16] |
| 66 |
lappend ans [list set t17 t17] |
| 67 |
lappend ans [list set t18 t18] |
| 68 |
lappend ans [list unset mload] |
| 69 |
lappend ans [list set __MODULES_LMPREREQ [join $tmpreall &]] |
| 70 |
lappend ans [list set t20 t20] |
| 71 |
lappend ans [list set t19 t19] |
| 72 |
lappend ans [list set t21 t21] |
| 73 |
lappend ans [list set t22 t22] |
| 74 |
if {[is_conf_enabled advversspec implicitdefault]} { |
| 75 |
lappend ans [list set __MODULES_LMALTNAME "$mall&load/default&load&as|load/latest"] |
| 76 |
} else { |
| 77 |
lappend ans [list set __MODULES_LMALTNAME "$mall&load/default&load"] |
| 78 |
} |
| 79 |
lappend ans [list set t23 t23] |
| 80 |
lappend ans [list set t24 t24] |
| 81 |
lappend ans [list set t25 t25] |
| 82 |
lappend ans [list set t26 t26] |
| 83 |
lappend ans [list set t27 t27] |
| 84 |
lappend ans [list set t10 t10] |
| 85 |
lappend ans [list set t28 t28] |
| 86 |
lappend ans [list set t11 t11] |
| 87 |
lappend ans [list set t30 t30] |
| 88 |
lappend ans [list set t29 t29] |
| 89 |
lappend ans [list set t12 t12] |
| 90 |
|
| 91 |
# |
| 92 |
# The load tests |
| 93 |
# |
| 94 |
test_cmd_re "ALL" "load $mall" $ans |
| 95 |
|
| 96 |
# |
| 97 |
# set-up a loaded environment |
| 98 |
# |
| 99 |
setenv_loaded_module [split $tmall ":"] [split $tpall ":"] $tmnuaall |
| 100 |
setenv_var __MODULES_LMPREREQ [join $tmpreall &] |
| 101 |
setenv_var __MODULES_LMALTNAME "$mall&load/default&load" |
| 102 |
|
| 103 |
|
| 104 |
# interpretation is done sequentially not cascaded when auto_handling is enabled (change result order) |
| 105 |
# also for this use case modulefiles are not unloaded in same order (based on loaded order for |
| 106 |
# auto_handling), which lead to different result if unloading modules compete over same variable to set |
| 107 |
if {$install_autohandling eq {y}} { |
| 108 |
set ans [list] |
| 109 |
lappend ans [list unset t13] |
| 110 |
lappend ans [list unset t14] |
| 111 |
lappend ans [list unset t15] |
| 112 |
lappend ans [list set LOADEDMODULES $tm00] |
| 113 |
lappend ans [list set _LMFILES_ $tp00] |
| 114 |
lappend ans [list unset t16] |
| 115 |
lappend ans [list unset __MODULES_LMTAG] |
| 116 |
lappend ans [list unset t17] |
| 117 |
lappend ans [list unset t18] |
| 118 |
lappend ans [list set mload t10] |
| 119 |
lappend ans [list unset t19] |
| 120 |
lappend ans [list unset t20] |
| 121 |
lappend ans [list unset __MODULES_LMPREREQ] |
| 122 |
lappend ans [list unset t21] |
| 123 |
lappend ans [list unset t22] |
| 124 |
lappend ans [list unset t23] |
| 125 |
lappend ans [list unset __MODULES_LMALTNAME] |
| 126 |
lappend ans [list unset t24] |
| 127 |
lappend ans [list unset t25] |
| 128 |
lappend ans [list unset t26] |
| 129 |
lappend ans [list unset t10] |
| 130 |
lappend ans [list unset t27] |
| 131 |
lappend ans [list unset t11] |
| 132 |
lappend ans [list unset t28] |
| 133 |
lappend ans [list unset t12] |
| 134 |
lappend ans [list unset t30] |
| 135 |
lappend ans [list unset t29] |
| 136 |
} else { |
| 137 |
set ans [list] |
| 138 |
lappend ans [list unset t13] |
| 139 |
lappend ans [list unset t14] |
| 140 |
lappend ans [list set LOADEDMODULES $tm00] |
| 141 |
lappend ans [list set _LMFILES_ $tp00] |
| 142 |
lappend ans [list unset t15] |
| 143 |
lappend ans [list unset __MODULES_LMTAG] |
| 144 |
lappend ans [list unset t16] |
| 145 |
lappend ans [list unset t17] |
| 146 |
lappend ans [list unset t18] |
| 147 |
lappend ans [list set mload t30] |
| 148 |
lappend ans [list unset __MODULES_LMPREREQ] |
| 149 |
lappend ans [list unset t20] |
| 150 |
lappend ans [list unset t19] |
| 151 |
lappend ans [list unset t21] |
| 152 |
lappend ans [list unset t22] |
| 153 |
lappend ans [list unset __MODULES_LMALTNAME] |
| 154 |
lappend ans [list unset t23] |
| 155 |
lappend ans [list unset t24] |
| 156 |
lappend ans [list unset t25] |
| 157 |
lappend ans [list unset t26] |
| 158 |
lappend ans [list unset t27] |
| 159 |
lappend ans [list unset t10] |
| 160 |
lappend ans [list unset t28] |
| 161 |
lappend ans [list unset t11] |
| 162 |
lappend ans [list unset t30] |
| 163 |
lappend ans [list unset t29] |
| 164 |
lappend ans [list unset t12] |
| 165 |
} |
| 166 |
|
| 167 |
# |
| 168 |
# The unload tests |
| 169 |
# |
| 170 |
test_cmd_re "ALL" "unload $mall" $ans |
| 171 |
|
| 172 |
# |
| 173 |
# Cleanup |
| 174 |
# |
| 175 |
|
| 176 |
reset_test_env |