| 1 |
############################################################################## |
| 2 |
# Modules Revision 3.0 |
| 3 |
# Providing a flexible user environment |
| 4 |
# |
| 5 |
# File: modules.60-initx/%M% |
| 6 |
# Revision: %I% |
| 7 |
# First Edition: 2005/12/22 |
| 8 |
# Last Mod.: %U%, %G% |
| 9 |
# |
| 10 |
# Authors: R.K. Owen, [email protected] |
| 11 |
# |
| 12 |
# Description: Testuite testsequence |
| 13 |
# Command: initadd, initrm |
| 14 |
# Modulefiles: |
| 15 |
# Sub-Command: |
| 16 |
# |
| 17 |
# Comment: %C{ |
| 18 |
# Check the init* sub-commands |
| 19 |
# }C% |
| 20 |
# |
| 21 |
############################################################################## |
| 22 |
|
| 23 |
set modload "module load" |
| 24 |
set line2 "$modload dot module-cvs module-info modules use.own" |
| 25 |
set line2x "$modload dot module-cvs module-info use.own" |
| 26 |
set find_msg_sh "$error_msgs: Cannot find a 'module load' command in any of the 'sh' startup files" |
| 27 |
|
| 28 |
# |
| 29 |
# Set specific HOME setup |
| 30 |
# |
| 31 |
|
| 32 |
set env(HOME) "$env(TESTSUITEDIR)/home" |
| 33 |
|
| 34 |
# |
| 35 |
# restore the .modules file |
| 36 |
# |
| 37 |
file copy -force "$env(HOME)/.modules.save" "$env(HOME)/.modules" |
| 38 |
|
| 39 |
# |
| 40 |
# Test procedure that reads the .modules file |
| 41 |
# |
| 42 |
proc _test_modules {shell cmd output} { |
| 43 |
global verbose |
| 44 |
global env |
| 45 |
|
| 46 |
set tmp [exec cat "$env(HOME)/.modules" ] |
| 47 |
|
| 48 |
if {$verbose} { |
| 49 |
send_user "Checking \"$shell\" $cmd -> \$HOME/.modules\n" |
| 50 |
} |
| 51 |
|
| 52 |
# |
| 53 |
# do the contents of .modules match with output? |
| 54 |
# |
| 55 |
|
| 56 |
if { $tmp == $output } { |
| 57 |
_test_ok $shell "$cmd" |
| 58 |
# return 1 |
| 59 |
} else { |
| 60 |
fail "$cmd ($shell)" |
| 61 |
send_user ".modules content: $tmp\n"; |
| 62 |
send_user "expected: $output\n"; |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
# save specific test env |
| 67 |
save_test_env |