Blueprint cli-auth

* Add proper test for swift in client-env.sh
* Remove all VERIFY variables; nothing beyond the 4 OS_ vars is set now
* Update exercises for Keystone 2.0 auth
* swift understands Keystone 2.0 auth now, don't download custom binary
* cleanup uploaded bundle in bundle.sh

Change-Id: I99c818d81534bbf93c0e142513acb80e5fe613ea
diff --git a/exercises/bundle.sh b/exercises/bundle.sh
index ca35c9a..d5c78af 100755
--- a/exercises/bundle.sh
+++ b/exercises/bundle.sh
@@ -46,3 +46,6 @@
     echo "Image $AMI not available within $REGISTER_TIMEOUT seconds"
     exit 1
 fi
+
+# Clean up
+euca-deregister $AMI
diff --git a/exercises/client-env.sh b/exercises/client-env.sh
index f4172bc..a15a5c0 100755
--- a/exercises/client-env.sh
+++ b/exercises/client-env.sh
@@ -52,18 +52,13 @@
     if [[ "$SKIP_EXERCISES" =~ "key" ]] ; then
         STATUS_KEYSTONE="Skipped"
     else
-        if [[ -n "$VERIFY" ]]; then
-            # Save original environment
-            xOS_AUTH_URL=$OS_AUTH_URL
-            xOS_TENANT_NAME=$OS_TENANT_NAME
-            xOS_USERNAME=$OS_USERNAME
-            xOS_PASSWORD=$OS_PASSWORD
-            # keystone can't handle a trailing '/'
-            export OS_AUTH_URL=${OS_AUTH_URL%/}
-            # does any non-admin request work?
-            export OS_USERNAME=admin
-            export OS_TENANT_NAME=admin
-        fi
+        # We need to run the keystone test as admin since there doesn't
+        # seem to be anything to test the cli vars that runs as a user
+        # tenant-list should do that, it isn't implemented (yet)
+        xOS_TENANT_NAME=$OS_TENANT_NAME
+        xOS_USERNAME=$OS_USERNAME
+        export OS_USERNAME=admin
+        export OS_TENANT_NAME=admin
 
         echo -e "\nTest Keystone"
         if keystone service-list; then
@@ -72,13 +67,9 @@
             STATUS_KEYSTONE="Failed"
             RETURN=1
         fi
-        if [[ -n "$VERIFY" ]]; then
-            # Save original environment
-            OS_AUTH_URL=$xOS_AUTH_URL
-            OS_TENANT_NAME=$xOS_TENANT_NAME
-            OS_USERNAME=$xOS_USERNAME
-            OS_PASSWORD=$xOS_PASSWORD
-        fi
+
+        OS_TENANT_NAME=$xOS_TENANT_NAME
+        OS_USERNAME=$xOS_USERNAME
     fi
 fi
 
@@ -89,12 +80,6 @@
     if [[ "$SKIP_EXERCISES" =~ "n-api" ]] ; then
         STATUS_NOVA="Skipped"
     else
-        if [[ -n "$VERIFY" ]]; then
-            # Known novaclient breakage:
-            #  NOVA_VERSION must be set or nova silently fails
-            export NOVA_VERSION=2
-        fi
-
         echo -e "\nTest Nova"
         if nova flavor-list; then
             STATUS_NOVA="Succeeded"
@@ -112,14 +97,6 @@
     if [[ "$SKIP_EXERCISES" =~ "g-api" ]] ; then
         STATUS_GLANCE="Skipped"
     else
-        if [[ -n "$VERIFY" ]]; then
-            # Known glance client differage:
-            export OS_AUTH_TENANT=$OS_TENANT_NAME
-            export OS_AUTH_USER=$OS_USERNAME
-            export OS_AUTH_KEY=$OS_PASSWORD
-            export OS_AUTH_STRATEGY=keystone
-        fi
-
         echo -e "\nTest Glance"
         if glance index; then
             STATUS_GLANCE="Succeeded"
@@ -138,8 +115,7 @@
         STATUS_SWIFT="Skipped"
     else
         echo -e "\nTest Swift"
-        # FIXME(dtroyer): implement swift test
-        if true; then
+        if swift stat; then
             STATUS_SWIFT="Succeeded"
         else
             STATUS_SWIFT="Failed"
diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh
index c1cffa4..233313e 100755
--- a/exercises/floating_ips.sh
+++ b/exercises/floating_ips.sh
@@ -48,15 +48,6 @@
 # Additional floating IP pool and range
 TEST_FLOATING_POOL=${TEST_FLOATING_POOL:-test}
 
-# Get a token for clients that don't support service catalog
-# ==========================================================
-
-# manually create a token by querying keystone (sending JSON data).  Keystone
-# returns a token and catalog of endpoints.  We use python to parse the token
-# and save it.
-
-TOKEN=`curl -s -d  "{\"auth\":{\"passwordCredentials\": {\"username\": \"$OS_USERNAME\", \"password\": \"$OS_PASSWORD\"}}}" -H "Content-type: application/json" ${OS_AUTH_URL%/}/tokens | python -c "import sys; import json; tok = json.loads(sys.stdin.read()); print tok['access']['token']['id'];"`
-
 # Launching a server
 # ==================
 
@@ -70,10 +61,10 @@
 nova image-list
 
 # But we recommend using glance directly
-glance -f -A $TOKEN -H $GLANCE_HOST index
+glance -f index
 
 # Grab the id of the image to launch
-IMAGE=`glance -f -A $TOKEN -H $GLANCE_HOST index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
+IMAGE=`glance -f index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
 
 # Security Groups
 # ---------------
diff --git a/exercises/volumes.sh b/exercises/volumes.sh
index 1f7c25f..1fcc034 100755
--- a/exercises/volumes.sh
+++ b/exercises/volumes.sh
@@ -34,15 +34,6 @@
 # Boot this image, use first AMi image if unset
 DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-ami}
 
-# Get a token for clients that don't support service catalog
-# ==========================================================
-
-# manually create a token by querying keystone (sending JSON data).  Keystone
-# returns a token and catalog of endpoints.  We use python to parse the token
-# and save it.
-
-TOKEN=`curl -s -d  "{\"auth\":{\"passwordCredentials\": {\"username\": \"$OS_USERNAME\", \"password\": \"$OS_PASSWORD\"}}}" -H "Content-type: application/json" ${OS_AUTH_URL%/}/tokens | python -c "import sys; import json; tok = json.loads(sys.stdin.read()); print tok['access']['token']['id'];"`
-
 # Launching a server
 # ==================
 
@@ -56,10 +47,10 @@
 nova image-list
 
 # But we recommend using glance directly
-glance -f -A $TOKEN -H $GLANCE_HOST index
+glance -f index
 
 # Grab the id of the image to launch
-IMAGE=`glance -f -A $TOKEN -H $GLANCE_HOST index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
+IMAGE=`glance -f index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
 
 # determinine instance type
 # -------------------------