| 1 |
############################################################################## |
| 2 |
# Modules Revision 3.0 |
| 3 |
# Providing a flexible user environment |
| 4 |
# |
| 5 |
# File: modules.70-maint/%M% |
| 6 |
# Revision: %I% |
| 7 |
# First Edition: 2019/09/05 |
| 8 |
# Last Mod.: %U%, %G% |
| 9 |
# |
| 10 |
# Authors: Xavier Delaruelle, [email protected] |
| 11 |
# |
| 12 |
# Description: Testuite testsequence |
| 13 |
# Command: |
| 14 |
# Modulefiles: |
| 15 |
# Sub-Command: |
| 16 |
# |
| 17 |
# Comment: %C{ |
| 18 |
# Test impact of the different icase mode level |
| 19 |
# }C% |
| 20 |
# |
| 21 |
############################################################################## |
| 22 |
|
| 23 |
if {$is_filesystem_icase} { |
| 24 |
send_user "\tskipping icase tests as underlying filesystem is case-insensitive\n" |
| 25 |
} else { |
| 26 |
|
| 27 |
# ensure avail/spider -t tests have implicit default enabled |
| 28 |
setenv_var MODULES_IMPLICIT_DEFAULT 1 |
| 29 |
|
| 30 |
# ensure regular search match is set for these tests |
| 31 |
setenv_var MODULES_SEARCH_MATCH starts_with |
| 32 |
|
| 33 |
# ensure tests are made using in depth mode |
| 34 |
setenv_var MODULES_AVAIL_INDEPTH 1 |
| 35 |
setenv_var MODULES_SPIDER_INDEPTH 1 |
| 36 |
|
| 37 |
# ensure last matching element is returned when unloading modules |
| 38 |
setenv_var MODULES_UNLOAD_MATCH_ORDER returnlast |
| 39 |
|
| 40 |
# ensure auto symbolic versions are not set for these tests |
| 41 |
setenv_var MODULES_ADVANCED_VERSION_SPEC 0 |
| 42 |
|
| 43 |
set mp $modpath.2 |
| 44 |
set mpre [regsub -all "\(\[.+?\]\)" $mp {\\\1}] |
| 45 |
|
| 46 |
# setup specific environment |
| 47 |
setenv_path_var MODULEPATH $mp |
| 48 |
|
| 49 |
|
| 50 |
# |
| 51 |
# check option enablement |
| 52 |
# |
| 53 |
|
| 54 |
set tserra0 {} |
| 55 |
set tserrw0 $err_path'NOCASE2' |
| 56 |
set tserra1 "$mp:\nnocase2" |
| 57 |
set tserrw1 "$modlin $mpre $modlin\n\\s+nocase2: nocase2" |
| 58 |
set ans0 ERR |
| 59 |
set tserrl0 $tserrw0 |
| 60 |
set ans1 [list] |
| 61 |
lappend ans1 [list set _LMFILES_ $mp/nocase2] |
| 62 |
lappend ans1 [list set LOADEDMODULES nocase2] |
| 63 |
set ansp0 {} |
| 64 |
set ansp1 [list [list text $mp/nocase2]] |
| 65 |
|
| 66 |
setenv_var MODULES_ICASE never |
| 67 |
testouterr_cmd sh {avail -t NOCASE2} OK $tserra0 |
| 68 |
testouterr_cmd sh {spider -t NOCASE2} OK $tserra0 |
| 69 |
testouterr_cmd sh {whatis NOCASE2} ERR $tserrw0 |
| 70 |
testouterr_cmd sh {paths NOCASE2} $ansp0 {} |
| 71 |
testouterr_cmd sh {load NOCASE2} $ans0 $tserrl0 |
| 72 |
|
| 73 |
setenv_var MODULES_ICASE search |
| 74 |
testouterr_cmd sh {avail -t NOCASE2} OK $tserra1 |
| 75 |
testouterr_cmd sh {spider -t NOCASE2} OK $tserra1 |
| 76 |
testouterr_cmd_re sh {whatis NOCASE2} OK $tserrw1 |
| 77 |
testouterr_cmd sh {paths NOCASE2} $ansp1 {} |
| 78 |
testouterr_cmd sh {load NOCASE2} $ans0 $tserrl0 |
| 79 |
|
| 80 |
setenv_var MODULES_ICASE always |
| 81 |
testouterr_cmd sh {avail -t NOCASE2} OK $tserra1 |
| 82 |
testouterr_cmd sh {spider -t NOCASE2} OK $tserra1 |
| 83 |
testouterr_cmd_re sh {whatis NOCASE2} OK $tserrw1 |
| 84 |
testouterr_cmd sh {paths NOCASE2} $ansp1 {} |
| 85 |
testouterr_cmd sh {load NOCASE2} $ans1 {} |
| 86 |
|
| 87 |
skip_if_quick_mode |
| 88 |
|
| 89 |
# default option value |
| 90 |
setenv_var MODULES_ICASE badvalue |
| 91 |
switch -- $install_icase { |
| 92 |
never { |
| 93 |
testouterr_cmd sh {avail -t NOCASE2} OK $tserra0 |
| 94 |
testouterr_cmd sh {spider -t NOCASE2} OK $tserra0 |
| 95 |
testouterr_cmd sh {whatis NOCASE2} ERR $tserrw0 |
| 96 |
testouterr_cmd sh {paths NOCASE2} $ansp0 {} |
| 97 |
testouterr_cmd sh {load NOCASE2} $ans0 $tserrl0 |
| 98 |
} |
| 99 |
search { |
| 100 |
testouterr_cmd sh {avail -t NOCASE2} OK $tserra1 |
| 101 |
testouterr_cmd sh {spider -t NOCASE2} OK $tserra1 |
| 102 |
testouterr_cmd_re sh {whatis NOCASE2} OK $tserrw1 |
| 103 |
testouterr_cmd sh {paths NOCASE2} $ansp1 {} |
| 104 |
testouterr_cmd sh {load NOCASE2} $ans0 $tserrl0 |
| 105 |
} |
| 106 |
always { |
| 107 |
testouterr_cmd sh {avail -t NOCASE2} OK $tserra1 |
| 108 |
testouterr_cmd sh {spider -t NOCASE2} OK $tserra1 |
| 109 |
testouterr_cmd_re sh {whatis NOCASE2} OK $tserrw1 |
| 110 |
testouterr_cmd sh {paths NOCASE2} $ansp1 {} |
| 111 |
testouterr_cmd sh {load NOCASE2} $ans1 {} |
| 112 |
} |
| 113 |
} |
| 114 |
unsetenv_var MODULES_ICASE |
| 115 |
switch -- $install_icase { |
| 116 |
never { |
| 117 |
testouterr_cmd sh {avail -t NOCASE2} OK $tserra0 |
| 118 |
testouterr_cmd sh {spider -t NOCASE2} OK $tserra0 |
| 119 |
testouterr_cmd sh {whatis NOCASE2} ERR $tserrw0 |
| 120 |
testouterr_cmd sh {paths NOCASE2} $ansp0 {} |
| 121 |
testouterr_cmd sh {load NOCASE2} $ans0 $tserrl0 |
| 122 |
} |
| 123 |
search { |
| 124 |
testouterr_cmd sh {avail -t NOCASE2} OK $tserra1 |
| 125 |
testouterr_cmd sh {spider -t NOCASE2} OK $tserra1 |
| 126 |
testouterr_cmd_re sh {whatis NOCASE2} OK $tserrw1 |
| 127 |
testouterr_cmd sh {paths NOCASE2} $ansp1 {} |
| 128 |
testouterr_cmd sh {load NOCASE2} $ans0 $tserrl0 |
| 129 |
} |
| 130 |
always { |
| 131 |
testouterr_cmd sh {avail -t NOCASE2} OK $tserra1 |
| 132 |
testouterr_cmd sh {spider -t NOCASE2} OK $tserra1 |
| 133 |
testouterr_cmd_re sh {whatis NOCASE2} OK $tserrw1 |
| 134 |
testouterr_cmd sh {paths NOCASE2} $ansp1 {} |
| 135 |
testouterr_cmd sh {load NOCASE2} $ans1 {} |
| 136 |
} |
| 137 |
} |
| 138 |
|
| 139 |
# option passed via command-line switch |
| 140 |
testouterr_cmd sh {avail --icase -t NOCASE2} OK $tserra1 |
| 141 |
testouterr_cmd sh {avail -i -t NOCASE2} OK $tserra1 |
| 142 |
testouterr_cmd sh {spider --icase -t NOCASE2} OK $tserra1 |
| 143 |
testouterr_cmd_re sh {whatis --icase NOCASE2} OK $tserrw1 |
| 144 |
testouterr_cmd sh {paths -i NOCASE2} $ansp1 {} |
| 145 |
testouterr_cmd sh {load --icase NOCASE2} $ans1 {} |
| 146 |
testouterr_cmd sh {load -i NOCASE2} $ans1 {} |
| 147 |
|
| 148 |
|
| 149 |
# disable icase by default to check when it is off and when it is on with -i |
| 150 |
setenv_var MODULES_ICASE never |
| 151 |
|
| 152 |
# |
| 153 |
# check consistent effect over the different module kind on search context |
| 154 |
# |
| 155 |
|
| 156 |
testouterr_cmd sh {avail -i -t noCASE/aL} OK "$mp:\nnocase/alias(@)" |
| 157 |
testouterr_cmd sh {spider -i -t noCASE/aL} OK "$mp:\nnocase/alias(@)" |
| 158 |
testouterr_cmd sh {avail -i -t noCASE/VE} OK "$mp:\nnocase/1(vers)" |
| 159 |
testouterr_cmd sh {avail -i -t NOCASE/REGular} OK "$mp:\nnocase/regular" |
| 160 |
testouterr_cmd sh {avail -i -t nOcAsE/vi} OK "$mp:\nnocase/virt" |
| 161 |
testouterr_cmd sh {avail -i -t NOCASE/Dee} OK "$mp:\nnocase/deep/(dirsym)\nnocase/deep/2\nnocase/deep/3" |
| 162 |
testouterr_cmd sh {avail -i -t NOcaSe2} OK "$mp:\nnocase2" |
| 163 |
testouterr_cmd sh {avail -i -t NOcase3} OK "$mp:\nnocase3(@)" |
| 164 |
testouterr_cmd_re sh {whatis -i -t noCASE/aL*} OK "$modlin $mpre $modlin\n\\s+nocase/1: nocase/1" |
| 165 |
testouterr_cmd sh {paths -i noCASE/VE*} [list [list text $mp/nocase/1]] {} |
| 166 |
testouterr_cmd sh {whatis -i -t noCASE/aL} ERR $err_path'noCASE/aL' |
| 167 |
testouterr_cmd sh {paths -i noCASE/VE} OK {} |
| 168 |
# aliases with an icase target |
| 169 |
testouterr_cmd_re sh {whatis -i nOcAsE5} OK "$modlin $mpre $modlin\n\\s+nocase/virt: nocase/virt" |
| 170 |
testouterr_cmd_re sh {whatis -i nOcAsE6} OK "$modlin $mpre $modlin\n\\s+nocase/virt: nocase/virt" |
| 171 |
# hidden modulefile |
| 172 |
testouterr_cmd sh {paths -i noCASE/.hiDden} [list [list text $mp/nocase/.hidden]] {} |
| 173 |
testouterr_cmd_re sh {whatis -i noCASE/.hiDden} OK "$modlin $mpre $modlin\n\\s+nocase/.hidden: nocase/.hidden" |
| 174 |
|
| 175 |
# add a bit of wildcard characters in specification |
| 176 |
testouterr_cmd sh {avail -i -t nOcAsE/vi?} OK "$mp:\nnocase/virt" |
| 177 |
testouterr_cmd_re sh {whatis -i -t noCASE/a*L*} OK "$modlin $mpre $modlin\n\\s+nocase/1: nocase/1" |
| 178 |
testouterr_cmd sh {whatis -i -t noCASE/a*L} ERR $err_path'noCASE/a*L' |
| 179 |
testouterr_cmd sh {paths -i noCASE/V*E?} OK {} |
| 180 |
testouterr_cmd sh {paths -i noCASE/V*E*} [list [list text $mp/nocase/1]] {} |
| 181 |
|
| 182 |
# wild search |
| 183 |
# FIXME: regvers symbol does not appear on nocase/regular module |
| 184 |
testouterr_cmd sh {avail -i -t NOcaSe} OK "$mp:\nnocase/1(vers)\nnocase/alias(@)\nnocase/deep/(dirsym)\nnocase/deep/2\nnocase/deep/3\nnocase/ialias(@)\nnocase/regular\nnocase/virt\nnocase2\nnocase3(@)\nnocase5(@)\nnocase6(@)\nnocase7/conflictim1\nnocase7/conflictim2\nnocase7/prereqim1\nnocase7/prereqim2\nnocase8(@)\nnocase9(@)" |
| 185 |
testouterr_cmd sh {spider -i -t NOcaSe} OK "$mp:\nnocase/1(vers)\nnocase/alias(@)\nnocase/deep/(dirsym)\nnocase/deep/2\nnocase/deep/3\nnocase/ialias(@)\nnocase/regular\nnocase/virt\nnocase2\nnocase3(@)\nnocase5(@)\nnocase6(@)\nnocase7/conflictim1\nnocase7/conflictim2\nnocase7/prereqim1\nnocase7/prereqim2\nnocase8(@)\nnocase9(@)" |
| 186 |
testouterr_cmd_re sh {whatis -i nOcAsE} OK "$modlin $mpre $modlin\n\\s+nocase/1: nocase/1\n\\s+nocase/deep/2: nocase/deep/2\n\\s+nocase/deep/3: nocase/deep/3\n\\s+nocase/regular: nocase/regular\n\\s+nocase/virt: nocase/virt" |
| 187 |
|
| 188 |
# contains search match |
| 189 |
testouterr_cmd sh {avail -i -t -C SE/DeE} OK "$mp:\nnocase/deep/(dirsym)\nnocase/deep/2\nnocase/deep/3" |
| 190 |
testouterr_cmd sh {spider -i -t -C SE/DeE} OK "$mp:\nnocase/deep/(dirsym)\nnocase/deep/2\nnocase/deep/3" |
| 191 |
testouterr_cmd sh {avail -i -t -C SE/DiR} OK "$mp:\nnocase/deep/(dirsym)\nnocase/deep/2\nnocase/deep/3" |
| 192 |
testouterr_cmd sh {avail -i -t -C se/VErs} OK "$mp:\nnocase/1(vers)" |
| 193 |
|
| 194 |
# no-indepth search |
| 195 |
testouterr_cmd sh {avail -i -t --no-indepth NOcaSe} OK "$mp:\nnocase/\nnocase2\nnocase3(@)\nnocase5(@)\nnocase6(@)\nnocase7/\nnocase8(@)\nnocase9(@)" |
| 196 |
testouterr_cmd sh {spider -i -t --no-indepth NOcaSe} OK "$mp:\nnocase/\nnocase2\nnocase3(@)\nnocase5(@)\nnocase6(@)\nnocase7/\nnocase8(@)\nnocase9(@)" |
| 197 |
testouterr_cmd sh {avail -i -t --no-indepth NOcaSe/} OK "$mp:\nnocase/1(vers)\nnocase/alias(@)\nnocase/deep/(dirsym)\nnocase/ialias(@)\nnocase/regular\nnocase/virt" |
| 198 |
testouterr_cmd sh {avail -i -t --no-indepth NOCASE/Dee} OK "$mp:\nnocase/deep/(dirsym)" |
| 199 |
testouterr_cmd sh {avail -i -t --no-indepth NOCASE/DiR} OK "$mp:\nnocase/deep/(dirsym)" |
| 200 |
|
| 201 |
|
| 202 |
# |
| 203 |
# check consistent effect over the different module kind on other contexts |
| 204 |
# |
| 205 |
|
| 206 |
set ans [list] |
| 207 |
lappend ans [list set __MODULES_LMALTNAME nocase/1&nocase/vers&al|nocase3&al|nocase/alias] |
| 208 |
lappend ans [list set _LMFILES_ $mp/nocase/1] |
| 209 |
lappend ans [list set LOADEDMODULES nocase/1] |
| 210 |
|
| 211 |
testouterr_cmd sh {load -i noCASE/aLias} $ans {} |
| 212 |
testouterr_cmd sh {load -i noCASE/VErs} $ans {} |
| 213 |
|
| 214 |
set ans [list] |
| 215 |
lappend ans [list set __MODULES_LMALTNAME nocase/regular&nocase/regvers&al|nocase3] |
| 216 |
lappend ans [list set _LMFILES_ $mp/nocase/regular] |
| 217 |
lappend ans [list set LOADEDMODULES nocase/regular] |
| 218 |
|
| 219 |
testouterr_cmd sh {load -i NOcaSE/regular} $ans {} |
| 220 |
|
| 221 |
# FIXME: indirect alternative names, expressed in a icase manner, are missing from alt names |
| 222 |
testouterr_cmd sh {load -i NoCaSE/regverS} $ans {} |
| 223 |
testouterr_cmd sh {load -i NoCaSE/regversVERS} $ans {} |
| 224 |
|
| 225 |
set ans [list] |
| 226 |
lappend ans [list set __MODULES_LMALTNAME nocase/deep/3&nocase/dirsym&al|nocase3] |
| 227 |
lappend ans [list set _LMFILES_ $mp/nocase/deep/3] |
| 228 |
lappend ans [list set LOADEDMODULES nocase/deep/3] |
| 229 |
|
| 230 |
testouterr_cmd sh {load -i NOCASE/DeeP} $ans {} |
| 231 |
|
| 232 |
set ans [list] |
| 233 |
lappend ans [list set __MODULES_LMALTNAME nocase/virt&al|nocase3&al|nocase/ialias] |
| 234 |
lappend ans [list set _LMFILES_ $mp/nocase/1] |
| 235 |
lappend ans [list set LOADEDMODULES nocase/virt] |
| 236 |
|
| 237 |
testouterr_cmd sh {load -i Nocase/viRT} $ans {} |
| 238 |
testouterr_cmd sh {load -i NoCaSE} $ans {} |
| 239 |
testouterr_cmd sh {load -i Nocase3} $ans {} |
| 240 |
# FIXME: indirect alternative names, expressed in a icase manner, are missing from alt names |
| 241 |
testouterr_cmd sh {load -i nocase5} $ans {} |
| 242 |
testouterr_cmd sh {load -i NOcaSE6} $ans {} |
| 243 |
|
| 244 |
set ans [list] |
| 245 |
lappend ans [list set _LMFILES_ $mp/nocase2] |
| 246 |
lappend ans [list set LOADEDMODULES nocase2] |
| 247 |
|
| 248 |
testouterr_cmd sh {load -i NocasE2} $ans {} |
| 249 |
|
| 250 |
testouterr_cmd_re sh {help -i NocasE3} OK "$modlin\nModule Specific Help for $mpre/nocase/1:\n\n$warn_msgs: Unable to find ModulesHelp in $mpre/nocase/1.\n$modlin" |
| 251 |
testouterr_cmd_re sh {display -i nocASE/aliAS} OK "$modlin\n$mpre/nocase/1:\n\nmodule-whatis\tnocase/1\n$modlin" |
| 252 |
testouterr_cmd_re sh {test -i NOCAse/1} OK "$modlin\nModule Specific Test for $mpre/nocase/1:\n\n$warn_msgs: Unable to find ModulesTest in $mpre/nocase/1.\n$modlin" |
| 253 |
testouterr_cmd sh {path -i NOCAse/vIRt} [list [list text $mp/nocase/1]] {} |
| 254 |
testouterr_cmd sh {path -i NOCAse6} [list [list text $mp/nocase/1]] {} |
| 255 |
testouterr_cmd sh {is-avail -i NOCAse/veRS} OK {} |
| 256 |
testouterr_cmd sh {is-avail -i NOCAse/veR} ERR {} |
| 257 |
testouterr_cmd sh {is-avail -i NOCAse6} OK {} |
| 258 |
|
| 259 |
|
| 260 |
# test sub-commands working over the loaded environment |
| 261 |
setenv_loaded_module [list nocase/1] [list $mp/nocase/1] |
| 262 |
setenv_var __MODULES_LMALTNAME nocase/1&nocase/vers&al|nocase3&al|nocase/alias |
| 263 |
|
| 264 |
testouterr_cmd sh {is-loaded -i Nocase/1} OK {} |
| 265 |
testouterr_cmd sh {is-loaded -i nOcaSE/veRS} OK {} |
| 266 |
testouterr_cmd sh {is-loaded -i NOcase/ALias} OK {} |
| 267 |
|
| 268 |
set ans [list [list text nocase/1]] |
| 269 |
testouterr_cmd sh {info-loaded -i Nocase} $ans {} |
| 270 |
testouterr_cmd sh {info-loaded -i nOcaSE/veRS} $ans {} |
| 271 |
testouterr_cmd sh {info-loaded -i NOcase/ALias} $ans {} |
| 272 |
|
| 273 |
testouterr_cmd sh {load -i NOcase/1} OK {} |
| 274 |
testouterr_cmd sh {load -i NOcaSE/veRS} OK {} |
| 275 |
testouterr_cmd sh {load -i NOcaSE/ALias} OK {} |
| 276 |
|
| 277 |
set ans [list] |
| 278 |
lappend ans [list unset __MODULES_LMALTNAME] |
| 279 |
lappend ans [list unset _LMFILES_] |
| 280 |
lappend ans [list unset LOADEDMODULES] |
| 281 |
testouterr_cmd sh {unload -i NOcaSE/1} $ans {} |
| 282 |
testouterr_cmd sh {unload -i nocASE} $ans {} |
| 283 |
testouterr_cmd sh {unload -i noCase/aLIAS} $ans {} |
| 284 |
|
| 285 |
set ans [list] |
| 286 |
lappend ans [list set __MODULES_LMALTNAME nocase/virt&al|nocase3&al|nocase/ialias] |
| 287 |
lappend ans [list set _LMFILES_ $mp/nocase/1] |
| 288 |
lappend ans [list set LOADEDMODULES nocase/virt] |
| 289 |
testouterr_cmd sh {switch -i NOcaSE} $ans {} |
| 290 |
testouterr_cmd sh {switch -i NOCASE nocase/viRT} $ans {} |
| 291 |
testouterr_cmd sh {switch -i noCAse/ViRt} $ans {} |
| 292 |
testouterr_cmd sh {switch -i noCASE3} $ans {} |
| 293 |
|
| 294 |
unsetenv_loaded_module |
| 295 |
unsetenv_var __MODULES_LMALTNAME |
| 296 |
|
| 297 |
# test in modulefile |
| 298 |
set ans [list] |
| 299 |
lappend ans [list set __MODULES_LMALTNAME nocase/1&nocase/vers&al|nocase3&al|nocase/alias] |
| 300 |
lappend ans [list set __MODULES_LMPREREQ icase/prereq&NoCase/VERS] |
| 301 |
lappend ans [list set _LMFILES_ $mp/nocase/1:$mp/icase/prereq] |
| 302 |
lappend ans [list set LOADEDMODULES nocase/1:icase/prereq] |
| 303 |
lappend ans [list set __MODULES_LMTAG nocase/1&auto-loaded] |
| 304 |
testouterr_cmd_re sh {load --icase --auto icase/prereq} $ans [msg_top_load icase/prereq {} nocase/1 {}] |
| 305 |
|
| 306 |
set ans [list] |
| 307 |
lappend ans [list set __MODULES_LMCONFLICT icase/conflict&NOCASE] |
| 308 |
lappend ans [list set _LMFILES_ $mp/icase/conflict] |
| 309 |
lappend ans [list set LOADEDMODULES icase/conflict] |
| 310 |
testouterr_cmd_re sh {load --icase icase/conflict} $ans {} |
| 311 |
|
| 312 |
set ans [list] |
| 313 |
lappend ans [list set __MODULES_LMALTNAME nocase/1&nocase/vers&al|nocase3&al|nocase/alias] |
| 314 |
lappend ans [list set __MODULES_LMPREREQ icase/load&noCASE/alIAS] |
| 315 |
lappend ans [list set _LMFILES_ $mp/nocase/1:$mp/icase/load] |
| 316 |
lappend ans [list set LOADEDMODULES nocase/1:icase/load] |
| 317 |
lappend ans [list set __MODULES_LMTAG nocase/1&auto-loaded] |
| 318 |
testouterr_cmd_re sh {load --icase --auto icase/load} $ans [msg_top_load icase/load {} nocase/1 {}] |
| 319 |
|
| 320 |
set ans [list] |
| 321 |
lappend ans [list set __MODULES_LMCONFLICT icase/unload&NOcase] |
| 322 |
lappend ans [list set _LMFILES_ $mp/icase/unload] |
| 323 |
lappend ans [list set LOADEDMODULES icase/unload] |
| 324 |
testouterr_cmd_re sh {load --icase icase/unload} $ans {} |
| 325 |
|
| 326 |
set tserr [msg_load icase/loadi [msg_moderr {Invalid option '--icase'} {module load --icase noCASE/1} $mp/icase/loadi 2]] |
| 327 |
testouterr_cmd sh {load --icase --auto icase/loadi} ERR $tserr |
| 328 |
testouterr_cmd sh {load --auto icase/loadi} ERR $tserr |
| 329 |
|
| 330 |
set ans [list] |
| 331 |
lappend ans [list set _LMFILES_ $mp/icase/isloaded] |
| 332 |
lappend ans [list set LOADEDMODULES icase/isloaded] |
| 333 |
lappend ans [list set ts 0] |
| 334 |
testouterr_cmd_re sh {load --icase icase/isloaded} $ans {} |
| 335 |
|
| 336 |
set ans [list] |
| 337 |
lappend ans [list set ts2 nocase] |
| 338 |
lappend ans [list set _LMFILES_ $mp/icase/info] |
| 339 |
lappend ans [list set LOADEDMODULES icase/info] |
| 340 |
lappend ans [list set ts3 nocase] |
| 341 |
lappend ans [list set ts {}] |
| 342 |
testouterr_cmd_re sh {load --icase icase/info} $ans {} |
| 343 |
|
| 344 |
setenv_loaded_module [list nocase/1] [list $mp/nocase/1] |
| 345 |
setenv_var __MODULES_LMALTNAME nocase/1&nocase/vers&al|nocase3&al|nocase/alias |
| 346 |
|
| 347 |
set ans [list] |
| 348 |
lappend ans [list set __MODULES_LMPREREQ icase/prereq&NoCase/VERS] |
| 349 |
lappend ans [list set _LMFILES_ $mp/nocase/1:$mp/icase/prereq] |
| 350 |
lappend ans [list set LOADEDMODULES nocase/1:icase/prereq] |
| 351 |
testouterr_cmd_re sh {load --icase --auto icase/prereq} $ans {} |
| 352 |
|
| 353 |
if {[is_conf_enabled autohandling conflictunload]} { |
| 354 |
set ans [list] |
| 355 |
lappend ans [list set __MODULES_LMCONFLICT icase/conflict&NOCASE] |
| 356 |
lappend ans [list unset __MODULES_LMALTNAME] |
| 357 |
lappend ans [list set _LMFILES_ $mp/icase/conflict] |
| 358 |
lappend ans [list set LOADEDMODULES icase/conflict] |
| 359 |
set tserr [msg_top_load icase/conflict nocase/1 {} {}] |
| 360 |
} else { |
| 361 |
set ans ERR |
| 362 |
set tserr [msg_load icase/conflict [err_conflict nocase/1]] |
| 363 |
} |
| 364 |
testouterr_cmd_re sh {load --icase icase/conflict} $ans $tserr |
| 365 |
|
| 366 |
set ans [list] |
| 367 |
lappend ans [list set __MODULES_LMPREREQ icase/load&noCASE/alIAS] |
| 368 |
lappend ans [list set _LMFILES_ $mp/nocase/1:$mp/icase/load] |
| 369 |
lappend ans [list set LOADEDMODULES nocase/1:icase/load] |
| 370 |
testouterr_cmd_re sh {load --icase --auto icase/load} $ans {} |
| 371 |
|
| 372 |
set ans [list] |
| 373 |
lappend ans [list set __MODULES_LMCONFLICT icase/unload&NOcase] |
| 374 |
lappend ans [list unset __MODULES_LMALTNAME] |
| 375 |
lappend ans [list set _LMFILES_ $mp/icase/unload] |
| 376 |
lappend ans [list set LOADEDMODULES icase/unload] |
| 377 |
testouterr_cmd_re sh {load --icase icase/unload} $ans [msg_top_load icase/unload nocase/1 {} {}] |
| 378 |
|
| 379 |
set ans [list] |
| 380 |
lappend ans [list set _LMFILES_ $mp/nocase/1:$mp/icase/isloaded] |
| 381 |
lappend ans [list set LOADEDMODULES nocase/1:icase/isloaded] |
| 382 |
lappend ans [list set ts 1] |
| 383 |
testouterr_cmd_re sh {load --icase icase/isloaded} $ans {} |
| 384 |
|
| 385 |
set ans [list] |
| 386 |
lappend ans [list set ts2 nocase] |
| 387 |
lappend ans [list set _LMFILES_ $mp/nocase/1:$mp/icase/info] |
| 388 |
lappend ans [list set LOADEDMODULES nocase/1:icase/info] |
| 389 |
lappend ans [list set ts3 nocase] |
| 390 |
lappend ans [list set ts nocase/1] |
| 391 |
testouterr_cmd_re sh {load --icase icase/info} $ans {} |
| 392 |
|
| 393 |
unsetenv_loaded_module |
| 394 |
unsetenv_var __MODULES_LMALTNAME |
| 395 |
|
| 396 |
# self conflict |
| 397 |
set ans [list] |
| 398 |
lappend ans [list set __MODULES_LMCONFLICT icase/conflicts&Icase] |
| 399 |
lappend ans [list set _LMFILES_ $mp/icase/conflicts] |
| 400 |
lappend ans [list set LOADEDMODULES icase/conflicts] |
| 401 |
testouterr_cmd_re sh {load --icase icase/conflicts} $ans {} |
| 402 |
|
| 403 |
setenv_loaded_module [list icase/isloaded] [list $mp/icase/isloaded] |
| 404 |
if {[is_conf_enabled autohandling conflictunload]} { |
| 405 |
set ans [list] |
| 406 |
lappend ans [list set __MODULES_LMCONFLICT icase/conflicts&Icase] |
| 407 |
lappend ans [list set _LMFILES_ $mp/icase/conflicts] |
| 408 |
lappend ans [list set LOADEDMODULES icase/conflicts] |
| 409 |
lappend ans [list unset ts] |
| 410 |
set tserr [msg_top_load icase/conflicts icase/isloaded {} {}] |
| 411 |
} else { |
| 412 |
set ans ERR |
| 413 |
set tserr [msg_load icase/conflicts [err_conflict icase/isloaded]] |
| 414 |
} |
| 415 |
testouterr_cmd_re sh {load --icase icase/conflicts} $ans $tserr |
| 416 |
unsetenv_loaded_module |
| 417 |
|
| 418 |
# conflict over an alias name |
| 419 |
setenv_loaded_module [list nocase/1] [list $mp/nocase/1] |
| 420 |
setenv_var __MODULES_LMALTNAME nocase/1&nocase/vers&al|nocase3&al|nocase/alias |
| 421 |
if {[is_conf_enabled autohandling conflictunload]} { |
| 422 |
set ans [list] |
| 423 |
lappend ans [list set __MODULES_LMCONFLICT icase/conflicta&NOcase3] |
| 424 |
lappend ans [list unset __MODULES_LMALTNAME] |
| 425 |
lappend ans [list set _LMFILES_ $mp/icase/conflicta] |
| 426 |
lappend ans [list set LOADEDMODULES icase/conflicta] |
| 427 |
set tserr [msg_top_load icase/conflicta nocase/1 {} {}] |
| 428 |
} else { |
| 429 |
set ans ERR |
| 430 |
set tserr [msg_load icase/conflicta [err_conflict nocase/1]] |
| 431 |
} |
| 432 |
testouterr_cmd_re sh {load --icase icase/conflicta} $ans $tserr |
| 433 |
unsetenv_loaded_module |
| 434 |
unsetenv_var __MODULES_LMALTNAME |
| 435 |
|
| 436 |
# loaded module conflict with loading prereq |
| 437 |
setenv_loaded_module [list icase/conflicta] [list $mp/icase/conflicta] |
| 438 |
setenv_var __MODULES_LMCONFLICT icase/conflicta&NOcase3 |
| 439 |
if {[is_conf_enabled conflictunload]} { |
| 440 |
set ans [list] |
| 441 |
lappend ans [list set __MODULES_LMALTNAME nocase/1&nocase/vers&al|nocase3&al|nocase/alias] |
| 442 |
lappend ans [list unset __MODULES_LMCONFLICT] |
| 443 |
lappend ans [list set __MODULES_LMPREREQ icase/load&noCASE/alIAS] |
| 444 |
lappend ans [list set _LMFILES_ $mp/nocase/1:$mp/icase/load] |
| 445 |
lappend ans [list set LOADEDMODULES nocase/1:icase/load] |
| 446 |
lappend ans [list set __MODULES_LMTAG nocase/1&auto-loaded] |
| 447 |
set tserr [msg_top_load icase/load icase/conflicta nocase/1 {}] |
| 448 |
} else { |
| 449 |
set ans ERR |
| 450 |
set tserr [msg_load nocase/1 [err_conflict icase/conflicta]]\n\n[msg_load icase/load [err_reqlo noCASE/alIAS]] |
| 451 |
} |
| 452 |
testouterr_cmd_re sh {load --icase --auto icase/load} $ans $tserr |
| 453 |
unsetenv_loaded_module |
| 454 |
unsetenv_var __MODULES_LMCONFLICT |
| 455 |
|
| 456 |
# loading prereq conflict with its dependent |
| 457 |
testouterr_cmd_re sh {load --icase --auto icase/prereqc} ERR [msg_load icase/conflictp [err_conloi icase/prereqc]]\n\n[msg_load icase/prereqc [err_reqlo icASE/conflictP]] |
| 458 |
|
| 459 |
|
| 460 |
# |
| 461 |
# check situation with multiple modulefiles corresponding to same icase module |
| 462 |
# |
| 463 |
|
| 464 |
# when loading, multiple matches if icase enabled, no match if disabled |
| 465 |
set ans [list] |
| 466 |
lappend ans [list set _LMFILES_ $mp/icase/z] |
| 467 |
lappend ans [list set LOADEDMODULES icase/z] |
| 468 |
testouterr_cmd_re sh {load --icase ICaSE} $ans {} |
| 469 |
testouterr_cmd_re sh {load ICaSE} ERR $err_path'ICaSE' |
| 470 |
|
| 471 |
# when loading, multiple matches if icase enabled, one match if disabled |
| 472 |
set ans [list] |
| 473 |
lappend ans [list set _LMFILES_ $mp/iCaSe/1] |
| 474 |
lappend ans [list set LOADEDMODULES iCaSe/1] |
| 475 |
testouterr_cmd_re sh {load --icase iCaSe} $ans {} |
| 476 |
testouterr_cmd_re sh {load iCaSe} $ans {} |
| 477 |
|
| 478 |
# when auto loading prereq, multiple matches if icase enabled, no match if disabled |
| 479 |
set ans [list] |
| 480 |
lappend ans [list set __MODULES_LMPREREQ nocase7/prereqim1&ICase] |
| 481 |
lappend ans [list set _LMFILES_ $mp/icase/z:$mp/nocase7/prereqim1] |
| 482 |
lappend ans [list set LOADEDMODULES icase/z:nocase7/prereqim1] |
| 483 |
lappend ans [list set __MODULES_LMTAG icase/z&auto-loaded] |
| 484 |
testouterr_cmd_re sh {load --auto --icase nocase7/prereqim1} $ans [msg_top_load nocase7/prereqim1 {} icase/z {}] |
| 485 |
testouterr_cmd_re sh {load --auto nocase7/prereqim1} ERR [msg_load nocase7/prereqim1 $err_path'ICase' [err_reqlo ICase]] |
| 486 |
|
| 487 |
# when auto loading prereq, multiple matches if icase enabled, one match if disabled |
| 488 |
set ans [list] |
| 489 |
lappend ans [list set __MODULES_LMPREREQ nocase7/prereqim2&iCaSe] |
| 490 |
lappend ans [list set _LMFILES_ $mp/iCaSe/1:$mp/nocase7/prereqim2] |
| 491 |
lappend ans [list set LOADEDMODULES iCaSe/1:nocase7/prereqim2] |
| 492 |
lappend ans [list set __MODULES_LMTAG iCaSe/1&auto-loaded] |
| 493 |
testouterr_cmd_re sh {load --auto --icase nocase7/prereqim2} $ans [msg_top_load nocase7/prereqim2 {} iCaSe/1 {}] |
| 494 |
testouterr_cmd_re sh {load --auto nocase7/prereqim2} $ans [msg_top_load nocase7/prereqim2 {} iCaSe/1 {}] |
| 495 |
|
| 496 |
setenv_loaded_module [list icase/z ICASE/1 iCaSe/1] [list $mp/icase/z $mp/ICASE/1 $mp/iCaSe/1] |
| 497 |
# when unloading, multiple matches if icase enabled, no match if disabled |
| 498 |
set ans [list] |
| 499 |
lappend ans [list set _LMFILES_ $mp/icase/z:$mp/ICASE/1] |
| 500 |
lappend ans [list set LOADEDMODULES icase/z:ICASE/1] |
| 501 |
testouterr_cmd_re sh {unload --icase ICaSE} $ans {} |
| 502 |
testouterr_cmd_re sh {unload ICaSE} OK {} |
| 503 |
# when unloading, multiple matches if icase enabled, one match if disabled |
| 504 |
# CORNER CASE: lastly matching module will be returned even if an exact match is there |
| 505 |
testouterr_cmd_re sh {unload --icase ICASE} $ans {} |
| 506 |
set ans [list] |
| 507 |
lappend ans [list set _LMFILES_ $mp/icase/z:$mp/iCaSe/1] |
| 508 |
lappend ans [list set LOADEDMODULES icase/z:iCaSe/1] |
| 509 |
testouterr_cmd_re sh {unload ICASE} $ans {} |
| 510 |
|
| 511 |
# when checking conflict, multiple matches if icase enabled, no match if disabled |
| 512 |
set ans [list] |
| 513 |
lappend ans [list set __MODULES_LMCONFLICT nocase7/conflictim1&ICase] |
| 514 |
lappend ans [list set _LMFILES_ $mp/icase/z:$mp/ICASE/1:$mp/iCaSe/1:$mp/nocase7/conflictim1] |
| 515 |
lappend ans [list set LOADEDMODULES icase/z:ICASE/1:iCaSe/1:nocase7/conflictim1] |
| 516 |
testouterr_cmd_re sh {load nocase7/conflictim1} $ans {} |
| 517 |
if {[is_conf_enabled autohandling conflictunload]} { |
| 518 |
set ans [list] |
| 519 |
lappend ans [list set __MODULES_LMCONFLICT nocase7/conflictim1&ICase] |
| 520 |
lappend ans [list set _LMFILES_ $mp/nocase7/conflictim1] |
| 521 |
lappend ans [list set LOADEDMODULES nocase7/conflictim1] |
| 522 |
set tserr [msg_top_load nocase7/conflictim1 {iCaSe/1 ICASE/1 icase/z} {} {}] |
| 523 |
} else { |
| 524 |
set ans ERR |
| 525 |
set tserr [msg_load nocase7/conflictim1 [err_conflict icase/z ICASE/1 iCaSe/1]] |
| 526 |
} |
| 527 |
testouterr_cmd_re sh {load --icase nocase7/conflictim1} $ans $tserr |
| 528 |
|
| 529 |
# when checking conflict, multiple matches if icase enabled, one match if disabled |
| 530 |
if {[is_conf_enabled autohandling conflictunload]} { |
| 531 |
set ans [list] |
| 532 |
lappend ans [list set __MODULES_LMCONFLICT nocase7/conflictim2&iCaSe] |
| 533 |
lappend ans [list set _LMFILES_ $mp/icase/z:$mp/ICASE/1:$mp/nocase7/conflictim2] |
| 534 |
lappend ans [list set LOADEDMODULES icase/z:ICASE/1:nocase7/conflictim2] |
| 535 |
set tserr [msg_top_load nocase7/conflictim2 {iCaSe/1} {} {}] |
| 536 |
} else { |
| 537 |
set ans ERR |
| 538 |
set tserr [msg_load nocase7/conflictim2 [err_conflict iCaSe/1]] |
| 539 |
} |
| 540 |
testouterr_cmd_re sh {load nocase7/conflictim2} $ans $tserr |
| 541 |
if {[is_conf_enabled autohandling conflictunload]} { |
| 542 |
set ans [list] |
| 543 |
lappend ans [list set __MODULES_LMCONFLICT nocase7/conflictim2&iCaSe] |
| 544 |
lappend ans [list set _LMFILES_ $mp/nocase7/conflictim2] |
| 545 |
lappend ans [list set LOADEDMODULES nocase7/conflictim2] |
| 546 |
set tserr [msg_top_load nocase7/conflictim2 {iCaSe/1 ICASE/1 icase/z} {} {}] |
| 547 |
} else { |
| 548 |
set ans ERR |
| 549 |
set tserr [msg_load nocase7/conflictim2 [err_conflict icase/z ICASE/1 iCaSe/1]] |
| 550 |
} |
| 551 |
testouterr_cmd_re sh {load --icase nocase7/conflictim2} $ans $tserr |
| 552 |
|
| 553 |
unsetenv_loaded_module |
| 554 |
|
| 555 |
# module to load is an alias which resolves to multiple matches if icase enabled, no match if disabled |
| 556 |
set ans [list] |
| 557 |
# FIXME: nocase8 does not appear among module altname, overridden by nocase9 |
| 558 |
lappend ans [list set __MODULES_LMALTNAME iCaSe2/1&al|nocase9] |
| 559 |
lappend ans [list set _LMFILES_ $mp/iCaSe2/1] |
| 560 |
lappend ans [list set LOADEDMODULES iCaSe2/1] |
| 561 |
testouterr_cmd_re sh {load --icase nocase8} $ans {} |
| 562 |
testouterr_cmd_re sh {load nocase8} ERR $err_path'ICaSE2' |
| 563 |
# module to load is an alias which resolves to multiple matches if icase enabled, one match if disabled |
| 564 |
set ans [list] |
| 565 |
lappend ans [list set __MODULES_LMALTNAME iCaSe2/1&al|nocase9] |
| 566 |
lappend ans [list set _LMFILES_ $mp/iCaSe2/1] |
| 567 |
lappend ans [list set LOADEDMODULES iCaSe2/1] |
| 568 |
testouterr_cmd_re sh {load --icase nocase9} $ans {} |
| 569 |
testouterr_cmd_re sh {load nocase9} $ans {} |
| 570 |
|
| 571 |
|
| 572 |
# |
| 573 |
# icase only affects module specification |
| 574 |
# |
| 575 |
|
| 576 |
testouterr_cmd sh "is-used --icase [string toupper $mp]" ERR {} |
| 577 |
|
| 578 |
setenv_var HOME $env(HOME)/home |
| 579 |
testouterr_cmd sh "restore --icase COLL1" ERR [err_coll_notfound COLL1] |
| 580 |
setenv_var HOME $ORIG_HOME |
| 581 |
|
| 582 |
# icase always apply to search query string |
| 583 |
# other evaluated modulefiles lead to an error result on stdout |
| 584 |
testouterr_cmd_re sh {search NOCASE2} ERR "\n$tserrw1" |
| 585 |
|
| 586 |
|
| 587 |
# |
| 588 |
# test access issues |
| 589 |
# |
| 590 |
|
| 591 |
# cannot test access if cannot change file permission |
| 592 |
if {!$is_file_perms_editable} { |
| 593 |
send_user "\tskipping access tests as file permissions cannot be changed\n" |
| 594 |
# cannot test access if superuser privileges are in use |
| 595 |
} elseif {$tcl_platform(user) eq "root"} { |
| 596 |
send_user "\tskipping access tests as tests are run by superuser\n" |
| 597 |
# cannot test access if restricted file permissions have no effect |
| 598 |
} elseif {$is_locked_dir_file_readable && $is_locked_file_readable} { |
| 599 |
send_user "\tskipping access tests as locked files or directories are still readable\n" |
| 600 |
} else { |
| 601 |
|
| 602 |
# ignore prebuilt cache file as access to some modules are restricted here |
| 603 |
ignore_modulecache_if_built |
| 604 |
|
| 605 |
set hide_perms "ugo-rx" |
| 606 |
|
| 607 |
change_file_perms $mp/extdfl2/2.rc.1 $hide_perms |
| 608 |
testouterr_cmd sh {whatis -i extdfl2/vIcase} ERR "$error_msgs: Permission denied on '$mp/extdfl2/2.rc.1'" |
| 609 |
restore_file_perms $mp/extdfl2/2.rc.1 |
| 610 |
|
| 611 |
unset hide_perms |
| 612 |
|
| 613 |
end_ignore_modulecache_if_built |
| 614 |
|
| 615 |
} |
| 616 |
|
| 617 |
|
| 618 |
# |
| 619 |
# test modulepath and module names containing space |
| 620 |
# |
| 621 |
|
| 622 |
set mp "$modpath wspace" |
| 623 |
if {!$is_symlink_supported} { |
| 624 |
send_user "\tskipping tests over '$mp' modulepath as symbolic links are not supported on filesystem\n" |
| 625 |
} else { |
| 626 |
|
| 627 |
setenv_var MODULEPATH $mp |
| 628 |
|
| 629 |
testouterr_cmd sh {avail -i -t sPace\ Yd/3.0} OK "$mp:\n'space yd/3.0'" |
| 630 |
testouterr_cmd sh {spider -i -t sPace\ Yd/3.0} OK "$mp:\n'space yd/3.0'" |
| 631 |
set ans [list] |
| 632 |
lappend ans [list set _LMFILES_ "$mp/space yd/3.0"] |
| 633 |
lappend ans [list set LOADEDMODULES "space yd/3.0"] |
| 634 |
testouterr_cmd sh {load -i spAce\ yD/3.0} $ans {} |
| 635 |
|
| 636 |
} |
| 637 |
|
| 638 |
|
| 639 |
# |
| 640 |
# Cleanup |
| 641 |
# |
| 642 |
|
| 643 |
reset_test_env |
| 644 |
|
| 645 |
} |