Debian Codegraph @

testsuite/modules.00-init/130-auto_handling.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/06/25
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 auto_handling-related switches and configs.
18 # }C%
19 #
20 ##############################################################################
21
22 set module "prereq/full"
23 set modulefile "$modpath/$module"
24 set module_tron "trace/all_on"
25 set modulefile_tron "$modpath/$module_tron"
26
27 set err_pre [msg_load $module [err_prereq $module_tron]]
28 set err_trace [msg_load "$module_tron <aL>" "$warn_msgs: 'module-trace' command not implemented"]
29 append err_trace \n\n[msg_top_load $module {} $module_tron {}]
30
31 set ans [list]
32 if {[is_conf_enabled advversspec implicitdefault]} {
33 lappend ans [list set __MODULES_LMALTNAME $module_tron&as|trace/default&as|trace/latest]
34 }
35 lappend ans [list set __MODULES_LMPREREQ "$module&$module_tron"]
36 lappend ans [list set testsuite yes]
37 lappend ans [list set _LMFILES_ "$modulefile_tron:$modulefile"]
38 lappend ans [list set LOADEDMODULES "$module_tron:$module"]
39 lappend ans [list set __MODULES_LMTAG $module_tron&auto-loaded]
40
41 #
42 # The tests
43 #
44
45 # test auto_handling set at configure time
46 if {$install_autohandling eq "y"} {
47 testouterr_cmd_re "sh" "load $module" $ans $err_trace
48 } else {
49 testouterr_cmd "sh" "load $module" "ERR" $err_pre
50 }
51
52 # overridden configuration with command-line option
53 testouterr_cmd_re "sh" "load --auto $module" $ans $err_trace
54 testouterr_cmd "sh" "load --no-auto $module" "ERR" $err_pre
55
56 skip_if_quick_mode
57
58
59 # disable auto_handling with environment variable
60 setenv_var MODULES_AUTO_HANDLING 0
61 testouterr_cmd "sh" "load $module" "ERR" $err_pre
62
63 # overridden configuration with command-line option
64 testouterr_cmd_re "sh" "load --auto $module" $ans $err_trace
65 testouterr_cmd "sh" "load --no-auto $module" "ERR" $err_pre
66
67
68 # enable auto_handling with environment variable
69 setenv_var MODULES_AUTO_HANDLING 1
70 testouterr_cmd_re "sh" "load $module" $ans $err_trace
71
72 # overridden configuration with command-line option
73 testouterr_cmd_re "sh" "load --auto $module" $ans $err_trace
74 testouterr_cmd "sh" "load --no-auto $module" "ERR" $err_pre
75
76
77 # bad environment variable value should not interfere
78 setenv_var MODULES_AUTO_HANDLING foo
79 if {$install_autohandling eq "y"} {
80 testouterr_cmd_re "sh" "load $module" $ans $err_trace
81 } else {
82 testouterr_cmd "sh" "load $module" "ERR" $err_pre
83 }
84
85 # overridden configuration with command-line option
86 testouterr_cmd_re "sh" "load --auto $module" $ans $err_trace
87 testouterr_cmd "sh" "load --no-auto $module" "ERR" $err_pre
88
89
90 #
91 # Cleanup
92 #
93
94 reset_test_env