##############################################################################
#   Modules Revision 3.0
#   Providing a flexible user environment
#
#   File:		modules.30-userlvl/%M%
#   Revision:		%I%
#   First Edition:	95/12/06
#   Last Mod.:		%U%, %G%
#
#   Authors:		Jens Hamisch, Jens.Hamisch@Strawberry.COM
#
#   Description:	Testuite testsequence
#   Command:		load
#   Modulefiles:	user/novice
#   Sub-Command:
#
#   Comment:	%C{
#			Checks the reaction to undefined userlevels being
#			specified to the 'module-user' subcommand
#		}C%
#
##############################################################################

#
#  Variables. This test forces a module load command. It will result in the
#    environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to
#    be set up
#

set module_1 "user/undef"
set modulefile_1 "$env(MODULEPATH)/$module_1"

#
#  'alias4' will behave different depending on user levels ..
#

set err_ulvl "$error_msgs: Undefined userlevel 'undef'"
set err_exec "$error_msgs: Tcl command execution failed: module-user undef"

#
#
#  Only checked for the csh
#

set lmf_csh_1 "setenv _LMFILES_ '$modulefile_1';"
set lm_csh_1 "setenv LOADEDMODULES '$module_1';"
set ts_csh_1 "$err_ulvl.*$err_exec"

#
#  The tests
#

testerr_cmd_re "csh" "-u nov load $module_1" "$ts_csh_1"
testerr_cmd_re "csh" "-u adv load $module_1" "$ts_csh_1"
testerr_cmd_re "csh" "-u exp load $module_1" "$ts_csh_1"

#
#  Cleanup
#

unset err_ulvl
unset err_exec

unset ts_csh_1
unset lm_csh_1
unset lmf_csh_1

unset modulefile_1
unset module_1

