Last active
June 7, 2016 12:46
-
-
Save dkavanagh/4348372 to your computer and use it in GitHub Desktop.
This script creates test users that are the same as created by eucalyptus ui tests. So, if you're setting up a test cloud by some other means (like kickstarting a package-built cloud), you can run this after getting the admin credentials.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "{ \"Statement\": [ { \"Effect\": \"Allow\", \"Action\": \"*\", \"Resource\": \"*\" } ] }" >all.policy | |
k=0 | |
ADMIN=`cat .euca/euca-admin.ini |grep "^user" |awk '{ print $3; }'` | |
HOST=`cat .euca/euca-admin.ini |grep "^default-region" |awk '{ print $3; }'` | |
REGION=$ADMIN@$HOST | |
for i in ui-test-acct-00 ui-test-acct-01 ui-test-acct-02 ui-test-acct-03 | |
do | |
echo "creating users for "$i | |
euare-accountcreate --region $REGION -a $i | |
euare-useraddloginprofile --region $REGION --as-account $i -u admin -p mypassword$k | |
k=`expr $k + 1` | |
euare-useraddkey admin --region $REGION --as-account $i -wld $HOST -w >> .euca/$i.ini | |
euare-usercreate --region $REGION --as-account $i -u user00 | |
euare-useraddloginprofile --region $REGION --as-account $i -u user00 -p mypassword$k | |
euare-useruploadpolicy --region $REGION --as-account $i -u user00 -p fullaccess -f all.policy | |
k=`expr $k + 1` | |
euare-useraddkey user00 --region $REGION --as-account $i -wld $HOST -w >> .euca/$i.ini | |
done | |
rm -f all.policy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment