############################################################################## # Modules Revision 3.0 # Providing a flexible user environment # # File: modules.50-cmds/%M% # Revision: %I% # First Edition: 2018/04/14 # Last Mod.: %U%, %G% # # Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr # # Description: Testuite testsequence # Command: load, unload, display, help, test # Modulefiles: remove/5.0 # Sub-Command: # # Comment: %C{ # Check the effect of 'remove-path' command on $env() array # variable through the different modulefile evaluation mode # }C% # ############################################################################## skip_if_quick_mode set module "remove/5.0" set modulefile "$modpath/$module" set modulefilere "$modpathre/$module" # # test load mode # # test with value not set to variable prior to load set ans [list] lappend ans [list unset TS1] lappend ans [list set TS2 ""] lappend ans [list set _LMFILES_ $modulefile] lappend ans [list set LOADEDMODULES $module] testouterr_cmd_re "sh" "load $module" $ans "" # test with value set to variable prior to load (diff value than removed one) setenv_var TS1 "no" set ans [list] lappend ans [list set TS1 "no"] lappend ans [list set TS2 "no"] lappend ans [list set _LMFILES_ $modulefile] lappend ans [list set LOADEDMODULES $module] testouterr_cmd_re "sh" "load $module" $ans "" # test with value set to variable prior to load (value is removed one) setenv_var TS1 "yes" set ans [list] lappend ans [list unset TS1] lappend ans [list set TS2 ""] lappend ans [list set _LMFILES_ $modulefile] lappend ans [list set LOADEDMODULES $module] testouterr_cmd_re "sh" "load $module" $ans "" # test with value set to variable (as path var) prior to load (value is removed one) setenv_path_var TS1 "yes" set ans [list] lappend ans [list unset TS1] lappend ans [list set TS2 ""] lappend ans [list set _LMFILES_ $modulefile] lappend ans [list set LOADEDMODULES $module] testouterr_cmd_re "sh" "load $module" $ans "" # # test unload mode # # test with module loaded but vanished env vars unsetenv_path_var TS1 setenv_loaded_module $module $modulefile set ans [list] lappend ans [list unset TS2] lappend ans [list unset _LMFILES_] lappend ans [list unset LOADEDMODULES] testouterr_cmd "sh" "unload $module" $ans "" # test with value set to variable prior to unload (diff value than removed one) setenv_var TS1 "no" set ans [list] lappend ans [list unset TS2] lappend ans [list unset _LMFILES_] lappend ans [list unset LOADEDMODULES] testouterr_cmd "sh" "unload $module" $ans "" # test with value set to variable prior to unload (value is removed one) setenv_var TS1 "yes" set ans [list] lappend ans [list unset TS1] lappend ans [list unset TS2] lappend ans [list unset _LMFILES_] lappend ans [list unset LOADEDMODULES] # test with value set to variable (as path var) prior to load (value is removed one) setenv_path_var TS1 "yes" set ans [list] lappend ans [list unset TS1] lappend ans [list unset TS2] lappend ans [list unset _LMFILES_] lappend ans [list unset LOADEDMODULES] # restore environment unsetenv_loaded_module unsetenv_path_var TS1 # # test display mode # # test with value not set to variable prior to display set tserr "$modlin $modulefilere: remove-path\tTS1 yes setenv\t\tTS2 {} $modlin" testouterr_cmd_re "sh" "display $module" "" $tserr # test with value set to variable prior to display (diff value than removed one) setenv_var TS1 "no" set tserr "$modlin $modulefilere: remove-path\tTS1 yes setenv\t\tTS2 no $modlin" testouterr_cmd_re "sh" "display $module" "" $tserr # test with value set to variable prior to display (value is removed one) setenv_var TS1 "yes" set tserr "$modlin $modulefilere: remove-path\tTS1 yes setenv\t\tTS2 {} $modlin" testouterr_cmd_re "sh" "display $module" "" $tserr # test with value set to variable (as path var) prior to display (value is removed one) setenv_path_var TS1 "yes" set tserr "$modlin $modulefilere: remove-path\tTS1 yes setenv\t\tTS2 {} $modlin" testouterr_cmd_re "sh" "display $module" "" $tserr # restore environment unsetenv_path_var TS1 # # test help mode # # test with value not set to variable prior to help set tserr "$modlin Module Specific Help for $modulefilere: $warn_msgs: Unable to find ModulesHelp in $modulefilere. $modlin" testouterr_cmd_re "sh" "help $module" "" $tserr # test with value set to variable prior to help (diff value than removed one) setenv_var TS1 "no" testouterr_cmd_re "sh" "help $module" "" $tserr # test with value set to variable prior to help (value is removed one) setenv_var TS1 "yes" testouterr_cmd_re "sh" "help $module" "" $tserr # test with value set to variable (as path var) prior to help (value is removed one) setenv_path_var TS1 "yes" testouterr_cmd_re "sh" "help $module" "" $tserr # restore environment unsetenv_path_var TS1 # # test test mode # # test with value not set to variable prior to test set tserr "$modlin Module Specific Test for $modulefilere: $warn_msgs: Unable to find ModulesTest in $modulefilere. $modlin" testouterr_cmd_re "sh" "test $module" "" $tserr # test with value set to variable prior to test (diff value than removed one) setenv_var TS1 "no" testouterr_cmd_re "sh" "test $module" "" $tserr # test with value set to variable prior to test (value is removed one) setenv_var TS1 "yes" testouterr_cmd_re "sh" "test $module" "" $tserr # test with value set to variable (as path var) prior to test (value is removed one) setenv_path_var TS1 "yes" testouterr_cmd_re "sh" "test $module" "" $tserr # restore environment unsetenv_path_var TS1 # # Cleanup # reset_test_env