"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "testsuite/modules.61-coll/080-access-coll.exp" between
modules-5.1.1.tar.bz2 and modules-5.2.0.tar.bz2

About: The Environment Modules package provides for the dynamic modification of a user’s environment via modulefiles.

080-access-coll.exp  (modules-5.1.1.tar.bz2):080-access-coll.exp  (modules-5.2.0.tar.bz2)
skipping to change at line 41 skipping to change at line 41
send_user "\tskipping access tests as tests are run by superuser\n" send_user "\tskipping access tests as tests are run by superuser\n"
# cannot test access if restricted file permissions have no effect # cannot test access if restricted file permissions have no effect
} elseif {$is_locked_dir_file_readable && $is_locked_file_readable} { } elseif {$is_locked_dir_file_readable && $is_locked_file_readable} {
send_user "\tskipping access tests as locked files or directories are still readable\n" send_user "\tskipping access tests as locked files or directories are still readable\n"
} else { } else {
# #
# Variables for this test # Variables for this test
# #
set header_coll "Named collection list:"
set coll_list "$coll1\n${coll1}.save\n$coll2\n$coll3\n$coll4f\n$coll6f\n$colld\n infocmd\ninfocmdexp" set coll_list "$coll1\n${coll1}.save\n$coll2\n$coll3\n$coll4f\n$coll6f\n$colld\n infocmd\ninfocmdexp"
set coll_list_nocoll1 "${coll1}.save\n$coll2\n$coll3\n$coll4f\n$coll6f\n$colld\n infocmd\ninfocmdexp" set coll_list_nocoll1 "${coll1}.save\n$coll2\n$coll3\n$coll4f\n$coll6f\n$colld\n infocmd\ninfocmdexp"
if {$install_implicitdefault eq {y}} { if {$install_implicitdefault eq {y}} {
lappend ans [list unset mload] lappend ans [list unset mload]
lappend ans [list set __MODULES_LMALTNAME $c1lmalt] lappend ans [list set __MODULES_LMALTNAME $c1lmalt]
lappend ans [list set t15 t15] lappend ans [list set t15 t15]
lappend ans [list set _LMFILES_ $c1lmf] lappend ans [list set _LMFILES_ $c1lmf]
lappend ans [list set LOADEDMODULES $c1lm] lappend ans [list set LOADEDMODULES $c1lm]
lappend ans [list set testsuite yes] lappend ans [list set testsuite yes]
skipping to change at line 70 skipping to change at line 69
lappend ans [list set LOADEDMODULES $c1lmnodefault] lappend ans [list set LOADEDMODULES $c1lmnodefault]
lappend ans [list set testsuite yes] lappend ans [list set testsuite yes]
lappend ans [list set MODULEPATH $c1modpath] lappend ans [list set MODULEPATH $c1modpath]
lappend ans [list ERR] lappend ans [list ERR]
set c1errmsg "Loading loc_rc1/1.0\nLoading load/15\n$err_nodefault'verssort' \nload $cdmod4\nLoading $cdmod4\nload $c1mod5\nLoading $c1mod5\nload $c1mod6\nLo ading $c1mod6" set c1errmsg "Loading loc_rc1/1.0\nLoading load/15\n$err_nodefault'verssort' \nload $cdmod4\nLoading $cdmod4\nload $c1mod5\nLoading $c1mod5\nload $c1mod6\nLo ading $c1mod6"
} }
set pheader "$modlin $modpathre $modlin" set pheader "$modlin $modpathre $modlin"
set read_msg "$error_msgs: Collection $coll1 cannot be read." set read_msg "$error_msgs: Collection $coll1 cannot be read."
set save_msg "$error_msgs: Collection $coll1 cannot be saved." set save_msg "$error_msgs: Collection $coll1 cannot be saved."
set found_msg "$error_msgs: Collection $coll1 cannot be found" set found_msg [err_coll_notfound $coll1]
set perm_msg " couldn't open \"$coll1fp\": permission denied" set perm_msg " couldn't open \"$coll1fp\": permission denied"
set accessdir_msg "$error_msgs: Cannot access collection directory." set accessdir_msg "$error_msgs: Cannot access collection directory."
set permdir_msg " couldn't read directory \"$homewithcolldotmod/\": permission denied" set permdir_msg " couldn't read directory \"$homewithcolldotmod/\": permission denied"
set delete_msg "$error_msgs: Collection $coll1 cannot be removed." set delete_msg "$error_msgs: Collection $coll1 cannot be removed."
set permdel_msg " error deleting \"$coll1fp\": permission denied" set permdel_msg " error deleting \"$coll1fp\": permission denied"
set rmc1errmsg "couldn't open \"$coll1fp\": no such file or directory" set rmc1errmsg "couldn't open \"$coll1fp\": no such file or directory"
set hide_perms "ugo-rx" set hide_perms "ugo-rx"
set write_perms "ugo-w" set write_perms "ugo-w"
# set HOME to location containing collections # set HOME to location containing collections
skipping to change at line 96 skipping to change at line 95
# backup collection that will be altered by tests # backup collection that will be altered by tests
set coll1fpsave "${coll1fp}.save" set coll1fpsave "${coll1fp}.save"
file copy -force $coll1fp $coll1fpsave file copy -force $coll1fp $coll1fpsave
# #
# Test access to collection when read access not granted on this collection # Test access to collection when read access not granted on this collection
# #
change_file_perms $coll1fp $hide_perms change_file_perms $coll1fp $hide_perms
testouterr_cmd "sh" "savelist -t" "OK" "$header_coll\n$coll_list_nocoll1" testouterr_cmd "sh" "savelist -t" "OK" "[msg_named_coll]\n$coll_list_nocoll1"
testouterr_cmd "sh" "saveshow $coll1" "ERR" [err_permdenied $coll1fp] testouterr_cmd "sh" "saveshow $coll1" "ERR" [err_permdenied $coll1fp]
testouterr_cmd "sh" "restore $coll1" "ERR" [err_permdenied $coll1fp] testouterr_cmd "sh" "restore $coll1" "ERR" [err_permdenied $coll1fp]
testouterr_cmd "sh" "save $coll1" "OK" "" testouterr_cmd "sh" "save $coll1" "OK" ""
testoutfile_cmd "sh" "saverm $coll1" "OK" "$coll1fp" "$rmc1errmsg" testoutfile_cmd "sh" "saverm $coll1" "OK" "$coll1fp" "$rmc1errmsg"
# restore altered collection and permissions # restore altered collection and permissions
file copy -force $coll1fpsave $coll1fp file copy -force $coll1fpsave $coll1fp
restore_file_perms $coll1fp restore_file_perms $coll1fp
# #
# Test access to collection when write access not granted on this collection # Test access to collection when write access not granted on this collection
# #
change_file_perms $coll1fp $write_perms change_file_perms $coll1fp $write_perms
testouterr_cmd "sh" "savelist -t" "OK" "$header_coll\n$coll_list" testouterr_cmd "sh" "savelist -t" "OK" "[msg_named_coll]\n$coll_list"
testouterr_cmd_re "sh" "saveshow $coll1" "OK" "$modlin\n$coll1fpre:\n\n$presaved c1cont1re\n$modlin" testouterr_cmd_re "sh" "saveshow $coll1" "OK" "$modlin\n$coll1fpre:\n\n$presaved c1cont1re\n$modlin"
testouterr_cmd_re "sh" "restore $coll1" $ans "$c1errmsg" testouterr_cmd_re "sh" "restore $coll1" $ans "$c1errmsg"
testouterr_cmd "sh" "save $coll1" "ERR" "$save_msg\n$perm_msg" testouterr_cmd "sh" "save $coll1" "ERR" "$save_msg\n$perm_msg"
testoutfile_cmd "sh" "saverm $coll1" "OK" "$coll1fp" "$rmc1errmsg" testoutfile_cmd "sh" "saverm $coll1" "OK" "$coll1fp" "$rmc1errmsg"
# restore altered collection and permissions # restore altered collection and permissions
file copy -force $coll1fpsave $coll1fp file copy -force $coll1fpsave $coll1fp
restore_file_perms $coll1fp restore_file_perms $coll1fp
# #
skipping to change at line 152 skipping to change at line 151
# restore altered collection and permissions # restore altered collection and permissions
restore_file_perms $homewithcolldotmod restore_file_perms $homewithcolldotmod
file copy -force $coll1fpsave $coll1fp file copy -force $coll1fpsave $coll1fp
# #
# Test access to collection when write access not granted on its upper directory # Test access to collection when write access not granted on its upper directory
# #
change_file_perms $homewithcolldotmod $write_perms change_file_perms $homewithcolldotmod $write_perms
testouterr_cmd "sh" "savelist -t" "OK" "$header_coll\n$coll_list" testouterr_cmd "sh" "savelist -t" "OK" "[msg_named_coll]\n$coll_list"
testouterr_cmd_re "sh" "saveshow $coll1" "OK" "$modlin\n$coll1fpre:\n\n$presaved c1cont1re\n$modlin" testouterr_cmd_re "sh" "saveshow $coll1" "OK" "$modlin\n$coll1fpre:\n\n$presaved c1cont1re\n$modlin"
testouterr_cmd_re "sh" "restore $coll1" $ans "$c1errmsg" testouterr_cmd_re "sh" "restore $coll1" $ans "$c1errmsg"
testouterr_cmd "sh" "save $coll1" "OK" "" testouterr_cmd "sh" "save $coll1" "OK" ""
# different result if a file in a locked directory still readable on this system # different result if a file in a locked directory still readable on this system
if {$is_locked_dir_file_readable} { if {$is_locked_dir_file_readable} {
testoutfile_cmd "sh" "saverm $coll1" "OK" "$coll1fp" "$rmc1errmsg" testoutfile_cmd "sh" "saverm $coll1" "OK" "$coll1fp" "$rmc1errmsg"
} else { } else {
testouterr_cmd "sh" "saverm $coll1" "ERR" "$delete_msg\n$permdel_msg" testouterr_cmd "sh" "saverm $coll1" "ERR" "$delete_msg\n$permdel_msg"
} }
 End of changes. 5 change blocks. 
5 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)