Debian Codegraph @

testsuite/modules.50-cmds/713-require_via-swap.exp

raw
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: 2025/05/31
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Xavier Delaruelle, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command: load, switch
14 # Modulefiles: moda, modb, modc, othervia, othervib, othervic
15 # Sub-Command:
16 #
17 # Comment: %C{
18 # Test require_via mechanism with switch mechanism
19 # }C%
20 #
21 ##############################################################################
22
23 setenv_var TESTSUITE_SPIDER_MODPATH1 use_modpath2
24 setenv_var TESTSUITE_SPIDER_MODPATH2 use_modpath3
25
26 #
27 # replace via module with alternative via module
28 # modulepath still enabled
29 #
30
31 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 use_modpath2_and_conflict_moda
32 setenv_var TESTSUITE_REQUIRE_VIA multi_mod_in_path_with_req1
33
34 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1
35 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
36 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
37 setenv_loaded_module [list moda/1 modb/1 othervib/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
38
39 # replace with module load
40
41 setenv_var MODULES_REQUIRE_VIA 0
42 setenv_var MODULES_CONFLICT_UNLOAD 0
43
44 set tserr [msg_load othervia/1 [err_conflict moda/1]]
45 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
46 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
47
48 setenv_var MODULES_CONFLICT_UNLOAD 1
49
50 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
51
52 set ans [list]
53 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.spider2]
54 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
55 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
56 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
57 lappend ans [list set MODULEPATH $modpath.spider2:$modpath.spider3:$modpath.spider1]
58 set tserr [msg_top_load othervia/1 moda/1 {} {}]
59 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
60
61 setenv_var MODULES_REQUIRE_VIA 1
62 setenv_var MODULES_CONFLICT_UNLOAD 0
63
64 set tserr [msg_load othervia/1 [err_conflict moda/1]]
65 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
66 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
67
68 setenv_var MODULES_CONFLICT_UNLOAD 1
69
70 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
71
72 set ans [list]
73 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.spider2:modb/1&$modpath.spider3]
74 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
75 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
76 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
77 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
78 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1]
79 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
80 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
81
82
83 # replace with module switch
84
85 setenv_var MODULES_REQUIRE_VIA 0
86 setenv_var MODULES_CONFLICT_UNLOAD 0
87
88 set ans [list]
89 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.spider2]
90 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
91 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
92 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
93 lappend ans [list set MODULEPATH $modpath.spider2:$modpath.spider3:$modpath.spider1]
94 set tserr [msg_load othervia/1 [err_conflict moda/1]]
95 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
96 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
97
98 setenv_var MODULES_CONFLICT_UNLOAD 1
99
100 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
101 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
102
103 setenv_var MODULES_REQUIRE_VIA 1
104 setenv_var MODULES_CONFLICT_UNLOAD 0
105
106 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
107 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
108
109 set ans [list]
110 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.spider2:modb/1&$modpath.spider3]
111 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
112 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
113 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
114 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
115 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1]
116 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
117 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
118
119 setenv_var MODULES_CONFLICT_UNLOAD 1
120
121 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
122 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
123
124 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
125 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
126
127 skip_if_quick_mode
128
129
130 #
131 # replace via module with not an alternative via module
132 # modulepath still enabled
133 #
134
135 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 conflict_moda
136 setenv_var TESTSUITE_REQUIRE_VIA multi_mod_in_path_with_req1
137
138 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1
139 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
140 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
141 setenv_loaded_module [list moda/1 modb/1 othervib/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
142
143 # replace with module load
144
145 setenv_var MODULES_REQUIRE_VIA 0
146 setenv_var MODULES_CONFLICT_UNLOAD 0
147
148 set tserr [msg_load othervia/1 [err_conflict moda/1]]
149 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
150 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
151
152 setenv_var MODULES_CONFLICT_UNLOAD 1
153
154 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
155
156 set ans [list]
157 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3]
158 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
159 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
160 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
161 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.spider1]
162 set tserr [msg_top_load othervia/1 moda/1 {} {}]
163 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
164
165 setenv_var MODULES_REQUIRE_VIA 1
166 setenv_var MODULES_CONFLICT_UNLOAD 0
167
168 set tserr [msg_load othervia/1 [err_conflict moda/1]]
169 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
170 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
171
172 setenv_var MODULES_CONFLICT_UNLOAD 1
173
174 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
175
176 set ans [list]
177 lappend ans [list unset __MODULES_LMUSE]
178 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
179 lappend ans [list unset __MODULES_LMPREREQ]
180 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1]
181 lappend ans [list set LOADEDMODULES othervia/1]
182 lappend ans [list set MODULEPATH $modpath.spider1]
183 set tserr [msg_top_load_conun othervia/1 {othervic/1 modc/1 othervib/1 modb/1} moda/1 {} {} {}]
184 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
185
186
187 # replace with module switch
188
189 setenv_var MODULES_REQUIRE_VIA 0
190 setenv_var MODULES_CONFLICT_UNLOAD 0
191
192 set ans [list]
193 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3]
194 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
195 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
196 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
197 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.spider1]
198 set tserr [msg_load othervia/1 [err_conflict moda/1]]
199 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
200 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
201
202 setenv_var MODULES_CONFLICT_UNLOAD 1
203
204 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
205 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
206
207 setenv_var MODULES_REQUIRE_VIA 1
208 setenv_var MODULES_CONFLICT_UNLOAD 0
209
210 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
211 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
212
213 set ans [list]
214 lappend ans [list unset __MODULES_LMUSE]
215 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
216 lappend ans [list unset __MODULES_LMPREREQ]
217 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1]
218 lappend ans [list set LOADEDMODULES othervia/1]
219 lappend ans [list set MODULEPATH $modpath.spider1]
220 set tserr [msg_top_switch moda/1 othervia/1 {othervic/1 modc/1 othervib/1 modb/1} {} {} {} {}]
221 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
222
223 setenv_var MODULES_CONFLICT_UNLOAD 1
224
225 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
226 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
227
228 set tserr [msg_top_switch moda/1 othervia/1 {othervic/1 modc/1 othervib/1 modb/1} {} {} {} {}]
229 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
230
231
232 #
233 # replace via module with not an alternative via module
234 # modulepath not anymore enabled
235 #
236
237 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 conflict_moda
238 setenv_var TESTSUITE_REQUIRE_VIA multi_mod_in_path_with_req1
239
240 setenv_path_var MODULEPATH $modpath.spider1
241 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
242 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
243 setenv_loaded_module [list moda/1 modb/1 othervib/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
244
245 # replace with module load
246
247 setenv_var MODULES_REQUIRE_VIA 0
248 setenv_var MODULES_CONFLICT_UNLOAD 0
249
250 set tserr [msg_load othervia/1 [err_conflict moda/1]]
251 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
252 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
253
254 setenv_var MODULES_CONFLICT_UNLOAD 1
255
256 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
257
258 set ans [list]
259 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3]
260 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
261 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
262 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
263 lappend ans [list set MODULEPATH $modpath.spider1]
264 set tserr [msg_top_load othervia/1 moda/1 {} {}]
265 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
266
267 setenv_var MODULES_REQUIRE_VIA 1
268 setenv_var MODULES_CONFLICT_UNLOAD 0
269
270 set tserr [msg_load othervia/1 [err_conflict moda/1]]
271 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
272 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
273
274 setenv_var MODULES_CONFLICT_UNLOAD 1
275
276 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
277
278 set ans [list]
279 lappend ans [list unset __MODULES_LMUSE]
280 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
281 lappend ans [list unset __MODULES_LMPREREQ]
282 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1]
283 lappend ans [list set LOADEDMODULES othervia/1]
284 lappend ans [list set MODULEPATH $modpath.spider1]
285 set tserr [msg_top_load_conun othervia/1 {othervic/1 modc/1 othervib/1 modb/1} moda/1 {} {} {}]
286 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
287
288
289 # replace with module switch
290
291 setenv_var MODULES_REQUIRE_VIA 0
292 setenv_var MODULES_CONFLICT_UNLOAD 0
293
294 set ans [list]
295 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3]
296 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
297 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
298 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
299 lappend ans [list set MODULEPATH $modpath.spider1]
300 set tserr [msg_load othervia/1 [err_conflict moda/1]]
301 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
302 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
303
304 setenv_var MODULES_CONFLICT_UNLOAD 1
305
306 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
307 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
308
309 setenv_var MODULES_REQUIRE_VIA 1
310 setenv_var MODULES_CONFLICT_UNLOAD 0
311
312 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
313 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
314
315 set ans [list]
316 lappend ans [list unset __MODULES_LMUSE]
317 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
318 lappend ans [list unset __MODULES_LMPREREQ]
319 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1]
320 lappend ans [list set LOADEDMODULES othervia/1]
321 lappend ans [list set MODULEPATH $modpath.spider1]
322 set tserr [msg_top_switch moda/1 othervia/1 {othervic/1 modc/1 othervib/1 modb/1} {} {} {} {}]
323 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
324
325 setenv_var MODULES_CONFLICT_UNLOAD 1
326
327 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
328 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
329
330 set tserr [msg_top_switch moda/1 othervia/1 {othervic/1 modc/1 othervib/1 modb/1} {} {} {} {}]
331 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
332
333
334 # MSYS environment does not support anymore such test
335 if {!$is_symlink_supported || $os_name eq {msys} || [catch {file link -symbolic $modpath.other2 modulefiles.spider2}]} {
336 send_user "\tskipping tests over '$modpath.other2' modulepath as symbolic links are not supported on filesystem\n"
337 } else {
338
339 #
340 # replace via module with a via module of another modulepath
341 # containing all the module to reload
342 # modulepath still enabled
343 #
344
345 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 use_other2_and_conflict_moda
346 setenv_var TESTSUITE_REQUIRE_VIA multi_mod_in_path_with_req1
347
348 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1
349 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
350 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
351 setenv_loaded_module [list moda/1 modb/1 othervib/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
352
353 # replace with module load
354
355 setenv_var MODULES_REQUIRE_VIA 0
356 setenv_var MODULES_CONFLICT_UNLOAD 0
357
358 set tserr [msg_load othervia/1 [err_conflict moda/1]]
359 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
360 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
361
362 setenv_var MODULES_CONFLICT_UNLOAD 1
363
364 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
365
366 set ans [list]
367 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.other2]
368 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
369 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
370 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
371 lappend ans [list set MODULEPATH $modpath.other2:$modpath.spider3:$modpath.spider1]
372 set tserr [msg_top_load othervia/1 moda/1 {} {}]
373 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
374
375 setenv_var MODULES_REQUIRE_VIA 1
376 setenv_var MODULES_CONFLICT_UNLOAD 0
377
378 set tserr [msg_load othervia/1 [err_conflict moda/1]]
379 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
380 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
381
382 setenv_var MODULES_CONFLICT_UNLOAD 1
383
384 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
385
386 set ans [list]
387 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
388 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
389 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
390 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
391 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
392 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
393 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
394 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
395
396
397 # replace with module switch
398
399 setenv_var MODULES_REQUIRE_VIA 0
400 setenv_var MODULES_CONFLICT_UNLOAD 0
401
402 set ans [list]
403 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.other2]
404 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
405 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
406 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
407 lappend ans [list set MODULEPATH $modpath.other2:$modpath.spider3:$modpath.spider1]
408 set tserr [msg_load othervia/1 [err_conflict moda/1]]
409 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
410 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
411
412 setenv_var MODULES_CONFLICT_UNLOAD 1
413
414 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
415 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
416
417 setenv_var MODULES_REQUIRE_VIA 1
418 setenv_var MODULES_CONFLICT_UNLOAD 0
419
420 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
421 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
422
423 set ans [list]
424 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
425 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
426 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
427 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
428 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
429 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
430 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
431 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
432
433 setenv_var MODULES_CONFLICT_UNLOAD 1
434
435 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
436 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
437
438 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
439 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
440
441
442 #
443 # replace via module with a via module of another modulepath
444 # containing all the module to reload
445 # modulepath not anymore enabled
446 #
447
448 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 use_other2_and_conflict_moda
449 setenv_var TESTSUITE_REQUIRE_VIA multi_mod_in_path_with_req1
450
451 setenv_path_var MODULEPATH $modpath.spider1
452 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
453 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
454 setenv_loaded_module [list moda/1 modb/1 othervib/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
455
456 # replace with module load
457
458 setenv_var MODULES_REQUIRE_VIA 0
459 setenv_var MODULES_CONFLICT_UNLOAD 0
460
461 set tserr [msg_load othervia/1 [err_conflict moda/1]]
462 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
463 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
464
465 setenv_var MODULES_CONFLICT_UNLOAD 1
466
467 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
468
469 set ans [list]
470 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.other2]
471 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
472 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
473 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
474 lappend ans [list set MODULEPATH $modpath.other2:$modpath.spider1]
475 set tserr [msg_top_load othervia/1 moda/1 {} {}]
476 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
477
478 setenv_var MODULES_REQUIRE_VIA 1
479 setenv_var MODULES_CONFLICT_UNLOAD 0
480
481 set tserr [msg_load othervia/1 [err_conflict moda/1]]
482 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
483 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
484
485 setenv_var MODULES_CONFLICT_UNLOAD 1
486
487 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
488
489 set ans [list]
490 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
491 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
492 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
493 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
494 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
495 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
496 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
497 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
498
499
500 # replace with module switch
501
502 setenv_var MODULES_REQUIRE_VIA 0
503 setenv_var MODULES_CONFLICT_UNLOAD 0
504
505 set ans [list]
506 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.other2]
507 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
508 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
509 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
510 lappend ans [list set MODULEPATH $modpath.other2:$modpath.spider1]
511 set tserr [msg_load othervia/1 [err_conflict moda/1]]
512 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
513 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
514
515 setenv_var MODULES_CONFLICT_UNLOAD 1
516
517 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
518 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
519
520 setenv_var MODULES_REQUIRE_VIA 1
521 setenv_var MODULES_CONFLICT_UNLOAD 0
522
523 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
524 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
525
526 set ans [list]
527 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
528 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
529 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
530 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
531 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
532 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
533 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
534 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
535
536 setenv_var MODULES_CONFLICT_UNLOAD 1
537
538 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
539 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
540
541 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
542 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
543
544
545 #
546 # replace via module with a via module of another modulepath
547 # containing all the module to reload
548 # via module loaded after potential dependent
549 #
550
551 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 use_other2_and_conflict_moda
552 setenv_var TESTSUITE_REQUIRE_VIA multi_mod_in_path_with_req1
553
554 setenv_var __MODULES_LMUSE modb/1&$modpath.spider3:moda/1&$modpath.spider2
555 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
556 setenv_loaded_module [list modb/1 othervib/1 moda/1 modc/1 othervic/1] [list $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider1/moda/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
557
558 setenv_var MODULES_REQUIRE_VIA 1
559 setenv_var MODULES_CONFLICT_UNLOAD 1
560
561 # modulepath still enabled
562 setenv_path_var MODULEPATH $modpath.spider2:$modpath.spider3:$modpath.spider1
563
564 set ans [list]
565 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.other2]
566 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
567 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
568 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
569 lappend ans [list set MODULEPATH $modpath.other2:$modpath.spider3:$modpath.spider1]
570 set tserr [msg_top_load othervia/1 moda/1 {} {}]
571 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
572
573 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
574
575
576 # modulepath not anymore enabled
577 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider1
578
579 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
580
581 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
582
583
584 #
585 # replace via module with a via module of another modulepath
586 # containing all the module to reload
587 # via module also a requirement declared by dependent
588 #
589
590 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 use_other2_and_conflict_moda
591 setenv_var TESTSUITE_REQUIRE_VIA prereq_on_via1
592
593 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1
594 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
595 setenv_var __MODULES_LMPREREQ modb/1&moda|othervia:othervib/1&modb/1:modc/1&modb:othervic/1&othervib/1
596 setenv_loaded_module [list moda/1 modb/1 othervib/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
597
598 setenv_var MODULES_REQUIRE_VIA 1
599 setenv_var MODULES_CONFLICT_UNLOAD 1
600
601 set ans [list]
602 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
603 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
604 lappend ans [list set __MODULES_LMPREREQ modb/1&moda|othervia:othervib/1&modb/1:modc/1&modb:othervic/1&othervib/1]
605 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
606 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
607 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
608 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
609 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
610
611 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
612 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
613
614
615 #
616 # replace via module with a via module of another modulepath
617 # containing all the module to reload
618 # test tag persistency
619 #
620
621 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 use_other2_and_conflict_moda
622
623 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1
624 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
625 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
626 setenv_loaded_module [list moda/1 modb/1 othervib/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
627
628 setenv_var MODULES_REQUIRE_VIA 1
629 setenv_var MODULES_CONFLICT_UNLOAD 1
630
631 # regular and extra tags
632 setenv_var TESTSUITE_REQUIRE_VIA tag_before_not_after
633 setenv_var __MODULES_LMEXTRATAG othervib/1&bar
634 setenv_var __MODULES_LMTAG othervib/1&foo&bar
635
636 set ans [list]
637 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
638 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
639 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
640 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
641 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
642 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
643 lappend ans [list set __MODULES_LMEXTRATAG othervib/1&bar]
644 lappend ans [list set __MODULES_LMTAG othervib/1&bar]
645 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
646 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
647
648 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
649 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
650
651
652 setenv_var TESTSUITE_REQUIRE_VIA tag_after_not_before
653 unsetenv_var __MODULES_LMEXTRATAG
654 unsetenv_var __MODULES_LMTAG
655
656 set ans [list]
657 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
658 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
659 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
660 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
661 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
662 lappend ans [list set __MODULES_LMTAG othervib/1&foo]
663 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
664 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
665 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
666
667 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
668 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
669
670
671 setenv_var TESTSUITE_REQUIRE_VIA tag_before_and_after
672 setenv_var __MODULES_LMEXTRATAG othervib/1&bar
673 setenv_var __MODULES_LMTAG othervib/1&foo&bar
674
675 set ans [list]
676 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
677 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
678 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
679 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
680 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
681 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
682 lappend ans [list set __MODULES_LMEXTRATAG othervib/1&bar]
683 lappend ans [list set __MODULES_LMTAG othervib/1&bar&foo]
684 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
685 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
686
687 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
688 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
689
690
691 setenv_var TESTSUITE_REQUIRE_VIA tag_before_no_module_after
692 setenv_var __MODULES_LMEXTRATAG othervib/1&bar
693 setenv_var __MODULES_LMTAG othervib/1&foo&bar
694
695 set ans [list]
696 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
697 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
698 lappend ans [list unset __MODULES_LMPREREQ]
699 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.spider3/modc/1]
700 lappend ans [list set LOADEDMODULES othervia/1:modb/1:modc/1]
701 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
702 lappend ans [list unset __MODULES_LMEXTRATAG]
703 lappend ans [list unset __MODULES_LMTAG]
704 set tserr [msg_top_load othervia/1 moda/1 {} {{othervic/1 modc/1 othervib/1 modb/1} {modb/1 modc/1}}]
705 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
706
707 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 modc/1 othervib/1 modb/1} {modb/1 modc/1}}]
708 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
709
710 unsetenv_var __MODULES_LMEXTRATAG
711
712
713 # auto-loaded and keep-loaded
714 setenv_var TESTSUITE_REQUIRE_VIA keep_loaded_before_not_after
715 setenv_var __MODULES_LMTAG othervib/1&auto-loaded&keep-loaded
716
717 set ans [list]
718 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
719 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
720 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
721 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
722 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
723 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
724 lappend ans [list set __MODULES_LMTAG othervib/1&auto-loaded]
725 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
726 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
727
728 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
729 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
730
731
732 setenv_var TESTSUITE_REQUIRE_VIA keep_loaded_after_not_before
733 setenv_var __MODULES_LMTAG othervib/1&auto-loaded
734
735 set ans [list]
736 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
737 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
738 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
739 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
740 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
741 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
742 lappend ans [list set __MODULES_LMTAG othervib/1&auto-loaded&keep-loaded]
743 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
744 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
745
746 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
747 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
748
749
750 setenv_var TESTSUITE_REQUIRE_VIA keep_loaded_before_and_after
751 setenv_var __MODULES_LMTAG othervib/1&auto-loaded&keep-loaded
752
753 set ans [list]
754 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
755 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
756 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
757 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
758 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
759 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
760 lappend ans [list set __MODULES_LMTAG othervib/1&auto-loaded&keep-loaded]
761 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
762 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
763
764 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
765 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
766
767
768 # sticky tag
769 setenv_var TESTSUITE_REQUIRE_VIA sticky_before_not_after
770 setenv_var __MODULES_LMTAG othervib/1&sticky
771
772 set ans [list]
773 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
774 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
775 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
776 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
777 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
778 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
779 lappend ans [list unset __MODULES_LMTAG]
780 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
781 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
782
783 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
784 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
785
786
787 setenv_var TESTSUITE_REQUIRE_VIA sticky_after_not_before
788 unsetenv_var __MODULES_LMTAG
789
790 # sticky tag is forwarded to module in new modulepath
791 set ans [list]
792 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
793 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
794 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
795 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
796 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
797 lappend ans [list set __MODULES_LMTAG othervib/1&sticky]
798 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
799 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
800 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
801
802 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
803 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
804
805
806 setenv_var TESTSUITE_REQUIRE_VIA sticky_before_and_after
807 setenv_var __MODULES_LMTAG othervib/1&sticky
808
809 set ans [list]
810 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
811 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
812 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
813 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
814 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
815 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
816 lappend ans [list set __MODULES_LMTAG othervib/1&sticky]
817 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
818 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
819
820 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
821 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
822
823
824 setenv_var TESTSUITE_REQUIRE_VIA sticky_before_no_module_after
825 setenv_var __MODULES_LMTAG othervib/1&sticky
826
827 set tserr [msg_load othervia/1 $err_path'othervib/1' [err_stickydepre othervib/1]]
828 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
829
830 set tserr [msg_switch moda/1 othervia/1 $err_path'othervib/1' [err_stickydepre othervib/1]]
831 testouterr_cmd bash {switch --auto moda/1 othervia/1} ERR $tserr
832
833
834 # super-sticky tag
835 setenv_var TESTSUITE_REQUIRE_VIA super_sticky_before_not_after
836 setenv_var __MODULES_LMTAG othervib/1&super-sticky
837
838 set ans [list]
839 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
840 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
841 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
842 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
843 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
844 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
845 lappend ans [list unset __MODULES_LMTAG]
846 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
847 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
848
849 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
850 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
851
852
853 setenv_var TESTSUITE_REQUIRE_VIA super_sticky_after_not_before
854 unsetenv_var __MODULES_LMTAG
855
856 # super-sticky tag is forwarded to module in new modulepath
857 set ans [list]
858 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
859 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
860 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
861 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
862 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
863 lappend ans [list set __MODULES_LMTAG othervib/1&super-sticky]
864 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
865 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
866 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
867
868 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
869 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
870
871
872 setenv_var TESTSUITE_REQUIRE_VIA super_sticky_before_and_after
873 setenv_var __MODULES_LMTAG othervib/1&super-sticky
874
875 set ans [list]
876 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
877 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
878 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1]
879 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
880 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:modc/1:othervic/1]
881 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
882 lappend ans [list set __MODULES_LMTAG othervib/1&super-sticky]
883 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervib/1 modc/1 othervic/1}]
884 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
885
886 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 modc/1 othervic/1}]
887 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
888
889
890 setenv_var TESTSUITE_REQUIRE_VIA super_sticky_before_no_module_after
891 setenv_var __MODULES_LMTAG othervib/1&super-sticky
892
893 set tserr [msg_load othervia/1 $err_path'othervib/1' [err_stickydepre othervib/1]]
894 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
895
896 set tserr [msg_load othervia/1 $err_path'othervib/1' [err_stickydepre othervib/1]]
897 testouterr_cmd bash {load --force --auto othervia/1} ERR $tserr
898
899 set tserr [msg_switch moda/1 othervia/1 $err_path'othervib/1' [err_stickydepre othervib/1]]
900 testouterr_cmd bash {switch --auto moda/1 othervia/1} ERR $tserr
901
902 testouterr_cmd bash {switch --force --auto moda/1 othervia/1} ERR $tserr
903
904 unsetenv_var __MODULES_LMTAG
905
906
907 #
908 # replace via module with a via module of another modulepath
909 # containing all the module to reload or not
910 # with virtual module
911 #
912
913 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 use_other2_and_conflict_moda
914
915 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
916 setenv_var __MODULES_LMPREREQ othervirt/1&modb/1:othervic/1&othervirt/1
917 setenv_loaded_module [list moda/1 modb/1 othervirt/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
918
919 setenv_var MODULES_REQUIRE_VIA 1
920 setenv_var MODULES_CONFLICT_UNLOAD 1
921
922 setenv_var TESTSUITE_REQUIRE_VIA virtual_before_and_after
923
924 # modulepath enabled
925 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1
926
927 set ans [list]
928 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
929 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
930 lappend ans [list set __MODULES_LMPREREQ othervirt/1&modb/1:othervic/1&othervirt/1]
931 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1]
932 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervirt/1:modc/1:othervic/1]
933 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
934 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervirt/1 modc/1 othervic/1}]
935 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
936
937 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervirt/1 modc/1 othervic/1}]
938 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
939
940
941 # modulepath not anymore enabled
942 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider1
943
944 set tserr [msg_top_load othervia/1 moda/1 {} {modb/1 othervirt/1 modc/1 othervic/1}]
945 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
946
947 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervirt/1 modc/1 othervic/1}]
948 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
949
950
951 setenv_var TESTSUITE_REQUIRE_VIA virtual_before_not_after
952
953 # modulepath enabled
954 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1
955
956 set ans [list]
957 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
958 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
959 lappend ans [list unset __MODULES_LMPREREQ]
960 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.spider3/modc/1]
961 lappend ans [list set LOADEDMODULES othervia/1:modb/1:modc/1]
962 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
963 set tserr [msg_top_load othervia/1 moda/1 {} {{othervic/1 modc/1 othervirt/1 modb/1} {modb/1 modc/1}}]
964 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
965
966 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 modc/1 othervirt/1 modb/1} {modb/1 modc/1}}]
967 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
968
969
970 # modulepath not anymore enabled
971 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider1
972
973 set tserr [msg_top_load othervia/1 moda/1 {} {{othervic/1 modc/1 othervirt/1 modb/1} {modb/1 modc/1}}]
974 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
975
976 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 modc/1 othervirt/1 modb/1} {modb/1 modc/1}}]
977 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
978
979
980 #
981 # replace via module with a via module of another modulepath
982 # containing not all the module to reload
983 # modulepath still enabled
984 #
985
986 foreach abort_on_error {ml:reload:switch_unload:load:switch ml:reload:switch_unload} {
987
988 setenv_var MODULES_ABORT_ON_ERROR $abort_on_error
989
990 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 use_other2_and_conflict_moda
991 setenv_var TESTSUITE_REQUIRE_VIA multi_mod_in_path_with_req_some_hidden1
992
993 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1
994 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
995 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
996 setenv_loaded_module [list moda/1 modb/1 othervib/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
997
998 # replace with module load
999
1000 setenv_var MODULES_REQUIRE_VIA 0
1001 setenv_var MODULES_CONFLICT_UNLOAD 0
1002
1003 set tserr [msg_load othervia/1 [err_conflict moda/1]]
1004 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1005 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
1006
1007 setenv_var MODULES_CONFLICT_UNLOAD 1
1008
1009 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1010
1011 set ans [list]
1012 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.other2]
1013 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1014 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
1015 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
1016 lappend ans [list set MODULEPATH $modpath.other2:$modpath.spider3:$modpath.spider1]
1017 set tserr [msg_top_load othervia/1 moda/1 {} {}]
1018 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
1019
1020 setenv_var MODULES_REQUIRE_VIA 1
1021 setenv_var MODULES_CONFLICT_UNLOAD 0
1022
1023 set tserr [msg_load othervia/1 [err_conflict moda/1]]
1024 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1025 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
1026
1027 set ans [list]
1028 lappend ans [list set __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3:othervia/1&$modpath.other2]
1029 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1030 lappend ans [list set _LMFILES_ $modpath.spider1/moda/1:$modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
1031 lappend ans [list set LOADEDMODULES moda/1:modb/1:othervib/1:modc/1:othervic/1:othervia/1]
1032 lappend ans [list set MODULEPATH $modpath.other2:$modpath.spider3:$modpath.spider2:$modpath.spider1]
1033 set tserr [msg_load othervia/1 [err_conlof moda/1]]
1034 testouterr_cmd bash {load --no-auto --force othervia/1} $ans $tserr
1035 testouterr_cmd bash {load --auto --force othervia/1} $ans $tserr
1036
1037 setenv_var MODULES_CONFLICT_UNLOAD 1
1038
1039 set tserr [msg_load othervia/1 [err_conflict moda/1]]
1040 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1041
1042 set tserr [msg_load othervia/1 [err_conlof moda/1]]
1043 testouterr_cmd bash {load --no-auto --force othervia/1} $ans $tserr
1044
1045 set ans [list]
1046 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
1047 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1048 lappend ans [list unset __MODULES_LMPREREQ]
1049 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.spider3/modc/1]
1050 lappend ans [list set LOADEDMODULES othervia/1:modb/1:modc/1]
1051 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
1052 set tserr [msg_top_load_conun othervia/1 {} moda/1 {} {} {{othervic/1 modc/1 othervib/1 modb/1} {modb/1 modc/1}}]
1053 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
1054 testouterr_cmd bash {load --auto --force othervia/1} $ans $tserr
1055
1056
1057 # replace with module switch
1058
1059 setenv_var MODULES_REQUIRE_VIA 0
1060 setenv_var MODULES_CONFLICT_UNLOAD 0
1061
1062 set ans [list]
1063 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.other2]
1064 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1065 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
1066 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
1067 lappend ans [list set MODULEPATH $modpath.other2:$modpath.spider3:$modpath.spider1]
1068 set tserr [msg_load othervia/1 [err_conflict moda/1]]
1069 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
1070 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
1071
1072 setenv_var MODULES_CONFLICT_UNLOAD 1
1073
1074 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
1075 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
1076
1077 setenv_var MODULES_REQUIRE_VIA 1
1078 setenv_var MODULES_CONFLICT_UNLOAD 0
1079
1080 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
1081 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
1082
1083 set tserr [msg_unload moda/1 [err_deplof modb/1 othervib/1]]
1084 testouterr_cmd bash {switch --no-auto --force moda/1 othervia/1} $ans $tserr
1085
1086 set ans [list]
1087 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
1088 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1089 lappend ans [list unset __MODULES_LMPREREQ]
1090 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.spider3/modc/1]
1091 lappend ans [list set LOADEDMODULES othervia/1:modb/1:modc/1]
1092 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
1093 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 modc/1 othervib/1 modb/1} {modb/1 modc/1}}]
1094 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1095 testouterr_cmd bash {switch --auto --force moda/1 othervia/1} $ans $tserr
1096
1097 setenv_var MODULES_CONFLICT_UNLOAD 1
1098
1099 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
1100 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
1101
1102
1103 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 modc/1 othervib/1 modb/1} {modb/1 modc/1}}]
1104 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1105 testouterr_cmd bash {switch --auto --force moda/1 othervia/1} $ans $tserr
1106
1107 set ans [list]
1108 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.other2]
1109 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1110 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
1111 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
1112 lappend ans [list set MODULEPATH $modpath.other2:$modpath.spider3:$modpath.spider1]
1113 set tserr [msg_unload moda/1 [err_deplof modb/1 othervib/1]]
1114 testouterr_cmd bash {switch --no-auto --force moda/1 othervia/1} $ans $tserr
1115
1116 }
1117
1118
1119 #
1120 # replace via module with a via module of another modulepath
1121 # containing not all the module to reload
1122 # modulepath expressed with a reference to an environment variable
1123 # modulepath still enabled
1124 #
1125
1126 setenv_var TESTSUITE_SPIDER_INREF er2
1127
1128 set from_to_modpath_prop_list [list\
1129 use_modpath2 $modpath.spider2 use_refvar_and_conflict_moda $modpath.oth\$TESTSUITE_SPIDER_INREF\
1130 use_refvar $modpath.spid\$TESTSUITE_SPIDER_INREF use_other2_and_conflict_moda $modpath.other2\
1131 use_refvar $modpath.spid\$TESTSUITE_SPIDER_INREF use_refvar_and_conflict_moda $modpath.oth\$TESTSUITE_SPIDER_INREF]
1132
1133 foreach {from_modpath_case from_modpath to_modpath_case to_modpath} $from_to_modpath_prop_list {
1134
1135 setenv_var TESTSUITE_SPIDER_MODPATH1 $from_modpath_case
1136 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 $to_modpath_case
1137 setenv_var TESTSUITE_REQUIRE_VIA multi_mod_in_path_with_req_some_hidden1
1138
1139 setenv_path_var MODULEPATH $modpath.spider3:$from_modpath:$modpath.spider1
1140 setenv_var __MODULES_LMUSE moda/1&$from_modpath:modb/1&$modpath.spider3
1141 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
1142 setenv_loaded_module [list moda/1 modb/1 othervib/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
1143
1144 # replace with module load
1145
1146 setenv_var MODULES_REQUIRE_VIA 0
1147 setenv_var MODULES_CONFLICT_UNLOAD 0
1148
1149 set tserr [msg_load othervia/1 [err_conflict moda/1]]
1150 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1151 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
1152
1153 setenv_var MODULES_CONFLICT_UNLOAD 1
1154
1155 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1156
1157 set ans [list]
1158 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$to_modpath]
1159 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1160 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
1161 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
1162 lappend ans [list set MODULEPATH $to_modpath:$modpath.spider3:$modpath.spider1]
1163 set tserr [msg_top_load othervia/1 moda/1 {} {}]
1164 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
1165
1166 setenv_var MODULES_REQUIRE_VIA 1
1167 setenv_var MODULES_CONFLICT_UNLOAD 0
1168
1169 set tserr [msg_load othervia/1 [err_conflict moda/1]]
1170 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1171 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
1172
1173 set ans [list]
1174 lappend ans [list set __MODULES_LMUSE moda/1&$from_modpath:modb/1&$modpath.spider3:othervia/1&$to_modpath]
1175 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1176 lappend ans [list set _LMFILES_ $modpath.spider1/moda/1:$modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
1177 lappend ans [list set LOADEDMODULES moda/1:modb/1:othervib/1:modc/1:othervic/1:othervia/1]
1178 lappend ans [list set MODULEPATH $to_modpath:$modpath.spider3:$from_modpath:$modpath.spider1]
1179 set tserr [msg_load othervia/1 [err_conlof moda/1]]
1180 testouterr_cmd bash {load --no-auto --force othervia/1} $ans $tserr
1181 testouterr_cmd bash {load --auto --force othervia/1} $ans $tserr
1182
1183 setenv_var MODULES_CONFLICT_UNLOAD 1
1184
1185 set tserr [msg_load othervia/1 [err_conflict moda/1]]
1186 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1187
1188 set tserr [msg_load othervia/1 [err_conlof moda/1]]
1189 testouterr_cmd bash {load --no-auto --force othervia/1} $ans $tserr
1190
1191 set ans [list]
1192 lappend ans [list set __MODULES_LMUSE othervia/1&$to_modpath:modb/1&$modpath.spider3]
1193 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1194 lappend ans [list unset __MODULES_LMPREREQ]
1195 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.spider3/modc/1]
1196 lappend ans [list set LOADEDMODULES othervia/1:modb/1:modc/1]
1197 lappend ans [list set MODULEPATH $modpath.spider3:$to_modpath:$modpath.spider1]
1198 set tserr [msg_top_load_conun othervia/1 {} moda/1 {} {} {{othervic/1 modc/1 othervib/1 modb/1} {modb/1 modc/1}}]
1199 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
1200 testouterr_cmd bash {load --auto --force othervia/1} $ans $tserr
1201
1202
1203 # replace with module switch
1204
1205 setenv_var MODULES_REQUIRE_VIA 0
1206 setenv_var MODULES_CONFLICT_UNLOAD 0
1207
1208 set ans [list]
1209 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$to_modpath]
1210 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1211 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
1212 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
1213 lappend ans [list set MODULEPATH $to_modpath:$modpath.spider3:$modpath.spider1]
1214 set tserr [msg_load othervia/1 [err_conflict moda/1]]
1215 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
1216 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
1217
1218 setenv_var MODULES_CONFLICT_UNLOAD 1
1219
1220 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
1221 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
1222
1223 setenv_var MODULES_REQUIRE_VIA 1
1224 setenv_var MODULES_CONFLICT_UNLOAD 0
1225
1226 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
1227 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
1228
1229 set tserr [msg_unload moda/1 [err_deplof modb/1 othervib/1]]
1230 testouterr_cmd bash {switch --no-auto --force moda/1 othervia/1} $ans $tserr
1231
1232 set ans [list]
1233 lappend ans [list set __MODULES_LMUSE othervia/1&$to_modpath:modb/1&$modpath.spider3]
1234 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1235 lappend ans [list unset __MODULES_LMPREREQ]
1236 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.spider3/modc/1]
1237 lappend ans [list set LOADEDMODULES othervia/1:modb/1:modc/1]
1238 lappend ans [list set MODULEPATH $modpath.spider3:$to_modpath:$modpath.spider1]
1239 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 modc/1 othervib/1 modb/1} {modb/1 modc/1}}]
1240 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1241 testouterr_cmd bash {switch --auto --force moda/1 othervia/1} $ans $tserr
1242
1243 setenv_var MODULES_CONFLICT_UNLOAD 1
1244
1245 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
1246 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
1247
1248
1249 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 modc/1 othervib/1 modb/1} {modb/1 modc/1}}]
1250 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1251 testouterr_cmd bash {switch --auto --force moda/1 othervia/1} $ans $tserr
1252
1253 set ans [list]
1254 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$to_modpath]
1255 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1256 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
1257 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
1258 lappend ans [list set MODULEPATH $to_modpath:$modpath.spider3:$modpath.spider1]
1259 set tserr [msg_unload moda/1 [err_deplof modb/1 othervib/1]]
1260 testouterr_cmd bash {switch --no-auto --force moda/1 othervia/1} $ans $tserr
1261
1262 }
1263
1264
1265 #
1266 # replace via module with a via module of another modulepath
1267 # containing not all the module to reload (variant not available)
1268 # modulepath still enabled
1269 #
1270
1271 setenv_var MODULES_ADVANCED_VERSION_SPEC 1
1272
1273 setenv_var TESTSUITE_SPIDER_MODPATH1 use_modpath2
1274 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 use_other2_and_conflict_moda
1275
1276 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1
1277 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
1278 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
1279 setenv_var __MODULES_LMVARIANT othervib/1&foo|val1|0|0
1280 setenv_loaded_module [list moda/1 modb/1 othervib/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
1281
1282 setenv_var MODULES_REQUIRE_VIA 1
1283 setenv_var MODULES_CONFLICT_UNLOAD 1
1284
1285 # variant not defined in new modulepath
1286 setenv_var TESTSUITE_REQUIRE_VIA multi_mod_in_path_with_req_unk_variant_name
1287
1288 set tserr [msg_load othervib/1{foo=val1} [err_unkvar foo]]\n\n[msg_load othervia/1 [err_depre othervib/1{foo=val1}]]
1289 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
1290
1291 set ans [list]
1292 lappend ans [list unset __MODULES_LMVARIANT]
1293 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
1294 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1295 lappend ans [list set LOADEDMODULES othervia/1:modb/1:modc/1]
1296 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.spider3/modc/1]
1297 lappend ans [list unset __MODULES_LMPREREQ]
1298 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
1299 lappend ans [list ERR]
1300
1301 set tserr [msg_load othervib/1{foo=val1} [err_unkvar foo]]\n\n[msg_top_load_conun othervia/1 {} {moda/1} {} {} {{othervic/1 modc/1 othervib/1{foo=val1} modb/1} {modb/1 modc/1}} [err_depref othervib/1{foo=val1}]]
1302 testouterr_cmd bash {load --force --auto othervia/1} $ans $tserr
1303
1304 set tserr [msg_load othervib/1{foo=val1} [err_unkvar foo]]\n\n[msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 modc/1 othervib/1{foo=val1} modb/1} {modb/1 modc/1}} [err_depref othervib/1{foo=val1}]]
1305 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1306 testouterr_cmd bash {switch --force --auto moda/1 othervia/1} $ans $tserr
1307
1308
1309 # variant value not defined in new modulepath
1310 setenv_var TESTSUITE_REQUIRE_VIA multi_mod_in_path_with_req_unk_variant_val
1311
1312 set tserr [msg_load othervib/1{foo=val1} [err_invalvarval foo val1 {val2 val3}]]\n\n[msg_load othervia/1 [err_depre othervib/1{foo=val1}]]
1313 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
1314
1315 set ans [list]
1316 lappend ans [list unset __MODULES_LMVARIANT]
1317 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
1318 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1319 lappend ans [list set LOADEDMODULES othervia/1:modb/1:modc/1]
1320 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.spider3/modc/1]
1321 lappend ans [list unset __MODULES_LMPREREQ]
1322 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
1323 lappend ans [list ERR]
1324
1325 set tserr [msg_load othervib/1{foo=val1} [err_invalvarval foo val1 {val2 val3}]]\n\n[msg_top_load_conun othervia/1 {} {moda/1} {} {} {{othervic/1 modc/1 othervib/1{foo=val1} modb/1} {modb/1 modc/1}} [err_depref othervib/1{foo=val1}]]
1326 testouterr_cmd bash {load --force --auto othervia/1} $ans $tserr
1327
1328 set tserr [msg_load othervib/1{foo=val1} [err_invalvarval foo val1 {val2 val3}]]\n\n[msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 modc/1 othervib/1{foo=val1} modb/1} {modb/1 modc/1}} [err_depref othervib/1{foo=val1}]]
1329 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1330 testouterr_cmd bash {switch --force --auto moda/1 othervia/1} $ans $tserr
1331
1332 unsetenv_var __MODULES_LMVARIANT
1333 unsetenv_var MODULES_ADVANCED_VERSION_SPEC
1334
1335
1336 #
1337 # replace via module with a via module of another modulepath
1338 # containing all the module to reload
1339 # with different set of requirement and conflict
1340 # modulepath still enabled
1341 #
1342
1343 setenv_var MODULES_REQUIRE_VIA 1
1344 setenv_var MODULES_CONFLICT_UNLOAD 1
1345
1346 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 use_other2_and_conflict_moda
1347
1348 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1
1349 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
1350 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
1351 setenv_loaded_module [list moda/1 modb/1 othervib/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/othervic/1]
1352
1353 # in new modulepath othervic/1 does not require anymore othervib/1, which does not exist
1354 setenv_var TESTSUITE_REQUIRE_VIA req_not_anymore_does_not_exist
1355
1356 #FIXME: othervic/1 should be reloaded has it does not require othervib/1 in new modulepath
1357 set ans [list]
1358 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
1359 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1360 lappend ans [list unset __MODULES_LMPREREQ]
1361 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1]
1362 lappend ans [list set LOADEDMODULES othervia/1:modb/1]
1363 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
1364 set tserr [msg_top_load_conun othervia/1 {} moda/1 {} {} {{othervic/1 othervib/1 modb/1} {modb/1}}]
1365 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
1366
1367 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 othervib/1 modb/1} {modb/1}}]
1368 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1369
1370
1371 # in new modulepath othervic/1 does not require anymore othervib/1, which still exists
1372 setenv_var TESTSUITE_REQUIRE_VIA req_not_anymore_still_exists
1373 setenv_var __MODULES_LMTAG othervib/1&auto-loaded
1374
1375 #FIXME: othervib/1 could be unloaded as a UReqUn
1376 set ans [list]
1377 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
1378 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1379 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1]
1380 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/othervic/1]
1381 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:othervic/1]
1382 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
1383 lappend ans [list set __MODULES_LMTAG othervib/1&auto-loaded]
1384 set tserr [msg_top_load_conun othervia/1 {} moda/1 {} {} {modb/1 othervib/1 othervic/1}]
1385 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
1386
1387 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 othervic/1}]
1388 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1389
1390 unsetenv_var __MODULES_LMTAG
1391
1392
1393 # in new modulepath othervic/1 requires another module, not loaded
1394 setenv_var TESTSUITE_REQUIRE_VIA req_another_not_loaded
1395
1396 set tserr [msg_load othervic/1 [err_prereq modc/1]]\n\n[msg_load othervia/1 [err_depre othervic/1]]
1397 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
1398
1399 #FIXME: new requirement modc/1 could be loaded to satisfy othervic/1 in new modulepath
1400 set ans [list]
1401 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
1402 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1403 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1]
1404 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1]
1405 lappend ans [list set __MODULES_LMPREREQ othervib/1&modb/1]
1406 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
1407 lappend ans [list ERR]
1408 set tserr [msg_load othervic/1 [err_prereq modc/1]]\n\n[msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 othervib/1 modb/1} {modb/1 othervib/1}} [err_depref othervic/1]]
1409 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1410
1411
1412 # in new modulepath othervib/1 has a conflict with othervic/1
1413 unsetenv_var __MODULES_LMPREREQ
1414 setenv_var TESTSUITE_REQUIRE_VIA conflict_in_new1
1415
1416 set ans [list]
1417 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
1418 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda:othervib/1&othervic]
1419 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1]
1420 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1]
1421 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
1422 set tserr [msg_top_load_conun othervia/1 {} moda/1 {} {} {{othervic/1 othervib/1 modb/1} {modb/1 othervib/1}}]
1423 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
1424
1425 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 othervib/1 modb/1} {modb/1 othervib/1}}]
1426 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1427
1428
1429 # in new modulepath othervic/1 has a conflict with othervib/1
1430 setenv_var TESTSUITE_REQUIRE_VIA conflict_in_new2
1431
1432 #FIXME: othervic/1 reload failure should be silenced
1433 set tserr [msg_load othervic/1 [err_conlo othervib/1]]\n\n[msg_load othervia/1 [err_depre othervic/1]]
1434 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
1435
1436 set ans [list]
1437 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
1438 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1439 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1]
1440 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1]
1441 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
1442 lappend ans [list ERR]
1443 set tserr [msg_load othervic/1 [err_conlo othervib/1]]\n\n[msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 othervib/1 modb/1} {modb/1 othervib/1}} [err_depref othervic/1]]
1444 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1445
1446
1447 # conflict of othervib/1 with othervic/1 is not there in new modulepath
1448 setenv_var __MODULES_LMCONFLICT othervib/1&othervic
1449 setenv_var TESTSUITE_REQUIRE_VIA conflict_not_anymore1
1450
1451 set ans [list]
1452 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
1453 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1454 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1:$modpath.spider3/othervic/1]
1455 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1:othervic/1]
1456 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
1457 set tserr [msg_top_load_conun othervia/1 {} moda/1 {} {} {modb/1 othervib/1 othervic/1}]
1458 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
1459
1460 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {modb/1 othervib/1 othervic/1}]
1461 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1462
1463
1464 # conflict of othervic/1 with othervib/1 is not there in new modulepath
1465 setenv_var __MODULES_LMCONFLICT othervic/1&othervib
1466 setenv_var TESTSUITE_REQUIRE_VIA conflict_not_anymore2
1467
1468 #FIXME: othervic/1 should be reloaded as it does not declare conflict in new modulepath
1469 set ans [list]
1470 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.other2:modb/1&$modpath.spider3]
1471 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1472 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1:$modpath.other2/modb/1:$modpath.other2/othervib/1]
1473 lappend ans [list set LOADEDMODULES othervia/1:modb/1:othervib/1]
1474 lappend ans [list set MODULEPATH $modpath.spider3:$modpath.other2:$modpath.spider1]
1475 set tserr [msg_top_load_conun othervia/1 {} moda/1 {} {} {{othervic/1 othervib/1 modb/1} {modb/1 othervib/1}}]
1476 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
1477
1478 set tserr [msg_top_switch moda/1 othervia/1 {} {} {} {} {{othervic/1 othervib/1 modb/1} {modb/1 othervib/1}}]
1479 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1480
1481 unsetenv_var __MODULES_LMCONFLICT
1482
1483 file delete $modpath.other2
1484 }
1485
1486
1487 #
1488 # replace via module with a via module of another modulepath
1489 # containing none of the module to reload
1490 # modulepath still enabled
1491 #
1492
1493 setenv_var TESTSUITE_SPIDER_OTHERMODPATH1 use_2_and_conflict_moda
1494 setenv_var TESTSUITE_REQUIRE_VIA multi_mod_in_path_with_req1
1495
1496 setenv_path_var MODULEPATH $modpath.spider3:$modpath.spider2:$modpath.spider1
1497 setenv_var __MODULES_LMUSE moda/1&$modpath.spider2:modb/1&$modpath.spider3
1498 setenv_var __MODULES_LMPREREQ othervib/1&modb/1:othervic/1&othervib/1
1499 setenv_loaded_module [list moda/1 modb/1 othervib/1 modc/1 othervic/1] [list $modpath.spider1/moda/1 $modpath.spider2/modb/1 $modpath.spider2/othervib/1 $modpath.spider3/modc/1 $modpath.spider3/othervic/1]
1500
1501 # replace with module load
1502
1503 setenv_var MODULES_REQUIRE_VIA 0
1504 setenv_var MODULES_CONFLICT_UNLOAD 0
1505
1506 set tserr [msg_load othervia/1 [err_conflict moda/1]]
1507 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1508 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
1509
1510 setenv_var MODULES_CONFLICT_UNLOAD 1
1511
1512 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1513
1514 set ans [list]
1515 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.2]
1516 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1517 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
1518 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
1519 lappend ans [list set MODULEPATH $modpath.2:$modpath.spider3:$modpath.spider1]
1520 set tserr [msg_top_load othervia/1 moda/1 {} {}]
1521 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
1522
1523 setenv_var MODULES_REQUIRE_VIA 1
1524 setenv_var MODULES_CONFLICT_UNLOAD 0
1525
1526 set tserr [msg_load othervia/1 [err_conflict moda/1]]
1527 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1528 testouterr_cmd bash {load --auto othervia/1} ERR $tserr
1529
1530 setenv_var MODULES_CONFLICT_UNLOAD 1
1531
1532 testouterr_cmd bash {load --no-auto othervia/1} ERR $tserr
1533
1534 set ans [list]
1535 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.2]
1536 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1537 lappend ans [list unset __MODULES_LMPREREQ]
1538 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1]
1539 lappend ans [list set LOADEDMODULES othervia/1]
1540 lappend ans [list set MODULEPATH $modpath.2:$modpath.spider1]
1541 set tserr [msg_top_load_conun othervia/1 {othervic/1 modc/1 othervib/1 modb/1} moda/1 {} {} {}]
1542 testouterr_cmd bash {load --auto othervia/1} $ans $tserr
1543
1544
1545 # replace with module switch
1546
1547 setenv_var MODULES_REQUIRE_VIA 0
1548 setenv_var MODULES_CONFLICT_UNLOAD 0
1549
1550 set ans [list]
1551 lappend ans [list set __MODULES_LMUSE modb/1&$modpath.spider3:othervia/1&$modpath.2]
1552 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1553 lappend ans [list set _LMFILES_ $modpath.spider2/modb/1:$modpath.spider2/othervib/1:$modpath.spider3/modc/1:$modpath.spider3/othervic/1:$modpath.spider1/othervia/1]
1554 lappend ans [list set LOADEDMODULES modb/1:othervib/1:modc/1:othervic/1:othervia/1]
1555 lappend ans [list set MODULEPATH $modpath.2:$modpath.spider3:$modpath.spider1]
1556 set tserr [msg_load othervia/1 [err_conflict moda/1]]
1557 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
1558 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
1559
1560 setenv_var MODULES_CONFLICT_UNLOAD 1
1561
1562 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} $ans {}
1563 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans {}
1564
1565 setenv_var MODULES_REQUIRE_VIA 1
1566 setenv_var MODULES_CONFLICT_UNLOAD 0
1567
1568 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
1569 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
1570
1571 set ans [list]
1572 lappend ans [list set __MODULES_LMUSE othervia/1&$modpath.2]
1573 lappend ans [list set __MODULES_LMCONFLICT othervia/1&moda]
1574 lappend ans [list unset __MODULES_LMPREREQ]
1575 lappend ans [list set _LMFILES_ $modpath.spider1/othervia/1]
1576 lappend ans [list set LOADEDMODULES othervia/1]
1577 lappend ans [list set MODULEPATH $modpath.2:$modpath.spider1]
1578 set tserr [msg_top_switch moda/1 othervia/1 {othervic/1 modc/1 othervib/1 modb/1} {} {} {} {}]
1579 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1580
1581 setenv_var MODULES_CONFLICT_UNLOAD 1
1582
1583 set tserr [msg_unload moda/1 [err_prerequn modb/1 othervib/1]]\n\n[msg_switch moda/1 othervia/1 [err_swoff moda/1]]
1584 testouterr_cmd bash {switch --no-auto moda/1 othervia/1} ERR $tserr
1585
1586 set tserr [msg_top_switch moda/1 othervia/1 {othervic/1 modc/1 othervib/1 modb/1} {} {} {} {}]
1587 testouterr_cmd bash {switch --auto moda/1 othervia/1} $ans $tserr
1588
1589
1590 #
1591 # Cleanup
1592 #
1593
1594 reset_test_env