3 # Tears down the demo users previously set up for multi-user testing.
5 # Author: Chris Koeritz
7 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory.
10 if [ -z "$TESTKIT_SENTINEL" ]; then echo Please run prepare_tools.sh before testing.; exit 3; fi
11 source "$TESTKIT_ROOT/library/establish_environment.sh"
13 progname="$(basename "$0")"
16 echo "$progname: This script needs a single parameter, which is the container"
17 echo "path to use for the authentication (e.g. $STS_LOC)"
21 ADMIN_CONTAINER=$1; shift
22 echo "container location is $ADMIN_CONTAINER "
24 # we test for ten users currently.
27 # login the right power user that can delete other user entries.
30 if [ -z "$NON_INTERACTIVE" ]; then
35 # now that we're logged in appropriately, delete our corresponding set of users.
39 for (( x=0; x < ${#MULTI_USER_LIST[*]}; x++ )); do
40 username="${MULTI_USER_LIST[$x]}"
41 echo "Whacking user '$username'..."
42 passwd="${MULTI_PASSWORD_LIST[$x]}"
43 # now do the heavy lifting to get that user set up.
44 silent_grid script "local:'$TESTKIT_ROOT/library/delete_one_user.xml'" "$CONTAINERPATH" "$(basename $username)" "$username" "$SUBMIT_GROUP"
45 assertEquals "Should delete user '$username' successfully" 0 $?
49 # make sure we don't leave them logged in as an administrator.
52 if [ -z "$NON_INTERACTIVE" ]; then
53 silent_grid logout --all
54 assertEquals "Final logout of the grid" 0 $?
60 if [ -z "$NON_INTERACTIVE" ]; then
65 # load and run shUnit2
66 source "$SHUNIT_DIR/shunit2"