Debian Codegraph @

testsuite/modules.70-maint/180-reload.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: 2018/03/06
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Jens Hamisch, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command: reload
14 # Modulefiles: setenv/1.0
15 # Sub-Command:
16 #
17 # Comment: %C{
18 # Tests the module command 'reload'
19 # }C%
20 #
21 ##############################################################################
22
23 # ensure auto symbolic versions are not set for these tests
24 setenv_var MODULES_ADVANCED_VERSION_SPEC 0
25
26 #
27 # Variables. This test forces a module load command. It will result in the
28 # environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
29 # be set up
30 #
31
32 set module "setenv/1.0"
33 set modulefile "$modpath/$module"
34
35 lappend ans [list set _LMFILES_ $modulefile]
36 lappend ans [list set LOADEDMODULES $module]
37 lappend ans [list set testsuite "yes"]
38
39 #
40 # Set up the environment pointing to the single module file being load
41 #
42
43 setenv_loaded_module $module $modulefile
44
45 #
46 # The tests
47 #
48
49 test_cmd "sh" "reload" $ans
50 test_cmd "sh" "update" $ans
51
52 skip_if_quick_mode
53
54 # command nickname tests
55 test_cmd "sh" "rel" $ans
56 test_cmd "sh" "up" $ans
57
58
59 # setup LOADEDMODULES/_LMFILES_ with an empty element
60 setenv_loaded_module [list {} $module] [list {} $modulefile]
61
62 set ans [list]
63 # empty elements are ignored then cleared from variable
64 lappend ans [list set _LMFILES_ "$modulefile"]
65 lappend ans [list set LOADEDMODULES "$module"]
66 lappend ans [list set testsuite "yes"]
67
68 test_cmd_re "sh" "reload" $ans
69
70 # restore LOADEDMODULES/_LMFILES_
71 setenv_loaded_module $module $modulefile
72
73
74 #
75 # reload when loaded environment is inconsistent
76 #
77
78 setenv_loaded_module [list foo bar] "/path/to/foo"
79
80 testouterr_cmd_re "sh" "reload" "ERR" "$err_loinconsist\n LOADEDMODULES=foo bar\n _LMFILES_=/path/to/foo"
81
82
83 #
84 # Cleanup
85 #
86
87 reset_test_env