| 1 |
############################################################################## |
| 2 |
# Modules Revision 3.0 |
| 3 |
# Providing a flexible user environment |
| 4 |
# |
| 5 |
# File: modules.70-maint/%M% |
| 6 |
# Revision: %I% |
| 7 |
# First Edition: 2017/11/27 |
| 8 |
# Last Mod.: %U%, %G% |
| 9 |
# |
| 10 |
# Authors: Xavier Delaruelle, [email protected] |
| 11 |
# |
| 12 |
# Description: Testuite testsequence |
| 13 |
# Command: is-saved |
| 14 |
# Modulefiles: |
| 15 |
# Sub-Command: |
| 16 |
# |
| 17 |
# Comment: %C{ |
| 18 |
# Test 'is-saved' module command |
| 19 |
# }C% |
| 20 |
# |
| 21 |
############################################################################## |
| 22 |
|
| 23 |
# set HOME to location containing collections |
| 24 |
set homewithcoll "$env(HOME)/home" |
| 25 |
if {$verbose} { |
| 26 |
send_user "\tSetup HOME = $homewithcoll\n" |
| 27 |
} |
| 28 |
set env(HOME) "$homewithcoll" |
| 29 |
|
| 30 |
|
| 31 |
# |
| 32 |
# The tests |
| 33 |
# |
| 34 |
|
| 35 |
testouterr_cmd "ALL" "is-saved foo" "ERR" "" |
| 36 |
testouterr_cmd "ALL" "is-saved foo coll1" "OK" "" |
| 37 |
|
| 38 |
skip_if_quick_mode |
| 39 |
|
| 40 |
testouterr_cmd "sh" "is-saved" "OK" "" |
| 41 |
|
| 42 |
# test collection requiring an upcoming version of Modules |
| 43 |
# test effect of mcookie configuration with this collection |
| 44 |
testouterr_cmd sh "is-saved coll48" ERR {} |
| 45 |
testouterr_cmd sh "is-saved $homewithcoll/coll48" ERR {} |
| 46 |
setenv_var MODULES_MCOOKIE_CHECK eval |
| 47 |
testouterr_cmd sh "is-saved coll48" ERR {} |
| 48 |
setenv_var MODULES_MCOOKIE_CHECK always |
| 49 |
setenv_var MODULES_MCOOKIE_VERSION_CHECK 0 |
| 50 |
testouterr_cmd sh "is-saved coll48" ERR {} |
| 51 |
setenv_var MODULES_MCOOKIE_VERSION_CHECK 1 |
| 52 |
|
| 53 |
# define a collection target |
| 54 |
if {$verbose} { |
| 55 |
send_user "\tSetup MODULES_COLLECTION_TARGET = 'target'\n" |
| 56 |
} |
| 57 |
set env(MODULES_COLLECTION_TARGET) "target" |
| 58 |
|
| 59 |
testouterr_cmd "sh" "is-saved foo coll1" "ERR" "" |
| 60 |
testouterr_cmd "sh" "is-saved coll4" "OK" "" |
| 61 |
testouterr_cmd "sh" "is-saved" "OK" "" |
| 62 |
|
| 63 |
# define a collection target with no collection related to it |
| 64 |
if {$verbose} { |
| 65 |
send_user "\tSetup MODULES_COLLECTION_TARGET = 'foo'\n" |
| 66 |
} |
| 67 |
set env(MODULES_COLLECTION_TARGET) "foo" |
| 68 |
|
| 69 |
testouterr_cmd "sh" "is-saved" "ERR" "" |
| 70 |
|
| 71 |
# test unsetting HOME |
| 72 |
if {$verbose} { |
| 73 |
send_user "\tUnset HOME \n" |
| 74 |
} |
| 75 |
unset env(HOME) |
| 76 |
|
| 77 |
testouterr_cmd "sh" "is-saved" "ERR" "$error_msgs: HOME not defined" |
| 78 |
|
| 79 |
|
| 80 |
# |
| 81 |
# Cleanup |
| 82 |
# |
| 83 |
|
| 84 |
reset_test_env |