File: 372-deps3.exp

package info (click to toggle)
modules 5.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 20,572 kB
  • sloc: exp: 46,525; sh: 5,261; tcl: 3,182; makefile: 1,355; ansic: 466; python: 251; csh: 201; perl: 47; ruby: 44
file content (78 lines) | stat: -rw-r--r-- 2,746 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
##############################################################################
#   Modules Revision 3.0
#   Providing a flexible user environment
#
#   File:		modules.50-cmds/%M%
#   Revision:		%I%
#   First Edition:	2018/06/06
#   Last Mod.:		%U%, %G%
#
#   Authors:		Xavier Delaruelle, xavier.delaruelle@cea.fr
#
#   Description:	Testuite testsequence
#   Command:        load, unload
#   Modulefiles:
#   Sub-Command:    prereq, conflict
#
#   Comment:	%C{
#           Test dependency handling consistency whatever the auto-handling
#           mode enablement state
#		}C%
#
##############################################################################

skip_if_quick_mode

set mp "$modpath.deps"

# setup specific environment
setenv_path_var MODULEPATH $mp

# is-loading conflict check
testouterr_cmd "sh" "load mt" "ERR" [msg_load ms [err_conloi mt]]\n\n[msg_load mt [err_reqlo ms]]

# is-loading conflict check with fully qualified modulefile
if {$plus_in_modpath && $install_advversspec eq {y}} {
    setenv_var MODULES_ADVANCED_VERSION_SPEC 0
}
testouterr_cmd "sh" "load mtf" "ERR" [msg_load $mp/msf [err_conloi $mp/mtf]]\n\n[msg_load mtf [err_reqlo $mp/msf]]
if {$plus_in_modpath && $install_advversspec eq {y}} {
    unsetenv_var MODULES_ADVANCED_VERSION_SPEC
}

# conflict consistency check
set ans [list]
lappend ans [list set __MODULES_LMCONFLICT "a&b"]
lappend ans [list set LOADEDMODULES "a"]
lappend ans [list set _LMFILES_ "$mp/a"]
lappend ans [list ERR]
if {$install_autohandling eq {y}} {
    testouterr_cmd "sh" "load a b" $ans [msg_load b [err_conlo a]]
} else {
    # as load is attempted to see if conflict solves, returned error is about missing prereq
    testouterr_cmd "sh" "load a b" $ans [msg_load b [err_prereq c]]
}

# prereq consistency check
# no test possible with equal results between --auto and --no-auto modes
# due to DepUn mechanism

# restore environment
unsetenv_var __MODULES_LMCONFLICT
unsetenv_var __MODULES_LMPREREQ
unsetenv_loaded_module

# check warning raised when using --auto/--no-auto from modulefile
# confusing error messages obtained due to load then unload of same modulefile (which is thus defined as a conflict and a prereq)
if {$install_autohandling eq {y}} {
    set tserr [msg_unload {ms <aL>} [err_deplo mu]]\n\n[msg_load mu "$warn_msgs: Unsupported option '--auto'" "$warn_msgs: Unsupported option '--auto'" "$warn_msgs: Unsupported option '--no-auto'" [err_conun ms]]
} else {
    set tserr [msg_unload {ms <aL>} [err_deplo mu]]\n\n[msg_load mu "$warn_msgs: Unsupported option '--auto'" "$warn_msgs: Unsupported option '--auto'" [err_swoff ms] "$warn_msgs: Unsupported option '--no-auto'" [err_conlo ms]]
}
testouterr_cmd "sh" "load mu" ERR $tserr

#
#  Cleanup
#

reset_test_env