Debian Codegraph @

testsuite/modules.50-cmds/461-super-sticky.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: 2020/12/20
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Xavier Delaruelle, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command: load, unload, switch, reload, purge, restore
14 # Modulefiles:
15 # Sub-Command:
16 #
17 # Comment: %C{
18 # Check super-sticky modules that should not be unloaded
19 # unless reloaded
20 # }C%
21 #
22 ##############################################################################
23
24 set mp $modpath.3
25 set mpre $modpathre.3
26 setenv_path_var MODULEPATH $mp
27
28 # disable advanced version specifiers not to get auto symbols in the way
29 setenv_var MODULES_ADVANCED_VERSION_SPEC 0
30
31 # ensure avail tests have implicit default enabled
32 setenv_var MODULES_IMPLICIT_DEFAULT 1
33
34 setenv_var TESTSUITE_SUPER_STICKY 1
35
36 # basic tests with only one module loaded, tagged super-sticky
37 set anslo [list]
38 lappend anslo [list set _LMFILES_ $mp/sticky/1.0]
39 lappend anslo [list set LOADEDMODULES sticky/1.0]
40 lappend anslo [list set __MODULES_LMTAG sticky/1.0&super-sticky]
41 testouterr_cmd_re sh {load sticky/1.0} $anslo {}
42
43 setenv_loaded_module [list sticky/1.0] [list $mp/sticky/1.0]
44 setenv_var __MODULES_LMTAG sticky/1.0&super-sticky
45
46 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]
47 testouterr_cmd_re sh {unload sticky/1.0} ERR $tserr
48 testouterr_cmd_re sh {unload -f sticky/1.0} ERR $tserr
49 testouterr_cmd_re sh {purge} ERR $tserr
50 testouterr_cmd_re sh {purge -f} ERR $tserr
51
52 testouterr_cmd_re sh {switch sticky} ERR [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {sticky/1.0 <sS>} sticky [err_swoff sticky/1.0]]
53 testouterr_cmd_re sh {switch -f sticky} ERR [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {sticky/1.0 <sS>} sticky [err_swoff sticky/1.0]]
54 testouterr_cmd_re sh {switch sticky/1.0 foo} ERR [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {sticky/1.0 <sS>} foo [err_swoff sticky/1.0]]
55 testouterr_cmd_re sh {switch -f sticky/1.0 foo} ERR [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {sticky/1.0 <sS>} foo [err_swoff sticky/1.0]]
56
57 testouterr_cmd_re sh {reload} $anslo {}
58 testouterr_cmd_re sh {reload -f} $anslo {}
59
60 skip_if_quick_mode
61
62 set ans [list]
63 lappend ans [list set _LMFILES_ $mp/sticky/1.0:$mp/foo/2.0]
64 lappend ans [list set LOADEDMODULES sticky/1.0:foo/2.0]
65 lappend ans [list ERR]
66 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_load foo/2.0]
67 testouterr_cmd_re sh {restore testsuite/home/coll-sticky-0} $ans $tserr
68 testouterr_cmd_re sh {restore -f testsuite/home/coll-sticky-0} $ans $tserr
69
70 set ans [list]
71 lappend ans [list set _LMFILES_ $mp/foo/2.0:$mp/sticky/1.0]
72 lappend ans [list set LOADEDMODULES foo/2.0:sticky/1.0]
73 lappend ans [list set __MODULES_LMTAG sticky/1.0&super-sticky]
74 testouterr_cmd_re sh {restore testsuite/home/coll-sticky-1} $ans [msg_unload {sticky/1.0 <sS>}]\n[msg_load foo/2.0]\n[msg_load {sticky/1.0 <sS>}]
75 testouterr_cmd_re sh {restore -f testsuite/home/coll-sticky-1} $ans [msg_unload {sticky/1.0 <sS>}]\n[msg_load foo/2.0]\n[msg_load {sticky/1.0 <sS>}]
76
77 # test with multiple module loaded, one is super-sticky
78 setenv_loaded_module [list foo/2.0 sticky/1.0 bar/2.0] [list $mp/foo/2.0 $mp/sticky/1.0 $mp/bar/2.0]
79 setenv_var __MODULES_LMTAG sticky/1.0&super-sticky
80
81 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]
82 testouterr_cmd_re sh {unload sticky/1.0} ERR $tserr
83 testouterr_cmd_re sh {unload -f sticky/1.0} ERR $tserr
84
85 set ans [list]
86 lappend ans [list set LOADEDMODULES sticky/1.0]
87 lappend ans [list set _LMFILES_ $mp/sticky/1.0]
88 lappend ans [list ERR]
89 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]
90 testouterr_cmd_re sh {purge} $ans $tserr
91 testouterr_cmd_re sh {purge -f} $ans $tserr
92
93 set ans [list]
94 lappend ans [list set _LMFILES_ $mp/foo/2.0:$mp/sticky/1.0:$mp/bar/2.0]
95 lappend ans [list set LOADEDMODULES foo/2.0:sticky/1.0:bar/2.0]
96 lappend ans [list set __MODULES_LMTAG sticky/1.0&super-sticky]
97 testouterr_cmd_re sh {reload} $ans {}
98 testouterr_cmd_re sh {reload -f} $ans {}
99
100 testouterr_cmd_re sh {switch sticky baz} ERR [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {sticky/1.0 <sS>} baz [err_swoff sticky/1.0]]
101 testouterr_cmd_re sh {switch -f sticky baz} ERR [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {sticky/1.0 <sS>} baz [err_swoff sticky/1.0]]
102
103 set ans [list]
104 lappend ans [list set _LMFILES_ $mp/sticky/1.0:$mp/foo/2.0]
105 lappend ans [list set LOADEDMODULES sticky/1.0:foo/2.0]
106 lappend ans [list set __MODULES_LMTAG sticky/1.0&super-sticky]
107 set tserr [msg_unload bar/2.0]\n[msg_unload {sticky/1.0 <sS>}]\n[msg_unload foo/2.0]\n[msg_load {sticky/1.0 <sS>}]\n[msg_load foo/2.0]
108 testouterr_cmd_re sh {restore testsuite/home/coll-sticky-2} $ans $tserr
109 testouterr_cmd_re sh {restore -f testsuite/home/coll-sticky-2} $ans $tserr
110
111 set ans [list]
112 lappend ans [list set LOADEDMODULES sticky/1.0:sticky/4.0:foo/2.0]
113 lappend ans [list set _LMFILES_ $mp/sticky/1.0:$mp/sticky/4.0:$mp/foo/2.0]
114 lappend ans [list ERR]
115 set tserr [msg_unload bar/2.0]\n\n[msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_unload foo/2.0]\n[msg_load sticky/4.0]\n[msg_load foo/2.0]
116 testouterr_cmd_re sh {restore testsuite/home/coll-sticky-3} $ans $tserr
117 testouterr_cmd_re sh {restore -f testsuite/home/coll-sticky-3} $ans $tserr
118
119 # test over *Dependency Reload* mechanism
120 setenv_var TESTSUITE_STICKY_DEP 1
121 setenv_loaded_module [list foo/2.0 sticky/1.0 bar/2.0] [list $mp/foo/2.0 $mp/sticky/1.0 $mp/bar/2.0]
122 setenv_var __MODULES_LMTAG sticky/1.0&super-sticky
123 setenv_var __MODULES_LMPREREQ sticky/1.0&foo|baz:bar/2.0&sticky/1.0
124
125 set ans [list]
126 lappend ans [list set __MODULES_LMPREREQ sticky/1.0&foo|baz:bar/2.0&sticky/1.0]
127 lappend ans [list set _LMFILES_ $mp/foo/2.0:$mp/baz/2.0:$mp/sticky/1.0:$mp/bar/2.0]
128 lappend ans [list set LOADEDMODULES foo/2.0:baz/2.0:sticky/1.0:bar/2.0]
129 lappend ans [list set __MODULES_LMTAG sticky/1.0&super-sticky]
130 testouterr_cmd_re sh {load --auto baz/2.0} $ans [msg_top_load baz/2.0 {} {} {sticky/1.0 bar/2.0}]
131
132 set ans [list]
133 lappend ans [list set __MODULES_LMPREREQ sticky/1.0&foo|baz:bar/2.0&sticky/1.0]
134 lappend ans [list set _LMFILES_ $mp/baz/2.0:$mp/sticky/1.0:$mp/bar/2.0]
135 lappend ans [list set LOADEDMODULES baz/2.0:sticky/1.0:bar/2.0]
136 lappend ans [list set __MODULES_LMTAG sticky/1.0&super-sticky]
137 testouterr_cmd_re sh {switch --auto foo/2.0 baz/2.0} $ans [msg_top_switch foo/2.0 baz/2.0 {} {} {} {} {sticky/1.0 bar/2.0}]
138
139 setenv_loaded_module [list foo/2.0 baz/2.0 sticky/1.0 bar/2.0] [list $mp/foo/2.0 $mp/baz/2.0 $mp/sticky/1.0 $mp/bar/2.0]
140 testouterr_cmd_re sh {unload --auto foo/2.0} $ans [msg_top_unload foo/2.0 {} {} {sticky/1.0 bar/2.0}]
141
142 # test over *Dependency Unload* mechanism
143 setenv_loaded_module [list foo/2.0 sticky/1.0 bar/2.0] [list $mp/foo/2.0 $mp/sticky/1.0 $mp/bar/2.0]
144 setenv_var __MODULES_LMTAG sticky/1.0&super-sticky
145 setenv_var __MODULES_LMPREREQ sticky/1.0&foo|baz:bar/2.0&sticky/1.0
146
147 testouterr_cmd_re sh {unload --auto foo/2.0} ERR [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_unload foo/2.0 [err_depun sticky/1.0]]
148
149 set ans [list]
150 lappend ans [list set LOADEDMODULES sticky/1.0]
151 lappend ans [list set _LMFILES_ $mp/sticky/1.0]
152 lappend ans [list set __MODULES_LMPREREQ sticky/1.0&foo|baz]
153 lappend ans [list ERR]
154 # force mode unloads super-sticky dependency
155 testouterr_cmd_re sh {unload -f --auto foo/2.0} $ans [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_top_unload foo/2.0 bar/2.0 {} {} [err_depunf sticky/1.0]]
156
157 # test over *Useless Requirement Unload* mechanism
158 setenv_loaded_module [list foo/2.0 sticky/1.0 bar/2.0] [list $mp/foo/2.0 $mp/sticky/1.0 $mp/bar/2.0] [list foo/2.0 sticky/1.0]
159 setenv_var __MODULES_LMTAG foo/2.0&auto-loaded:sticky/1.0&super-sticky&auto-loaded
160 setenv_var __MODULES_LMPREREQ sticky/1.0&foo|baz:bar/2.0&sticky/1.0
161
162 set ans [list]
163 lappend ans [list set __MODULES_LMPREREQ sticky/1.0&foo|baz]
164 lappend ans [list set _LMFILES_ $mp/foo/2.0:$mp/sticky/1.0]
165 lappend ans [list set LOADEDMODULES foo/2.0:sticky/1.0]
166 testouterr_cmd_re sh {unload --auto bar/2.0} $ans {}
167 testouterr_cmd_re sh {unload -f --auto bar/2.0} $ans {}
168
169 set ans [list]
170 lappend ans [list set __MODULES_LMPREREQ sticky/1.0&foo|baz]
171 lappend ans [list set _LMFILES_ $mp/foo/2.0:$mp/sticky/1.0:$mp/bar/1.0]
172 lappend ans [list set LOADEDMODULES foo/2.0:sticky/1.0:bar/1.0]
173 testouterr_cmd_re sh {switch --auto bar/2.0 bar/1.0} $ans {}
174 testouterr_cmd_re sh {switch -f --auto bar/2.0 bar/1.0} $ans {}
175
176 # test when stickiness is defined over generic module name
177 unsetenv_var TESTSUITE_STICKY_DEP
178 setenv_var TESTSUITE_STICKY_GENERIC 1
179 setenv_loaded_module [list sticky/1.0] [list $mp/sticky/1.0]
180 setenv_var __MODULES_LMTAG sticky/1.0&super-sticky
181 setenv_var __MODULES_LMSTICKYRULE sticky/1.0&super-sticky|sticky
182 unsetenv_var __MODULES_LMPREREQ
183
184 set ans [list]
185 lappend ans [list set __MODULES_LMSTICKYRULE sticky/2.0&super-sticky|sticky]
186 lappend ans [list set _LMFILES_ $mp/sticky/2.0:$mp/foo/2.0]
187 lappend ans [list set LOADEDMODULES sticky/2.0:foo/2.0]
188 lappend ans [list set __MODULES_LMTAG sticky/2.0&super-sticky]
189 set tserr [msg_unload {sticky/1.0 <sS>}]\n[msg_load {sticky/2.0 <sS>}]\n[msg_load foo/2.0]
190 testouterr_cmd_re sh {restore testsuite/home/coll-sticky-4} $ans $tserr
191 testouterr_cmd_re sh {restore -f testsuite/home/coll-sticky-4} $ans $tserr
192
193 set ans [list]
194 lappend ans [list set __MODULES_LMSTICKYRULE sticky/4.0&super-sticky|sticky]
195 lappend ans [list set _LMFILES_ $mp/sticky/4.0:$mp/foo/2.0]
196 lappend ans [list set LOADEDMODULES sticky/4.0:foo/2.0]
197 lappend ans [list set __MODULES_LMTAG sticky/4.0&super-sticky]
198 set tserr [msg_unload {sticky/1.0 <sS>}]\n[msg_load {sticky/4.0 <sS>}]\n[msg_load foo/2.0]
199 testouterr_cmd_re sh {restore testsuite/home/coll-sticky-5} $ans $tserr
200 testouterr_cmd_re sh {restore -f testsuite/home/coll-sticky-5} $ans $tserr
201
202 set ans [list]
203 lappend ans [list set __MODULES_LMSTICKYRULE sticky/2.0&super-sticky|sticky]
204 lappend ans [list set _LMFILES_ $mp/sticky/2.0]
205 lappend ans [list set LOADEDMODULES sticky/2.0]
206 lappend ans [list set __MODULES_LMTAG sticky/2.0&super-sticky]
207 testouterr_cmd_re sh {switch sticky/2.0} $ans {}
208 testouterr_cmd_re sh {switch sticky sticky/2.0} $ans {}
209 testouterr_cmd_re sh {switch -f sticky sticky/2.0} $ans {}
210
211 set ans [list]
212 lappend ans [list set __MODULES_LMSTICKYRULE sticky/4.0&super-sticky|sticky]
213 lappend ans [list set _LMFILES_ $mp/sticky/4.0]
214 lappend ans [list set LOADEDMODULES sticky/4.0]
215 lappend ans [list set __MODULES_LMTAG sticky/4.0&super-sticky]
216 testouterr_cmd_re sh {switch sticky} $ans {}
217 testouterr_cmd_re sh {switch sticky sticky} $ans {}
218 testouterr_cmd_re sh {switch -f sticky sticky} $ans {}
219
220 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {sticky/1.0 <sS>} foo [err_swoff sticky/1.0]]
221 testouterr_cmd_re sh {switch sticky foo} ERR $tserr
222 testouterr_cmd_re sh {switch -f sticky foo} ERR $tserr
223
224 # test when stickiness is defined over generic module name with deep module
225 setenv_var TESTSUITE_STICKY_GENERIC 1
226 setenv_loaded_module [list stickysub/dir1/1.0] [list $mp/stickysub/dir1/1.0]
227 setenv_var __MODULES_LMTAG stickysub/dir1/1.0&super-sticky
228 setenv_var __MODULES_LMSTICKYRULE stickysub/dir1/1.0&super-sticky|stickysub
229
230 set ans1 [list]
231 lappend ans1 [list set __MODULES_LMSTICKYRULE stickysub/dir1/2.0&super-sticky|stickysub]
232 lappend ans1 [list set _LMFILES_ $mp/stickysub/dir1/2.0]
233 lappend ans1 [list set LOADEDMODULES stickysub/dir1/2.0]
234 lappend ans1 [list set __MODULES_LMTAG stickysub/dir1/2.0&super-sticky]
235 testouterr_cmd_re sh {switch stickysub/dir1/2.0} $ans1 {}
236 testouterr_cmd_re sh {switch stickysub stickysub/dir1/2.0} $ans1 {}
237 testouterr_cmd_re sh {switch stickysub/dir1 stickysub/dir1/2.0} $ans1 {}
238
239 set ans2 [list]
240 lappend ans2 [list set __MODULES_LMSTICKYRULE stickysub/dir2/3.0&super-sticky|stickysub]
241 lappend ans2 [list set _LMFILES_ $mp/stickysub/dir2/3.0]
242 lappend ans2 [list set LOADEDMODULES stickysub/dir2/3.0]
243 lappend ans2 [list set __MODULES_LMTAG stickysub/dir2/3.0&super-sticky]
244 testouterr_cmd_re sh {switch stickysub/dir2/3.0} $ans2 {}
245
246 set ans3 [list]
247 lappend ans3 [list set __MODULES_LMSTICKYRULE stickysub/dir2/4.0&super-sticky|stickysub]
248 lappend ans3 [list set _LMFILES_ $mp/stickysub/dir2/4.0]
249 lappend ans3 [list set LOADEDMODULES stickysub/dir2/4.0]
250 lappend ans3 [list set __MODULES_LMTAG stickysub/dir2/4.0&super-sticky]
251 testouterr_cmd_re sh {switch stickysub} $ans3 {}
252 testouterr_cmd_re sh {switch stickysub/dir2} $ans3 {}
253
254 setenv_var TESTSUITE_STICKY_GENERIC 2
255 setenv_var __MODULES_LMSTICKYRULE stickysub/dir1/1.0&super-sticky|stickysub/dir1
256 set ans1 [list]
257 lappend ans1 [list set __MODULES_LMSTICKYRULE stickysub/dir1/2.0&super-sticky|stickysub/dir1]
258 lappend ans1 [list set _LMFILES_ $mp/stickysub/dir1/2.0]
259 lappend ans1 [list set LOADEDMODULES stickysub/dir1/2.0]
260 lappend ans1 [list set __MODULES_LMTAG stickysub/dir1/2.0&super-sticky]
261 testouterr_cmd_re sh {switch stickysub/dir1/2.0} $ans1 {}
262 testouterr_cmd_re sh {switch stickysub/dir1} $ans1 {}
263
264 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {stickysub/dir1/1.0 <sS>} stickysub [err_swoff stickysub/dir1/1.0]]
265 testouterr_cmd_re sh {switch stickysub} ERR $tserr
266 testouterr_cmd_re sh {switch -f stickysub} ERR $tserr
267 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {stickysub/dir1/1.0 <sS>} stickysub/dir2 [err_swoff stickysub/dir1/1.0]]
268 testouterr_cmd_re sh {switch stickysub/dir2} ERR $tserr
269 testouterr_cmd_re sh {switch -f stickysub/dir2} ERR $tserr
270 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {stickysub/dir1/1.0 <sS>} stickysub/dir2/4.0 [err_swoff stickysub/dir1/1.0]]
271 testouterr_cmd_re sh {switch stickysub/dir2/4.0} ERR $tserr
272
273 set ans [list]
274 lappend ans [list set _LMFILES_ $mp/stickysub/dir1/1.0:$mp/stickysub/dir2/4.0:$mp/foo/2.0]
275 lappend ans [list set LOADEDMODULES stickysub/dir1/1.0:stickysub/dir2/4.0:foo/2.0]
276 lappend ans [list ERR]
277 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_load stickysub/dir2/4.0]\n[msg_load foo/2.0]
278 testouterr_cmd_re sh {restore testsuite/home/coll-sticky-6} $ans $tserr
279 testouterr_cmd_re sh {restore -f testsuite/home/coll-sticky-6} $ans $tserr
280
281 setenv_var TESTSUITE_STICKY_GENERIC 3
282 unsetenv_var __MODULES_LMSTICKYRULE
283 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {stickysub/dir1/1.0 <sS>} stickysub [err_swoff stickysub/dir1/1.0]]
284 testouterr_cmd_re sh {switch stickysub} ERR $tserr
285 testouterr_cmd_re sh {switch -f stickysub} ERR $tserr
286
287 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {stickysub/dir1/1.0 <sS>} stickysub/dir1/2.0 [err_swoff stickysub/dir1/1.0]]
288 testouterr_cmd_re sh {switch stickysub/dir1/2.0} ERR $tserr
289 testouterr_cmd_re sh {switch -f stickysub/dir1/2.0} ERR $tserr
290
291 set ans [list]
292 lappend ans [list set _LMFILES_ $mp/stickysub/dir1/1.0:$mp/stickysub/dir2/4.0:$mp/foo/2.0]
293 lappend ans [list set LOADEDMODULES stickysub/dir1/1.0:stickysub/dir2/4.0:foo/2.0]
294 lappend ans [list ERR]
295 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_load stickysub/dir2/4.0]\n[msg_load foo/2.0]
296 testouterr_cmd_re sh {restore testsuite/home/coll-sticky-6} $ans $tserr
297 testouterr_cmd_re sh {restore -f testsuite/home/coll-sticky-6} $ans $tserr
298
299 setenv_var MODULES_ADVANCED_VERSION_SPEC 1
300 setenv_var TESTSUITE_STICKY_GENERIC 4
301 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {stickysub/dir1/1.0 <sS>} stickysub/dir1/2.0 [err_swoff stickysub/dir1/1.0]]
302 testouterr_cmd_re sh {switch stickysub/dir1/2.0} ERR $tserr
303 testouterr_cmd_re sh {switch -f stickysub/dir1/2.0} ERR $tserr
304 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {stickysub/dir1/1.0 <sS>} stickysub/dir1 [err_swoff stickysub/dir1/1.0]]
305 testouterr_cmd_re sh {switch stickysub/dir1} ERR $tserr
306 testouterr_cmd_re sh {switch -f stickysub/dir1} ERR $tserr
307
308 set ans [list]
309 lappend ans [list set __MODULES_LMALTNAME stickysub/dir2/4.0&as|stickysub/default&as|stickysub/latest&as|stickysub/dir2/default&as|stickysub/dir2/latest:foo/2.0&as|foo/default&as|foo/latest]
310 lappend ans [list set _LMFILES_ $mp/stickysub/dir1/1.0:$mp/stickysub/dir2/4.0:$mp/foo/2.0]
311 lappend ans [list set LOADEDMODULES stickysub/dir1/1.0:stickysub/dir2/4.0:foo/2.0]
312 lappend ans [list ERR]
313 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_load stickysub/dir2/4.0]\n[msg_load foo/2.0]
314 testouterr_cmd_re sh {restore testsuite/home/coll-sticky-6} $ans $tserr
315 testouterr_cmd_re sh {restore -f testsuite/home/coll-sticky-6} $ans $tserr
316
317 setenv_var TESTSUITE_STICKY_GENERIC 5
318 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {stickysub/dir1/1.0 <sS>} stickysub/dir1/2.0 [err_swoff stickysub/dir1/1.0]]
319 testouterr_cmd_re sh {switch stickysub/dir1/2.0} ERR $tserr
320 testouterr_cmd_re sh {switch -f stickysub/dir1/2.0} ERR $tserr
321 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {stickysub/dir1/1.0 <sS>} stickysub/dir1 [err_swoff stickysub/dir1/1.0]]
322 testouterr_cmd_re sh {switch stickysub/dir1} ERR $tserr
323 testouterr_cmd_re sh {switch -f stickysub/dir1} ERR $tserr
324
325 set ans [list]
326 lappend ans [list set __MODULES_LMALTNAME stickysub/dir2/4.0&as|stickysub/default&as|stickysub/latest&as|stickysub/dir2/default&as|stickysub/dir2/latest:foo/2.0&as|foo/default&as|foo/latest]
327 lappend ans [list set _LMFILES_ $mp/stickysub/dir1/1.0:$mp/stickysub/dir2/4.0:$mp/foo/2.0]
328 lappend ans [list set LOADEDMODULES stickysub/dir1/1.0:stickysub/dir2/4.0:foo/2.0]
329 lappend ans [list ERR]
330 set tserr [msg_unload {stickysub/dir1/1.0 <sS>} $err_superstickyunload]\n\n[msg_load stickysub/dir2/4.0]\n[msg_load foo/2.0]
331 testouterr_cmd_re sh {restore testsuite/home/coll-sticky-6} $ans $tserr
332 testouterr_cmd_re sh {restore -f testsuite/home/coll-sticky-6} $ans $tserr
333
334 # test purge and reload when sticky module has a dependency
335 unsetenv_var TESTSUITE_STICKY_GENERIC
336 setenv_var MODULES_ADVANCED_VERSION_SPEC 0
337 setenv_var TESTSUITE_STICKY_DEP 1
338 setenv_loaded_module [list foo/2.0 sticky/1.0 bar/2.0] [list $mp/foo/2.0 $mp/sticky/1.0 $mp/bar/2.0]
339 setenv_var __MODULES_LMTAG sticky/1.0&super-sticky
340 setenv_var __MODULES_LMPREREQ sticky/1.0&foo|baz:bar/2.0&sticky/1.0
341
342 set ans [list]
343 lappend ans [list set __MODULES_LMPREREQ sticky/1.0&foo|baz:bar/2.0&sticky/1.0]
344 lappend ans [list set _LMFILES_ $mp/foo/2.0:$mp/sticky/1.0:$mp/bar/2.0]
345 lappend ans [list set LOADEDMODULES foo/2.0:sticky/1.0:bar/2.0]
346 lappend ans [list set __MODULES_LMTAG sticky/1.0&super-sticky]
347 testouterr_cmd_re sh {reload} $ans {}
348 testouterr_cmd_re sh {reload -f} $ans {}
349
350 set ans [list]
351 lappend ans [list set __MODULES_LMPREREQ sticky/1.0&foo|baz]
352 lappend ans [list set _LMFILES_ $mp/foo/2.0:$mp/sticky/1.0]
353 lappend ans [list set LOADEDMODULES foo/2.0:sticky/1.0]
354 lappend ans [list ERR]
355 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_unload foo/2.0 [err_deplo sticky/1.0]]
356 testouterr_cmd_re sh {purge} $ans $tserr
357 set ans [list]
358 lappend ans [list set LOADEDMODULES sticky/1.0]
359 lappend ans [list set _LMFILES_ $mp/sticky/1.0]
360 lappend ans [list set __MODULES_LMPREREQ sticky/1.0&foo|baz]
361 lappend ans [list ERR]
362 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_unload foo/2.0 [err_deplof sticky/1.0]]
363 testouterr_cmd_re sh {purge -f} $ans $tserr
364
365
366 # switch super-sticky module to a module that does not exist
367 unsetenv_var TESTSUITE_STICKY_GENERIC
368 unsetenv_var TESTSUITE_STICKY_DEP
369 unsetenv_var __MODULES_LMPREREQ
370 setenv_loaded_module [list sticky/1.0] [list $mp/sticky/1.0]
371 setenv_var __MODULES_LMTAG sticky/1.0&super-sticky
372
373 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {sticky/1.0 <sS>} sticky/99 [err_swoff sticky/1.0]]
374 testouterr_cmd_re sh {switch sticky/99} ERR $tserr
375 testouterr_cmd_re sh {switch sticky/1.0 sticky/99} ERR $tserr
376
377 set tserr "[msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {sticky/1.0 <sS>} sticky/99 [err_swoff sticky/1.0]]"
378 testouterr_cmd_re sh {switch -f sticky/99} ERR $tserr
379 testouterr_cmd_re sh {switch -f sticky/1.0 sticky/99} ERR $tserr
380
381 # switch super-sticky module to a module that does not exist (generic sticky)
382 setenv_var TESTSUITE_STICKY_GENERIC 1
383 setenv_var __MODULES_LMSTICKYRULE sticky/1.0&super-sticky|sticky
384
385 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {sticky/1.0 <sS>} sticky/99 [err_swoff sticky/1.0] $err_path'sticky/99']
386 testouterr_cmd_re sh {switch sticky/99} ERR $tserr
387 testouterr_cmd_re sh {switch sticky/1.0 sticky/99} ERR $tserr
388
389 set tserr "[msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_switch {sticky/1.0 <sS>} sticky/99 [err_swoff sticky/1.0] $err_path'sticky/99']"
390 testouterr_cmd_re sh {switch -f sticky/99} ERR $tserr
391 testouterr_cmd_re sh {switch -f sticky/1.0 sticky/99} ERR $tserr
392
393 # switch super-sticky module to a module that does not exist (generic sticky and dependencies)
394 setenv_var TESTSUITE_STICKY_DEP 1
395 setenv_loaded_module [list foo/2.0 sticky/1.0 bar/2.0] [list $mp/foo/2.0 $mp/sticky/1.0 $mp/bar/2.0]
396 setenv_var __MODULES_LMTAG sticky/1.0&super-sticky
397 setenv_var __MODULES_LMPREREQ sticky/1.0&foo|baz:bar/2.0&sticky/1.0
398
399 testouterr_cmd_re sh {switch --auto sticky/99} ERR $tserr
400 testouterr_cmd_re sh {switch --auto -f sticky/1.0 sticky/99} ERR $tserr
401 testouterr_cmd_re sh {switch --no-auto sticky/99} ERR $tserr
402 testouterr_cmd_re sh {switch --no-auto -f sticky/99} ERR $tserr
403
404 # switch sticky module within modulefile to a module that does not exist (generic sticky)
405 unsetenv_var TESTSUITE_STICKY_DEP
406 setenv_var TESTSUITE_STICKY_SWITCH_DEP 1
407 setenv_loaded_module [list sticky/1.0] [list $mp/sticky/1.0]
408 setenv_var __MODULES_LMTAG sticky/1.0&super-sticky
409 setenv_var __MODULES_LMSTICKYRULE sticky/1.0&super-sticky|sticky
410 unsetenv_var __MODULES_LMPREREQ
411
412 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_load bar/2.0 [err_conun sticky/1.0] $err_path'sticky/99']
413 testouterr_cmd_re sh {load bar/2.0} ERR $tserr
414
415 set ans [list]
416 lappend ans [list set __MODULES_LMCONFLICT bar/2.0&sticky/1.0]
417 lappend ans [list set __MODULES_LMPREREQ bar/2.0&sticky/99]
418 lappend ans [list set _LMFILES_ $mp/sticky/1.0:$mp/bar/2.0]
419 lappend ans [list set LOADEDMODULES sticky/1.0:bar/2.0]
420 lappend ans [list ERR]
421 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_load bar/2.0 [err_conunf sticky/1.0] $err_path'sticky/99' [err_reqlof sticky/99]]
422 testouterr_cmd_re sh {load -f bar/2.0} $ans $tserr
423
424 setenv_var TESTSUITE_STICKY_SWITCH_DEP 2
425 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_load bar/2.0 [err_conun sticky/1.0] $err_path'sticky/99']
426 testouterr_cmd_re sh {load bar/2.0} ERR $tserr
427
428 set ans [list]
429 lappend ans [list set __MODULES_LMPREREQ bar/2.0&sticky/99]
430 lappend ans [list set _LMFILES_ $mp/sticky/1.0:$mp/bar/2.0]
431 lappend ans [list set LOADEDMODULES sticky/1.0:bar/2.0]
432 lappend ans [list ERR]
433 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_load bar/2.0 [err_conunf sticky/1.0] $err_path'sticky/99' [err_reqlof sticky/99]]
434 testouterr_cmd_re sh {load -f bar/2.0} $ans $tserr
435
436 unsetenv_var TESTSUITE_STICKY_SWITCH_DEP
437
438
439 # test multiple unload tentative of a super-sticky module
440 # should raise only one evaluation error (second evaluation is skipped as it
441 # occurred in same context, same evaluation tree)
442 setenv_var TESTSUITE_STICKY_UNLOAD_DEP 1
443 setenv_loaded_module [list sticky/1.0] [list $mp/sticky/1.0]
444 setenv_var __MODULES_LMTAG sticky/1.0&super-sticky
445
446 set ans [list]
447 lappend ans [list set __MODULES_LMCONFLICT bar/2.0&sticky/1.0]
448 lappend ans [list set _LMFILES_ $mp/sticky/1.0:$mp/bar/2.0]
449 lappend ans [list set LOADEDMODULES sticky/1.0:bar/2.0]
450 lappend ans [list ERR]
451 set tserr [msg_unload {sticky/1.0 <sS>} $err_superstickyunload]\n\n[msg_load bar/2.0 [err_conunf sticky/1.0]]
452 testouterr_cmd_re sh {load -f bar/2.0} $ans $tserr
453
454
455 #
456 # Cleanup
457 #
458
459 reset_test_env