Debian Codegraph @

testsuite/modules.70-maint/410-protected_envvars.exp

raw
1 ##############################################################################
2 # Modules Revision 3.0
3 # Providing a flexible user environment
4 #
5 # File: modules.70-maint/%M%
6 # Revision: %I%
7 # First Edition: 2022/06/01
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Adrien Cotte, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command:
14 # Modulefiles:
15 # Sub-Command:
16 #
17 # Comment: %C{
18 # Test 'protected_envvars' config
19 # }C%
20 #
21 ##############################################################################
22
23 skip_if_quick_mode
24
25 set mp $modpath.3
26 set mpre $modpathre.3
27 setenv_path_var MODULEPATH $mp
28
29 set mod protect/1.0
30 set modname protect
31 set modfile $mp/$mod
32 set modfilere $mpre/$mod
33
34 #
35 # Tests
36 #
37
38 set ans [list]
39 lappend ans [list set _LMFILES_ $modfile]
40 lappend ans [list set LOADEDMODULES $mod]
41 set protectmsg [msg_load $mod "WARNING: Modification of protected environment variable FOO ignored"]
42
43 # Protect "FOO" environment variable
44 setenv_var MODULES_PROTECTED_ENVVARS FOO
45
46 set protectlist [list protectsetenv protectunsetenv protectappend protectprepend]
47 foreach protecttest $protectlist {
48 setenv_var TESTSUITE_PROTECT $protecttest
49 testouterr_cmd bash "load $mod" $ans $protectmsg
50 }
51
52 #
53 # Cleanup
54 #
55
56 reset_test_env