Debian Codegraph @

testsuite/modules.10-use/090-bad.exp

raw
1 ##############################################################################
2 # Modules Revision 3.0
3 # Providing a flexible user environment
4 #
5 # File: modules.20-locate/%M%
6 # Revision: %I%
7 # First Edition: 2017/05/27
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Xavier Delaruelle, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command: use, unuse, load, display, whatis, avail, aliases
14 # Modulefiles:
15 # Sub-Command:
16 #
17 # Comment: %C{
18 # Handling of bad modulepath
19 # }C%
20 #
21 ##############################################################################
22
23 skip_if_quick_mode
24
25 #
26 # Variables for this test
27 #
28
29 set module "loc_rc6"
30
31 set file_modpath $::env(TESTSUITEDIR)/systest
32
33 set hide_perms "ugo-rx"
34
35 #
36 # Test global access to the modulefiles when modulepath is a regular file
37 #
38
39 setenv_path_var MODULEPATH $file_modpath
40
41 # nothing found
42 testouterr_cmd "sh" "whatis" "OK" ""
43 testouterr_cmd "sh" "avail" "OK" ""
44 testouterr_cmd "sh" "aliases" "OK" ""
45
46 #
47 # Test access to modulefile when modulepath is a regular file
48 #
49
50 # nothing found
51 testouterr_cmd "sh" "load $module" "ERR" "$err_path'$module'"
52 testouterr_cmd "sh" "display $module" "ERR" "$err_path'$module'"
53 testouterr_cmd "sh" "whatis $module" "ERR" "$err_path'$module'"
54 testouterr_cmd "sh" "avail -t $module" "OK" ""
55
56 #
57 # Test disabling modulepath when it is not a directory
58 #
59
60 # normal disabling, as no directory access
61 lappend ans [list unset MODULEPATH]
62 testouterr_cmd "sh" "unuse $file_modpath" $ans ""
63
64
65 #
66 # Cleanup
67 #
68
69 reset_test_env