Debian Codegraph @

testsuite/modules.20-locate/030-defvers.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: 95/12/06
8 # Last Mod.: %U%, %G%
9 #
10 # Authors: Jens Hamisch, [email protected]
11 #
12 # Description: Testuite testsequence
13 # Command: display
14 # Modulefiles: loc_dv1, loc_dv2, loc_dv3, loc_dv4, loc_dv5, loc_dv6
15 # Modulefiles: loc_dv7, loc_dv8, loc_dv9, loc_dvv1, loc_dv_xx
16 # Sub-Command:
17 #
18 # Comment: %C{
19 # Localization of the modulefile default versions
20 #
21 # dv1 Select version 2.0 by filename
22 # (2.0 < 1.0)
23 # dv2 Select version 1.0 by using
24 # '.version' file
25 # dv3 '.version' file pointing to a non
26 # existent modulefile
27 # dv4 '.version' file pointing to a illegal
28 # modulefile
29 # dv5 empty directory
30 # dv6 Select 2.0 by filename. 2.0 is a
31 # directory with 1.0 inside
32 # dv7 Select 2.0 by .version. 2.0 is a
33 # directory with 1.0 inside
34 # dv8 Select 2.0 by file because the magic
35 # cookie is missing in .version
36 # dv9 Select version 1.0 by using
37 # '.version' file using module-version cmd
38 # dvv1 Select version 1.0 by using
39 # '.version' file using module-version cmd
40 # working with virtual modules
41 # dv_xx non existent directory
42 #
43 # }C%
44 #
45 ##############################################################################
46
47 #
48 # Variables for this test
49 #
50
51 set module_3 "$modpathre/loc_dv3/3.0"
52 set module_4 "$modpathre/loc_dv4/2.0"
53 set version_8 "$modpathre/loc_dv8/.version"
54
55 set err_mag_3 "$err_magic'$module_3'"
56 set err_mag_4 "$err_magic'$module_4'"
57 set err_mag_8 "$err_magic'$version_8'"
58
59 #
60 # The tests ...
61 #
62
63 testouterr_cmd_re "sh" "display loc_dv1" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$modpathre/loc_dv1/2.0:\n\nmodule-whatis\\s+loc_dv1/2.0\n$modlin" "$err_nodefault'loc_dv1'"]
64 testouterr_cmd_re "sh" "display loc_dv2" "OK" "$modlin\n$modpathre/loc_dv2/1.0:\n\nmodule-whatis\\s+loc_dv2/1.0\n$modlin"
65 testouterr_cmd_re "sh" "display loc_dv3" "ERR" "$err_path'loc_dv3/3.0'"
66 testouterr_cmd_re "sh" "display loc_dv4" "ERR" "$err_mag_4\n$err_contact"
67 testouterr_cmd_re "sh" "display loc_dv5" "ERR" "$err_path'loc_dv5'"
68 testouterr_cmd_re "sh" "display loc_dv6" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$modpathre/loc_dv6/2.0/1.0:\n\n$modlin" "$err_nodefault'loc_dv6'"]
69 testouterr_cmd_re "sh" "display loc_dv7" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$modpathre/loc_dv7/2.0/1.0:\n\nmodule-whatis\\s+loc_dv7/2.0/1.0\n$modlin" "$err_nodefault'loc_dv7/2.0'"]
70 testouterr_cmd_re "sh" "display loc_dv8" "ERR" $err_mag_8\n$err_contact\n[if_implicitdefault "$modlin\n$modpathre/loc_dv8/2.0:\n\n$modlin" "$err_nodefault'loc_dv8'"]
71 testouterr_cmd_re "sh" "display loc_dv9" "OK" "$modlin\n$modpathre/loc_dv9/1.0:\n\nmodule-whatis\\s+loc_dv9/1.0\n$modlin"
72 testouterr_cmd_re "sh" "display loc_dvv1" "OK" "$modlin\n$modpathre/loc_dvv1/.common:\n\nmodule-whatis\\s+loc_dvv1/1.0\n$modlin"
73 testouterr_cmd_re "sh" "display loc_dv_xx" "ERR" "$err_path'loc_dv_xx'"
74
75 skip_if_quick_mode
76
77 # check extra / does not affect localization result
78 testouterr_cmd_re "sh" "display loc_dv1/" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$modpathre/loc_dv1/2.0:\n\nmodule-whatis\\s+loc_dv1/2.0\n$modlin" "$err_nodefault'loc_dv1'"]
79 testouterr_cmd_re "sh" "display loc_dv1//" [if_implicitdefault OK ERR] [if_implicitdefault "$modlin\n$modpathre/loc_dv1/2.0:\n\nmodule-whatis\\s+loc_dv1/2.0\n$modlin" "$err_nodefault'loc_dv1'"]
80 testouterr_cmd_re "sh" "display loc_dv_xx/" "ERR" "$err_path'loc_dv_xx/'"
81 testouterr_cmd_re "sh" "display loc_dv_xx//" "ERR" "$err_path'loc_dv_xx//'"
82
83 #
84 # Cleanup
85 #
86
87 reset_test_env