Debian Codegraph @

testsuite/modules.00-init/120-siteconfig.exp

raw
1 ##############################################################################
2 # Modules Revision 3.0
3 # Providing a flexible user environment
4 #
5 # File: modules.00-init/%M%
6 # Revision: %I%
7 # First Edition: 2018/02/22
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Xavier Delaruelle, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command:
14 # Sub-Command:
15 #
16 # Comment: %C{
17 # Check siteconfig superseding mechanism
18 # }C%
19 #
20 ##############################################################################
21
22 skip_if_quick_mode
23
24 proc test_getSiteConfig {siteconfig isvalid islocked} {
25 set siteconfigre [regsub -all "\(\[.+?\]\)" $siteconfig {\\\1}]
26 set siteconfigdbg [expr {$isvalid && !$islocked ? "DEBUG sourceSiteConfig: Source site configuration \\($siteconfigre\\)\\nDEBUG setState: extra_siteconfig_loaded set to '1'\\n" : {}}]
27 set getextrasiteconfigre [expr {!$islocked ? $siteconfigre : {}}]
28 if {[info exists ::env(TESTSUITE_ENABLE_SITECONFIG_NOEXTRASITECONFIG)]} {
29 set mainconfigdbg [expr {[file readable $::siteconfig_file] ? "DEBUG sourceSiteConfig: Source site configuration \\($::siteconfig_filere\\)\\n" : {}}]
30 } else {
31 set mainconfigdbg [expr {[file readable $::siteconfig_file] ? "DEBUG sourceSiteConfig: Source site configuration \\($::siteconfig_filere\\)\\nDEBUG setState: siteconfig_loaded set to '1'\\n" : {}}]
32 }
33
34 set ans [list]
35 if {$isvalid && !$islocked} {
36 lappend ans "someUserProc"
37 }
38 lappend ans "DEBUG setState: cmdline set to '$::MODULECMD sh --no-pager -D -V'"
39 if {$::install_libtclenvmodules ne {n}} {
40 if {$::install_multilibsupport eq {y}} {
41 lappend ans "DEBUG setState: machine set to '$::tcl_platform(machine)'"
42 }
43 lappend ans "DEBUG setConf: tcl_ext_lib set to '$::tclextlib_file'(\\nDEBUG Load Tcl extension library \\(.+\\))?(\\nDEBUG setState: tcl_ext_lib_loaded set to '1')?"
44 }
45 lappend ans "DEBUG setConf: siteconfig set to '$::siteconfig_filere'"
46 lappend ans "${mainconfigdbg}DEBUG setConf: locked_configs set to '$::install_lockedconfigs'"
47 if {[info exists ::env(TESTSUITE_ENABLE_SITECONFIG_NOEXTRASITECONFIG)]} {
48 lappend ans "DEBUG setConf: locked_configs set to 'extra_siteconfig'"
49 lappend ans "DEBUG setState: siteconfig_loaded set to '1'"
50 } elseif {!$islocked} {
51 lappend ans "DEBUG setConf: extra_siteconfig set to '$getextrasiteconfigre'"
52 }
53 lappend ans "${siteconfigdbg}DEBUG setState: supported_shells set to 'sh bash ksh zsh csh tcsh fish cmd tcl perl python ruby lisp cmake r pwsh'"
54 lappend ans "DEBUG setState: shell set to 'sh'"
55 lappend ans "DEBUG setState: subcmd set to ''"
56 lappend ans "DEBUG setState: subcmd_args set to ''"
57 lappend ans "DEBUG setState: init_error_report set to '1'"
58 lappend ans "DEBUG setConf: verbosity set to 'debug'"
59 lappend ans "DEBUG setConf: term_background set to '$::install_termbg'"
60 lappend ans "(DEBUG parseEqualListConfValue: Ignore invalid default.*\\n)?DEBUG setConf: colors set to '.*'"
61 lappend ans "DEBUG setConf: color set to '0'"
62 lappend ans "DEBUG setConf: paginate set to '0'"
63 lappend ans "DEBUG setState: paginate set to '0'"
64 lappend ans "DEBUG setState: report_format set to 'regular'"
65 lappend ans "DEBUG setState: reportfd set to 'stderr'"
66 lappend ans "DEBUG setState: timer set to '0'"
67 lappend ans $::vers_reportre
68 lappend ans "DEBUG setConf: logger set to '$::install_loggercmd'"
69 lappend ans "DEBUG setState: logging set to '0'"
70 lappend ans "DEBUG setState: logfd set to ''"
71 lappend ans "DEBUG setState: error_count set to '0'"
72
73 setenv_var MODULES_SITECONFIG $siteconfig
74 testouterr_cmd_re sh {--no-pager -D -V} {} [join $ans \n]
75 unsetenv_var MODULES_SITECONFIG
76 }
77
78 # check excepted siteconfig file is installed
79 set is_stderr_tty [siteconfig_isStderrTty]
80 if {$is_stderr_tty} {
81
82 # no procedure superseding test, already handled in 100-pager tests
83
84 # test variable superseding
85 setenv_var TESTSUITE_ENABLE_SITECONFIG_DEBUG 1
86
87 set ans [list]
88 lappend ans "DEBUG setState: cmdline set to '$MODULECMD sh -V'"
89 if {$::install_multilibsupport eq {y}} {
90 lappend ans "DEBUG setState: machine set to '$::tcl_platform(machine)'"
91 }
92 lappend ans "DEBUG setConf: tcl_ext_lib set to '$tclextlib_file'(\\nDEBUG Load Tcl extension library \\(.+\\))?(\\nDEBUG setState: tcl_ext_lib_loaded set to '1')?"
93 lappend ans "DEBUG setConf: siteconfig set to '$siteconfig_filere'"
94 lappend ans "DEBUG sourceSiteConfig: Source site configuration \\($siteconfig_filere\\)"
95 lappend ans "DEBUG setState: siteconfig_loaded set to '1'"
96 lappend ans "DEBUG setConf: locked_configs set to '$install_lockedconfigs'"
97 lappend ans "DEBUG setState: supported_shells set to 'sh bash ksh zsh csh tcsh fish cmd tcl perl python ruby lisp cmake r pwsh'"
98 lappend ans "DEBUG setState: shell set to 'sh'"
99 lappend ans "DEBUG setState: subcmd set to ''"
100 lappend ans "DEBUG setState: subcmd_args set to ''"
101 lappend ans "DEBUG setState: init_error_report set to '1'"
102 lappend ans "DEBUG setConf: verbosity set to 'debug'"
103 lappend ans "DEBUG setConf: term_background set to '$install_termbg'"
104 lappend ans "(DEBUG parseEqualListConfValue: Ignore invalid default.*\\n)?DEBUG setConf: colors set to '.*'"
105 lappend ans "DEBUG setConf: color set to '0'"
106 lappend ans "DEBUG setConf: paginate set to '1'"
107 lappend ans "DEBUG setConf: pager set to '$install_pagercmd'"
108 if {$pager_dfl_use} {
109 lappend ans "DEBUG setState: shelltype set to 'sh'"
110 }
111 lappend ans "DEBUG setState: is_stderr_tty set to '1'"
112 lappend ans "DEBUG setState: paginate set to '1'"
113 lappend ans "DEBUG setState: report_format set to 'regular'"
114 lappend ans "DEBUG setState: reportfd set to 'file\\d'"
115 lappend ans "DEBUG setState: timer set to '0'"
116 lappend ans $vers_reportre
117 lappend ans "DEBUG setConf: logger set to '$install_loggercmd'"
118 lappend ans "DEBUG setState: logging set to '0'"
119 lappend ans "DEBUG setState: logfd set to ''"
120 testouterr_cmd_re "sh" "-V" "" [join $ans "\n"]
121
122 # test variable superseding of regular siteconfig file by additional siteconfig file if enabled
123 if {![is_config_locked extra_siteconfig]} {
124 setenv_var MODULES_SITECONFIG testsuite/example/siteconfig.tcl-2
125 testouterr_cmd_re sh {-V} {} $vers_reportre
126 unsetenv_var MODULES_SITECONFIG
127 }
128
129 # restore environment
130 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_DEBUG
131
132
133 # test broken siteconfig file
134 if {$verbose} {
135 send_user "\tSetup TESTSUITE_ENABLE_SITECONFIG_BROKEN = '1'\n"
136 }
137 set env(TESTSUITE_ENABLE_SITECONFIG_BROKEN) 1
138
139 set tserr [escre "$error_msgs: Site configuration source failed
140 invalid command name \"unk_foo\"
141 while executing
142 \"unk_foo<EXM>\"
143 (file \"$siteconfig_file\" line 2)<EXM>"]
144 testouterr_cmd_re sh -V ERR $tserr
145
146 # restore environment
147 if {$verbose} {
148 send_user "\tUnset TESTSUITE_ENABLE_SITECONFIG_BROKEN\n"
149 }
150 unset env(TESTSUITE_ENABLE_SITECONFIG_BROKEN)
151
152
153 # test siteconfig that breaks modulecmd.tcl code
154 setenv_var TESTSUITE_ENABLE_SITECONFIG_BROKEN2 1
155 set ans [list]
156 lappend ans "$error_msgs: invalid command name \"unk_foo\""
157 lappend ans { while executing}
158 lappend ans { "unk_foo"}
159 lappend ans { (procedure "reportVersion" line 2)}
160 lappend ans { invoked from within}
161 lappend ans { "reportVersion"}
162 lappend ans { Please report this issue at https://github.com/envmodules/modules/issues}
163 testouterr_cmd sh {-V} ERR [join $ans \n]
164 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_BROKEN2
165 setenv_var TESTSUITE_ENABLE_SITECONFIG_BROKEN3 1
166 set ans [list]
167 lappend ans "$error_msgs: invalid command name \"reportVersion\""
168 lappend ans { while executing}
169 lappend ans { "reportVersion"}
170 lappend ans { Please report this issue at https://github.com/envmodules/modules/issues}
171 testouterr_cmd sh {-V} ERR [join $ans \n]
172 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_BROKEN3
173
174
175 # test siteconfig file raising error
176 # test parseAccessIssue with custom error code by the way
177 if {$verbose} {
178 send_user "\tSetup TESTSUITE_ENABLE_SITECONFIG_ACCESSERR = '1'\n"
179 }
180 set env(TESTSUITE_ENABLE_SITECONFIG_ACCESSERR) 1
181
182 set tserr [escre "$error_msgs: Site configuration source failed
183 Cannot access 'foo'
184 while executing
185 \"error \[parseAccessIssue \"foo\"\]<EXM>\"
186 (file \"$siteconfig_file\" line 2)<EXM>"]
187 testouterr_cmd_re sh -V ERR $tserr
188
189 # restore environment
190 if {$verbose} {
191 send_user "\tUnset TESTSUITE_ENABLE_SITECONFIG_ACCESSERR\n"
192 }
193 unset env(TESTSUITE_ENABLE_SITECONFIG_ACCESSERR)
194
195
196 # test displayElementList procedure in terse+numbered mode
197 if {$verbose} {
198 send_user "\tSetup TESTSUITE_ENABLE_SITECONFIG_TERSENUM = '1'\n"
199 }
200 set env(TESTSUITE_ENABLE_SITECONFIG_TERSENUM) 1
201
202 set ans [list]
203 lappend ans "test:"
204 lappend ans " 1\\\) elt1 "
205 lappend ans " 2\\\) elt2 "
206 lappend ans " 3\\\) elt3 "
207 lappend ans {}
208 lappend ans $vers_reportre
209 testouterr_cmd_re "sh" "-V" "OK" [join $ans "\n"]
210
211 # restore environment
212 if {$verbose} {
213 send_user "\tUnset TESTSUITE_ENABLE_SITECONFIG_TERSENUM\n"
214 }
215 unset env(TESTSUITE_ENABLE_SITECONFIG_TERSENUM)
216
217 # test displayElementList procedure with a tricky list that triggers unusual condition
218 setenv_var TESTSUITE_ENABLE_SITECONFIG_TRICKYLISTDISP 1
219 set ans "test:
220 1\\) abc/def
221 2\\) abcdefgh/ijklmnop
222 3\\) abc/defg
223 4\\) abcd/ef
224 5\\) abc/defg-hijkl.mn.op
225 6\\) abcdefgh/ijklm.nopqrst
226 7\\) abcdefg/hijklmnop-qr.st.uvw
227 8\\) abcdefgh/ijklmnopqrst-u-vwxy.zA-BCD-E
228 9\\) abcdef/ghijklm-nopq.r_st.uv
229 10\\) abcdefgh/ijklmnop-q-rstu.vw-xyz-A
230 11\\) abcdefg/hijklmn-op.qr.stu
231 12\\) abcdefg/hijkl-mn.op.qrs
232 13\\) abcd/efgh-ij.k
233 14\\) abcdefg/hijk-lmnop_qr.st.uvw
234 15\\) abcdef/ghijklmno-p.q.r
235 16\\) abcdefgh/ijklmn-o-pqrs.tu
236 17\\) abcdefgh/ijklmnop-q-rstu.vw-xyz
237 18\\) abcdefg/hij-klm.nopq
238 19\\) abcdefg/hij-kl.mn.opq
239 20\\) abcdefgh/ijklmnopq_rstuv-w-xyzA.BC-DEF
240 21\\) abcdefgh/ijklmnopqrstuv-w-xyzA.BC
241 22\\) abcdefgh/ij-k-lmno.pq
242 23\\) abcdefgh/ijk-l-mnop.qr-stu
243 24\\) abcdefgh/ijklmnop-qr.st
244 25\\) abcdef/ghijklmno-pq.rs
245 26\\) abcdef/ghi-jklm_no_pqrstuv
246 27\\) abcdefgh/ijk-lm-n-opqr.st
247 28\\) abcdefgh/ijklm-n-opqr.st-uvw
248 29\\) abcdef/ghijklm-nopq_r
249 30\\) abcdefg/hijkl-mn.op.qzs
250 31\\) abcdefg/hijklmn-op.qr.stz
251 32\\) abcdefgh/ijklmn
252
253 $vers_reportre"
254 testouterr_cmd_re "sh" "-V" "OK" $ans
255 # restore environment
256 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_TRICKYLISTDISP
257
258 # test loaded module accessor procedures on non-loaded module
259 # does not happened currently within modulecmd.tcl as there is always a
260 # 'getLoadedModulePropertyList name' retrieval or a isModuleLoaded call prior
261 # use of get accessor
262 if {$verbose} {
263 send_user "\tSetup TESTSUITE_ENABLE_SITECONFIG_LMACCESSOR = '1'\n"
264 }
265 set env(TESTSUITE_ENABLE_SITECONFIG_LMACCESSOR) 1
266
267 set ans [list]
268 lappend ans ""
269 lappend ans ""
270 lappend ans ""
271 lappend ans $vers_reportre
272 testouterr_cmd_re "sh" "-V" "OK" [join $ans "\n"]
273
274 # restore environment
275 if {$verbose} {
276 send_user "\tUnset TESTSUITE_ENABLE_SITECONFIG_LMACCESSOR\n"
277 }
278 unset env(TESTSUITE_ENABLE_SITECONFIG_LMACCESSOR)
279
280
281 # test path variable handling on Windows platform (';' separator is used
282 # instead of ':')
283 if {$verbose} {
284 send_user "\tSetup TESTSUITE_ENABLE_SITECONFIG_WINDOWS_PLATFORM = '1'\n"
285 }
286 set env(TESTSUITE_ENABLE_SITECONFIG_WINDOWS_PLATFORM) 1
287
288 set env(PATH) "/path/to/dir1"
289 set module "append/2.0"
290 set modulefile "$modpath/$module"
291
292 set ans [list]
293 lappend ans [list set PATH "/path/to/dir1;/this/is/the/modules/testsuite"]
294 lappend ans [list set _LMFILES_ $modulefile]
295 lappend ans [list set LOADEDMODULES $module]
296 testouterr_cmd "cmd" "load $module" $ans ""
297
298 set env(PATH) "/path/to/dir1;/this/is/the/modules/testsuite"
299
300 set ans [list]
301 lappend ans [list set __MODULES_SHARE_PATH "/this/is/the/modules/testsuite;2"]
302 lappend ans [list set PATH "/path/to/dir1;/this/is/the/modules/testsuite"]
303 lappend ans [list set _LMFILES_ $modulefile]
304 lappend ans [list set LOADEDMODULES $module]
305 testouterr_cmd "cmd" "load $module" $ans ""
306
307 set env(__MODULES_SHARE_PATH) "/this/is/the/modules/testsuite;2"
308
309 set ans [list]
310 lappend ans [list set __MODULES_SHARE_PATH "/this/is/the/modules/testsuite;3"]
311 lappend ans [list set PATH "/path/to/dir1;/this/is/the/modules/testsuite"]
312 lappend ans [list set _LMFILES_ $modulefile]
313 lappend ans [list set LOADEDMODULES $module]
314 testouterr_cmd "cmd" "load $module" $ans ""
315
316 setenv_path_var PATH $ORIG_PATH
317
318 set tserr "$error_msgs: No autoinit mode available for 'pwsh' shell on Windows"
319 testouterr_cmd pwsh autoinit ERR $tserr
320
321 # restore environment
322 if {$verbose} {
323 send_user "\tUnset TESTSUITE_ENABLE_SITECONFIG_WINDOWS_PLATFORM\n"
324 }
325 unset env(TESTSUITE_ENABLE_SITECONFIG_WINDOWS_PLATFORM)
326
327
328 # test getDiffBetweenList procedure with element of second list arg not in first list arg
329 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETDIFFBETWEENLIST 1
330
331 set ans [list]
332 lappend ans "{foo foo2} {bar bar2}"
333 lappend ans $vers_reportre
334 testouterr_cmd_re sh -V OK [join $ans \n]
335
336 # restore environment
337 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETDIFFBETWEENLIST
338
339
340 # test getDiffBetweenArray procedure with element of first list arg with empty value
341 # not in second list arg (notset_equals_empty option enabled)
342 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETDIFFBETWEENARRAY 1
343
344 set ans [list]
345 lappend ans "{} {} {}"
346 lappend ans $vers_reportre
347 testouterr_cmd_re sh -V OK [join $ans \n]
348
349 # restore environment
350 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETDIFFBETWEENARRAY
351
352
353 # test clear sub-command confirmation message without waiting indefinitely
354 if {$is_stdin_tty} {
355 setenv_var TESTSUITE_ENABLE_SITECONFIG_EXITONGETSSTDIN 1
356
357 set tserr "(Are you sure you want to clear all loaded modules\\!\\? \\\[n\\\] )"
358 testouterr_cmd_re sh clear {} $tserr
359
360 # restore environment
361 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_EXITONGETSSTDIN
362 } elseif {$verbose} {
363 send_user "\tSkip tests relying on a stdin channel attached to a tty\n"
364 }
365
366 # test extra siteconfig disablement
367 setenv_var TESTSUITE_ENABLE_SITECONFIG_NOEXTRASITECONFIG 1
368
369 test_getSiteConfig testsuite/example/siteconfig.tcl-2 0 1
370
371 # restore environment
372 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_NOEXTRASITECONFIG
373
374
375 # test tcl ext lib load on an incompatible interp if available
376 if {[info exists tclextlib_file] && [file executable ./tclsh83]} {
377 setenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBLOAD83 1
378
379 set tserr [escre "$error_msgs: Site configuration source failed
380 version conflict for package \"Tcl\": have 8.3, need 8.5-
381 while executing
382 \"exec ./tclsh83 << \"load \[getConf tcl_ext_lib\] Envmodules\"<EXM>\"
383 (file \"$siteconfig_file\" line 2)<EXM>"]
384 testouterr_cmd_re sh -V ERR $tserr
385
386 # restore environment
387 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBLOAD83
388 } elseif {$verbose} {
389 send_user "\tSkip tcl ext lib load tests with tclsh83 as either ext lib or tclsh83 is not available\n"
390 }
391
392 # test tcl ext lib procedures against erroneous calls
393 if {[info exists tclextlib_file]} {
394 setenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBBADCALL 1
395 set ans [list]
396 lappend ans "$error_msgs: wrong # args: should be \"readFile filename \\?firstline\\? \\?must_have_cookie\\?\""
397 lappend ans "$error_msgs: expected boolean value but got \"bar\""
398 lappend ans "$error_msgs: expected boolean value but got \"bar\""
399 lappend ans "$error_msgs: wrong # args: should be \"readFile filename \\?firstline\\? \\?must_have_cookie\\?\""
400 lappend ans "$error_msgs: wrong # args: should be \"getFilesInDirectory dir fetch_dotversion\""
401 lappend ans "$error_msgs: expected boolean value but got \"bar\""
402 lappend ans $vers_reportre
403 testouterr_cmd_re sh -V OK [join $ans \n]
404
405 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBBADCALL
406 } elseif {$verbose} {
407 send_user "\tSkip tcl ext lib erroneous procedure calls as ext lib is not available\n"
408 }
409
410 # test tcl ext lib procedures against a failed closedir call
411 if {[info exists closedirlib_file] && [file exists $closedirlib_file]} {
412 setenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBFAILEDCLOSEDIR 1
413 if {$tcl_platform(os) ne "Darwin"} {
414 setenv_var LD_PRELOAD $closedirlib_file
415 } else {
416 setenv_var DYLD_INSERT_LIBRARIES $closedirlib_file
417 }
418 set ans [list]
419 lappend ans "$error_msgs: couldn't close directory \"$modpathre\": .*"
420 lappend ans $vers_reportre
421 testouterr_cmd_re sh -V OK [join $ans \n]
422
423 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBFAILEDCLOSEDIR
424 if {$tcl_platform(os) ne "Darwin"} {
425 unsetenv_var LD_PRELOAD
426 } else {
427 unsetenv_var DYLD_INSERT_LIBRARIES
428 }
429 } elseif {$verbose} {
430 send_user "\tSkip tcl ext lib erroneous procedure calls as closedir test lib is not available\n"
431 }
432
433 # test tcl ext lib procedures against a failed getpwuid call
434 if {[info exists getpwuidlib_file] && [file exists $getpwuidlib_file]} {
435 setenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBFAILEDGETPWUID 1
436 if {$tcl_platform(os) ne "Darwin"} {
437 setenv_var LD_PRELOAD $getpwuidlib_file
438 } else {
439 setenv_var DYLD_INSERT_LIBRARIES $getpwuidlib_file
440 }
441 set ans [list]
442 lappend ans "$error_msgs: couldn't find name for user id \"$userid\": .*"
443 if {$tcl_platform(os) eq "Darwin"} {
444 lappend ans "$error_msgs: couldn't find name for user id \"$userid\": .*"
445 }
446 lappend ans $vers_reportre
447 testouterr_cmd_re sh -V OK [join $ans \n]
448
449 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBFAILEDGETPWUID
450 if {$tcl_platform(os) ne "Darwin"} {
451 unsetenv_var LD_PRELOAD
452 } else {
453 unsetenv_var DYLD_INSERT_LIBRARIES
454 }
455 } elseif {$verbose} {
456 send_user "\tSkip tcl ext lib erroneous procedure calls as getpwuid test lib is not available\n"
457 }
458
459 # getgroups syscall is not used on Darwin
460 if {$tcl_platform(os) ne "Darwin"} {
461 # test tcl ext lib procedures against a failed getgroups call
462 if {[info exists getgroupslib_file] && [file exists $getgroupslib_file]} {
463 setenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBFAILEDGETGROUPS 1
464 setenv_var LD_PRELOAD $getgroupslib_file
465 set ans [list]
466 lappend ans "$error_msgs: couldn't get supplementary groups: .*"
467 lappend ans $vers_reportre
468 testouterr_cmd_re sh -V OK [join $ans \n]
469
470 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBFAILEDGETGROUPS
471 unsetenv_var LD_PRELOAD
472 } elseif {$verbose} {
473 send_user "\tSkip tcl ext lib erroneous procedure calls as getgroups test lib is not available\n"
474 }
475
476 # test tcl ext lib procedures against a zero result getgroups call
477 if {[info exists 0getgroupslib_file] && [file exists $0getgroupslib_file]} {
478 setenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIB0GETGROUPS 1
479 setenv_var LD_PRELOAD $0getgroupslib_file
480 set ans [list]
481 lappend ans [exec id -g -n]
482 lappend ans $vers_reportre
483 testouterr_cmd_re sh -V OK [join $ans \n]
484
485 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIB0GETGROUPS
486 unsetenv_var LD_PRELOAD
487 } elseif {$verbose} {
488 send_user "\tSkip tcl ext lib erroneous procedure calls as 0getgroups test lib is not available\n"
489 }
490
491 # test tcl ext lib procedures against a duplicate entries in result getgroups call
492 if {[info exists dupgetgroupslib_file] && [file exists $dupgetgroupslib_file]} {
493 setenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBDUPGETGROUPS 1
494 setenv_var LD_PRELOAD $dupgetgroupslib_file
495 set ans [list]
496 lappend ans [exec id -g -n]
497 lappend ans $vers_reportre
498 testouterr_cmd_re sh -V OK [join $ans \n]
499
500 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBDUPGETGROUPS
501 unsetenv_var LD_PRELOAD
502 } elseif {$verbose} {
503 send_user "\tSkip tcl ext lib erroneous procedure calls as dupgetgroups test lib is not available\n"
504 }
505 }
506
507 # test tcl ext lib procedures against a failed time call
508 if {[info exists timelib_file] && [file exists $timelib_file]} {
509 setenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBFAILEDTIME 1
510 if {$tcl_platform(os) ne "Darwin"} {
511 setenv_var LD_PRELOAD $timelib_file
512 } else {
513 setenv_var DYLD_INSERT_LIBRARIES $timelib_file
514 }
515 set ans [list]
516 lappend ans "$error_msgs: couldn't get Epoch time: .*"
517 lappend ans $vers_reportre
518 testouterr_cmd_re sh -V OK [join $ans \n]
519
520 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBFAILEDTIME
521 if {$tcl_platform(os) ne "Darwin"} {
522 unsetenv_var LD_PRELOAD
523 } else {
524 unsetenv_var DYLD_INSERT_LIBRARIES
525 }
526 } elseif {$verbose} {
527 send_user "\tSkip tcl ext lib erroneous procedure calls as time test lib is not available\n"
528 }
529
530 # test tcl ext lib procedures called without argument
531 setenv_var TESTSUITE_ENABLE_SITECONFIG_PARSEDATETIMEARG_NOARG 1
532 set ans [list]
533 lappend ans "$error_msgs: wrong # args: should be \"parseDateTimeArg opt datetime\""
534 lappend ans $vers_reportre
535 testouterr_cmd_re sh -V OK [join $ans \n]
536 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_PARSEDATETIMEARG_NOARG
537
538 # test tcl ext lib procedures against a failed mktime call
539 if {[info exists mktimelib_file] && [file exists $mktimelib_file]} {
540 setenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBFAILEDMKTIME 1
541 if {$tcl_platform(os) ne "Darwin"} {
542 setenv_var LD_PRELOAD $mktimelib_file
543 } else {
544 setenv_var DYLD_INSERT_LIBRARIES $mktimelib_file
545 }
546 set ans [list]
547 lappend ans "$error_msgs: couldn't convert to Epoch time: .*"
548 lappend ans $vers_reportre
549 testouterr_cmd_re sh -V OK [join $ans \n]
550
551 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBFAILEDMKTIME
552 if {$tcl_platform(os) ne "Darwin"} {
553 unsetenv_var LD_PRELOAD
554 } else {
555 unsetenv_var DYLD_INSERT_LIBRARIES
556 }
557 } elseif {$verbose} {
558 send_user "\tSkip tcl ext lib erroneous procedure calls as mktime test lib is not available\n"
559 }
560
561 # test tcl ext lib procedures called with badly formatted date
562 setenv_var TESTSUITE_ENABLE_SITECONFIG_PARSEDATETIMEARG_BADDATE 1
563 set ans [list]
564 lappend ans "$error_msgs: Incorrect --before value '2020-09-19U20:00' \\\(valid date time format is 'YYYY-MM-DD\\\[THH:MM\\\]'\\\)"
565 lappend ans $vers_reportre
566 testouterr_cmd_re sh -V OK [join $ans \n]
567 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_PARSEDATETIMEARG_BADDATE
568
569 # specific tests to improve modEq procs coverage
570 setenv_var TESTSUITE_ENABLE_SITECONFIG_MODEQ 1
571 setenv_var MODULES_ADVANCED_VERSION_SPEC 1
572 set ans [list]
573 lappend ans 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1
574 lappend ans 1 0 1 1 0 1 1 0 1 1 0 1
575 lappend ans 1 0 0 1 0 0 1 0 0 1 0 0
576 lappend ans 1 0 1 1 0 1 1 0 1 1 0 1
577 lappend ans $vers_reportre
578 testouterr_cmd_re sh -V OK [join $ans \n]
579 unsetenv_var MODULES_ADVANCED_VERSION_SPEC
580 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_MODEQ
581
582 # test redefinition of on-the-fly procedures
583 setenv_var TESTSUITE_ENABLE_SITECONFIG_REDEFONTHEFLYPROCS 1
584 set ans [list]
585 lappend ans 0 1 0 0 1 0 0 1 1 0 1 1
586 lappend ans 1 0 0 1 0 0 1 0 1 1 0 1
587 lappend ans 1 0 0 1 0 0 1 0 1 1 0 1
588 lappend ans $vers_reportre
589 testouterr_cmd_re sh -V OK [join $ans \n]
590 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_REDEFONTHEFLYPROCS
591
592 # test redefinition of defineGetEqArrayKeyProc: the same implicit_default
593 # value called twice in a row is a no-op (the currently active variant
594 # already matches), then a different value each time demonstrates renaming
595 # the previously active variant back before renaming the new one in
596 setenv_var TESTSUITE_ENABLE_SITECONFIG_REDEFGETEQARRAYKEYPROC 1
597 set ans [list]
598 lappend ans foo/1.0 foo/1.0 foo/1.0 foo/1.0
599 lappend ans $vers_reportre
600 testouterr_cmd_re sh -V OK [join $ans \n]
601 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_REDEFGETEQARRAYKEYPROC
602
603 # test getMatchingTagList's "tag already seen earlier in this same call"
604 # skip path, forced through a duplicate tag entry directly in the global tag
605 # structures since normal module-tag usage always dedupes by tag name
606 setenv_var TESTSUITE_ENABLE_SITECONFIG_DUPTAGROOT 1
607 set ans [list]
608 lappend ans sometag
609 lappend ans $vers_reportre
610 testouterr_cmd_re sh -V OK [join $ans \n]
611 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_DUPTAGROOT
612
613 # test getAvailListFromVersSpec's unregistered-modarg path, not reachable
614 # through its only real caller since every modarg reaching it there is
615 # already registered through parseModuleSpecification
616 setenv_var TESTSUITE_ENABLE_SITECONFIG_AVAILLISTUNREG 1
617 set ans [list]
618 lappend ans 0
619 lappend ans $vers_reportre
620 testouterr_cmd_re sh -V OK [join $ans \n]
621 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_AVAILLISTUNREG
622
623 # test the single-element validvallist "string is" class check path in
624 # getConf, not exercised by any current config option's own shape
625 setenv_var TESTSUITE_ENABLE_SITECONFIG_VALIDVALLISTSTRINGIS 1
626 set ans [list]
627 lappend ans 42
628 lappend ans $vers_reportre
629 testouterr_cmd_re sh -V OK [join $ans \n]
630 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_VALIDVALLISTSTRINGIS
631
632 # test the generic intvallist conversion path in getConf when no initproc is
633 # set, not exercised by any current config option's own shape
634 setenv_var TESTSUITE_ENABLE_SITECONFIG_INTVALLISTCONV 1
635 set ans [list]
636 lappend ans 20
637 lappend ans $vers_reportre
638 testouterr_cmd_re sh -V OK [join $ans \n]
639 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_INTVALLISTCONV
640
641 # specific tests to improve formatErrStackTrace proc coverage
642 setenv_var TESTSUITE_ENABLE_SITECONFIG_FORMATERRSTACKTRACE 1
643 set ans [list]
644 lappend ans {error message
645 while executing
646 foo call
647 invoked from within
648 foo
649 \(file "foo"\)}
650 lappend ans $vers_reportre
651 testouterr_cmd_re sh -V OK [join $ans \n]
652 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_FORMATERRSTACKTRACE
653
654 # specific test to improve formatErrStackTrace proc coverage: topmost stack
655 # frame is itself an 'eval [...]' wrapper
656 setenv_var TESTSUITE_ENABLE_SITECONFIG_FORMATERRSTACKTRACE_EVAL 1
657 set ans [list]
658 lappend ans {}
659 lappend ans { \(file "foo"\)}
660 lappend ans $vers_reportre
661 testouterr_cmd_re sh -V OK [join $ans \n]
662 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_FORMATERRSTACKTRACE_EVAL
663
664 # produce an unknown error in a modulecmd.tcl procedure during a modulefile evaluation
665 setenv_var TESTSUITE_ENABLE_SITECONFIG_UNKINTERRDURINGMODEVAL 1
666 set ans [msg_moderr {invalid command name "foo"} {foo} $modpath/setenv/1.0 30 {} {} {} { (procedure "getModshareVarName" line 2)
667 invoked from within
668 "getModshareVarName $var"
669 (procedure "setenv" line 9)
670 invoked from within
671 "setenv testsuite "yes""}]
672 testouterr_cmd sh {load setenv/1.0} ERR [msg_load setenv/1.0 $ans]
673 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_UNKINTERRDURINGMODEVAL
674
675
676 # getModuleDesignation coverage test
677 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETMODULEDESIGNATION 1
678 setenv_var MODULES_ADVANCED_VERSION_SPEC 1
679 setenv_loaded_module [list variant/1.0] [list $modpath.3/variant/1.0]
680 setenv_var __MODULES_LMVARIANT variant/1.0&foo|val1|0&bar|val3|0
681 set ans [list]
682 lappend ans variant/1.0{bar=val3:foo=val1}
683 lappend ans $vers_reportre
684 testouterr_cmd_re sh -V OK [join $ans \n]
685 unsetenv_loaded_module
686 unsetenv_var __MODULES_LMVARIANT
687 unsetenv_var MODULES_ADVANCED_VERSION_SPEC
688 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETMODULEDESIGNATION
689
690 # unsetModuleTag/unsetModuleExtraTag coverage test
691 setenv_var TESTSUITE_ENABLE_SITECONFIG_UNSETMODULETAG 1
692 set ans [list]
693 lappend ans $vers_reportre
694 testouterr_cmd_re sh -V OK [join $ans \n]
695 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_UNSETMODULETAG
696
697 # readCollectionContent coverage test
698 setenv_var TESTSUITE_ENABLE_SITECONFIG_READCOLLCONTENT 1
699 set tserr "$error_msgs: Collection unk cannot be read.\n [couldnotopen_nofile /path/to/unk]"
700 testouterr_cmd_re sh -V ERR $tserr
701 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_READCOLLCONTENT
702
703 # getInterpVar coverage test
704 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETINTERPVAR 1
705 set ans [list]
706 lappend ans undef
707 lappend ans value
708 lappend ans $vers_reportre
709 testouterr_cmd_re sh -V OK [join $ans \n]
710 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETINTERPVAR
711
712 # getLoadingModuleFileList coverage test
713 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETLOADINGMODULEFILELIST 1
714 set ans [list]
715 lappend ans {/path/to/foo/1.0 /path/to/qux/1.0}
716 lappend ans $vers_reportre
717 testouterr_cmd_re sh -V OK [join $ans \n]
718 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETLOADINGMODULEFILELIST
719
720 # getModuleFromLoadingModulefile coverage test
721 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETMODULEFROMLOADINGMODULEFILE 1
722 set ans [list]
723 lappend ans qux/1.0
724 lappend ans $vers_reportre
725 testouterr_cmd_re sh -V OK [join $ans \n]
726 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETMODULEFROMLOADINGMODULEFILE
727
728 # reportFinalError coverage tests
729 if {[info exists tclextlib_file]} {
730 setenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORTCLCOMPAT 1
731 set ans [list]
732 lappend ans "$error_msgs: interpreter uses an incompatible stubs mechanism"
733 lappend ans { while executing}
734 lappend ans { "error {interpreter uses an incompatible stubs mechanism}"}
735 lappend ans { (procedure "reportVersion" line 2)}
736 lappend ans { invoked from within}
737 lappend ans { "reportVersion"}
738 testouterr_cmd sh {-V} ERR [join $ans \n]
739 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORTCLCOMPAT
740
741 setenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORLIBCOMPAT 1
742 set ans [list]
743 lappend ans "$error_msgs: dlopen(/usr/local/Modules/lib/libtclenvmodules.dylib, 0x000A): tried: '/usr/local/Modules/lib/libtclenvmodules.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))"
744 lappend ans { while executing}
745 lappend ans " \"error \{dlopen(/usr/local/Modules/lib/libtclenvmodules.dylib, 0x000A): tried: '/usr/local/Modules/lib/libtclenvmodules.dylib' (mach-o file, but is an i...\""
746 lappend ans { (procedure "reportVersion" line 2)}
747 lappend ans { invoked from within}
748 lappend ans { "reportVersion"}
749 testouterr_cmd sh {-V} ERR [join $ans \n]
750 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORLIBCOMPAT
751
752 setenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORTCLINSTALL 1
753 set ans [list]
754 lappend ans "$error_msgs: Can't find a usable init.tcl in the following directories:
755 /root/lib/tcl8.6 /usr/lib/tcl8.6 /lib/tcl8.6 /usr/library /library /tcl8.6.14/library /tcl8.6.14/library
756
757 This probably means that Tcl wasn't installed properly."
758 lappend ans { while executing}
759 lappend ans " \"error \{Can't find a usable init.tcl in the following directories:
760 /root/lib/tcl8.6 /usr/lib/tcl8.6 /lib/tcl8.6 /usr/library /library /tcl8.6.14/librar...\""
761 lappend ans { (procedure "reportVersion" line 2)}
762 lappend ans { invoked from within}
763 lappend ans { "reportVersion"}
764 testouterr_cmd sh {-V} ERR [join $ans \n]
765 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORTCLINSTALL
766 }
767 setenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORTCLINIT 1
768 set ans [list]
769 lappend ans "$error_msgs: invalid command name \"tcl::mathfunc::max\""
770 lappend ans { while executing}
771 lappend ans { "tcl::mathfunc::max [expr {($tty_cols - $len - 2)/2}] 1"}
772 lappend ans { (procedure "displaySeparatorLine" line 10)}
773 lappend ans { invoked from within}
774 lappend ans { "displaySeparatorLine $header $sgrkey $extra"}
775 lappend ans { (procedure "displayElementList" line 19)}
776 lappend ans { invoked from within}
777 lappend ans { "displayElementList $header $hsgrkey $hstyle $one_per_line $show_idx 1 $display_list $len_list $via_list"}
778 lappend ans { (procedure "reportModules" line 148)}
779 lappend ans { invoked from within}
780 lappend ans { "reportModules $args $dir mp $hstyle $show_mtime 0 $one_per_line $theader_cols hidden-loaded"}
781 lappend ans { (procedure "cmdModuleAvail" line 43)}
782 lappend ans { invoked from within}
783 lappend ans { "{*}[formatModuleCommand 1 $command load $tag_list $addpath_pos $show_oneperline $show_mtime $show_filter $search_filter $search_match $dump_state $par..."}
784 lappend ans { (procedure "moduleTop" line 30)}
785 lappend ans { invoked from within}
786 lappend ans { "{*}$execcmdlist"}
787 testouterr_cmd sh {avail} ERR [join $ans \n]
788 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORTCLINIT
789
790 setenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORRESSOURCEUNAVAIL 1
791 set ans [list]
792 lappend ans "$error_msgs: couldn't fork child process: resource temporarily unavailable"
793 lappend ans { while executing}
794 lappend ans { "error {couldn't fork child process: resource temporarily unavailable}"}
795 lappend ans { (procedure "reportVersion" line 2)}
796 lappend ans { invoked from within}
797 lappend ans { "reportVersion"}
798 testouterr_cmd sh {-V} ERR [join $ans \n]
799 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORRESSOURCEUNAVAIL
800
801 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETMODULEFROMEVALID 1
802 set ans [list]
803 lappend ans 0
804 lappend ans $vers_reportre
805 testouterr_cmd_re sh -V OK [join $ans \n]
806 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETMODULEFROMEVALID
807
808 setenv_var TESTSUITE_ENABLE_SITECONFIG_CHANGECONTEXTOFMODULEEVAL 1
809 set ans [list]
810 lappend ans 0
811 lappend ans $vers_reportre
812 testouterr_cmd_re sh -V OK [join $ans \n]
813
814 setenv_var TESTSUITE_ENABLE_SITECONFIG_CHANGECONTEXTOFMODULEEVAL 2
815 set ans [list]
816 lappend ans 0
817 lappend ans $vers_reportre
818 testouterr_cmd_re sh -V OK [join $ans \n]
819 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_CHANGECONTEXTOFMODULEEVAL
820
821 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETLOADEDPREREQPATH 1
822 set ans [list]
823 lappend ans 0
824 lappend ans $vers_reportre
825 testouterr_cmd_re sh -V OK [join $ans \n]
826 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETLOADEDPREREQPATH
827
828 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETMODULEFILEFROMLOADINGMODULE 1
829 set ans [list]
830 lappend ans 0
831 lappend ans $vers_reportre
832 testouterr_cmd_re sh -V OK [join $ans \n]
833 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETMODULEFILEFROMLOADINGMODULE
834
835 setenv_var TESTSUITE_ENABLE_SITECONFIG_UNKNOWNSTATE 1
836 set ans [list]
837 lappend ans 0
838 lappend ans $vers_reportre
839 testouterr_cmd_re sh -V OK [join $ans \n]
840 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_UNKNOWNSTATE
841
842 setenv_var TESTSUITE_ENABLE_SITECONFIG_RELEASESTATE 1
843 set ans [list]
844 lappend ans $install_release
845 lappend ans $vers_reportre
846 testouterr_cmd_re sh -V OK [join $ans \n]
847 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_RELEASESTATE
848
849 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETHELPLINES 1
850 set ans [list]
851 lappend ans 0
852 lappend ans $vers_reportre
853 testouterr_cmd_re sh -V OK [join $ans \n]
854 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETHELPLINES
855
856 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETCMPSPECFROMVERSSPEC 1
857 set ans [list]
858 lappend ans eq
859 lappend ans $vers_reportre
860 testouterr_cmd_re sh -V OK [join $ans \n]
861 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETCMPSPECFROMVERSSPEC
862
863 setenv_var TESTSUITE_ENABLE_SITECONFIG_ID 1
864 set ans [list]
865 lappend ans {user wheel mock}
866 lappend ans $vers_reportre
867 testouterr_cmd_re sh -V OK [join $ans \n]
868 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_ID
869
870 setenv_var TESTSUITE_ENABLE_RUNENVCOMMAND_UNSET 1
871 set ans [list]
872 lappend ans {ok}
873 lappend ans $vers_reportre
874 testouterr_cmd_re sh -V OK [join $ans \n]
875 unsetenv_var TESTSUITE_ENABLE_RUNENVCOMMAND_UNSET
876
877 setenv_var TESTSUITE_ENABLE_SITECONFIG_COMPUTEOUTPUTGRID 1
878 set ans [list]
879 lappend ans {0 0 \{0\}}
880 lappend ans $vers_reportre
881 testouterr_cmd_re sh -V OK [join $ans \n]
882 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_COMPUTEOUTPUTGRID
883
884 setenv_var TESTSUITE_ENABLE_SITECONFIG_GETVIAMODULEMODULEPATH 1
885 set ans [list]
886 lappend ans 0
887 lappend ans $vers_reportre
888 testouterr_cmd_re sh -V OK [join $ans \n]
889 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_GETVIAMODULEMODULEPATH
890
891 setenv_var TESTSUITE_ENABLE_SITECONFIG_REPLACEFIRSTINSTR 1
892 set ans [list]
893 lappend ans string
894 lappend ans $vers_reportre
895 testouterr_cmd_re sh -V OK [join $ans \n]
896 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_REPLACEFIRSTINSTR
897
898 setenv_var TESTSUITE_ENABLE_SITECONFIG_INITCONFINITENVVARS 1
899 unsetenv_var MODULES_INIT_ENVVARS
900 set ans [list]
901 lappend ans "$warn_msgs: Ignore invalid default value for 'init_envvars' config \\(FOO\\)"
902 lappend ans 0
903 lappend ans $vers_reportre
904 testouterr_cmd_re sh -V OK [join $ans \n]
905 unsetenv_var TESTSUITE_ENABLE_SITECONFIG_INITCONFINITENVVARS
906
907 } elseif {$verbose} {
908 send_user "\tSkip tests relying on an excepted siteconfig file installed\n"
909 }
910
911 # test siteconfig override using MODULES_SITECONFIG
912 # when set to an unexistent file
913 test_getSiteConfig /path/to/unexistent/file 0 [is_config_locked extra_siteconfig]
914 test_getSiteConfig {} 0 [is_config_locked extra_siteconfig]
915 # when set to a valid Tcl script (depends if extra siteconfig is allowed)
916 test_getSiteConfig $env(TESTSUITEDIR)/example/siteconfig.tcl-2 1 [is_config_locked extra_siteconfig]
917 test_getSiteConfig testsuite/example/siteconfig.tcl-2 1 [is_config_locked extra_siteconfig]
918
919
920 #
921 # Clean up variables used in this test case
922 #
923
924 reset_test_env
925
926 # remove test procedure
927 rename test_getSiteConfig {}