############################################################################## # 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 testouterr_cmd "sh" "load mtf" "ERR" [msg_load $mp/msf [err_conloi mtf]]\n\n[msg_load mtf [err_reqlo $mp/msf]] # 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}} { if {[is_conf_enabled conflictunload]} { set ans [list] lappend ans [list set __MODULES_LMCONFLICT "c&c"] lappend ans [list set __MODULES_LMPREREQ "b&c"] lappend ans [list set _LMFILES_ "$mp/c:$mp/b"] lappend ans [list set LOADEDMODULES "c:b"] lappend ans [list set __MODULES_LMTAG c&auto-loaded] set tserr [msg_top_load b a c {}] } else { set tserr [msg_load b [err_conlo a]] } testouterr_cmd "sh" "load a b" $ans $tserr } else { # as load is attempted to see if conflict solves, returned error is also about missing prereq testouterr_cmd "sh" "load a b" $ans [msg_load b [err_prereq c] [err_conlo a]] } # 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 } [err_deploi mu]]\n\n[msg_load mu "$warn_msgs: Unsupported option '--auto'" "$warn_msgs: Unsupported option '--auto'" [err_conun ms]] } else { set tserr [msg_unload {ms } [err_deploi mu]]\n\n[msg_load mu "$warn_msgs: Unsupported option '--auto'" "$warn_msgs: Unsupported option '--auto'" [err_conun ms]] } testouterr_cmd "sh" "load mu" ERR $tserr # # Cleanup # reset_test_env