Merge "Remove provider router configuration"
diff --git a/driver_certs/cinder_driver_cert.sh b/driver_certs/cinder_driver_cert.sh
index 99b2c8e..e45b7f8 100755
--- a/driver_certs/cinder_driver_cert.sh
+++ b/driver_certs/cinder_driver_cert.sh
@@ -16,6 +16,7 @@
 # It also assumes default install location (/opt/stack/xxx)
 # to aid in debug, you should also verify that you've added
 # an output directory for screen logs:
+#
 #     SCREEN_LOGDIR=/opt/stack/screen-logs
 
 CERT_DIR=$(cd $(dirname "$0") && pwd)
diff --git a/functions b/functions
index 5eae7fe..6979c6c 100644
--- a/functions
+++ b/functions
@@ -2,10 +2,15 @@
 #
 # The following variables are assumed to be defined by certain functions:
 #
+# - ``DATABASE_BACKENDS``
 # - ``ENABLED_SERVICES``
 # - ``FILES``
 # - ``GLANCE_HOSTPORT``
+# - ``REQUIREMENTS_DIR``
+# - ``STACK_USER``
 # - ``TRACK_DEPENDS``
+# - ``UNDO_REQUIREMENTS``
+#
 
 # Include the common functions
 FUNC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)
@@ -45,7 +50,7 @@
 # Updates the dependencies in project_dir from the
 # openstack/requirements global list before installing anything.
 #
-# Uses globals ``TRACK_DEPENDS``, ``REQUIREMENTS_DIR``
+# Uses globals ``TRACK_DEPENDS``, ``REQUIREMENTS_DIR``, ``UNDO_REQUIREMENTS``
 # setup_develop directory
 function setup_develop() {
     local project_dir=$1
diff --git a/lib/apache b/lib/apache
index 8ae78b2..0e5712f 100644
--- a/lib/apache
+++ b/lib/apache
@@ -4,8 +4,8 @@
 # Dependencies:
 #
 # - ``functions`` file
-# -``STACK_USER`` must be defined
-
+# - ``STACK_USER`` must be defined
+#
 # lib/apache exports the following functions:
 #
 # - is_apache_enabled_service
diff --git a/lib/heat b/lib/heat
index efb01ef..af10fa6 100644
--- a/lib/heat
+++ b/lib/heat
@@ -110,15 +110,6 @@
     iniset $HEAT_CONF ec2authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0
     iniset $HEAT_CONF ec2authtoken keystone_ec2_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/ec2tokens
 
-    # stack user domain
-    # Note we have to pass token/endpoint here because the current endpoint and
-    # version negotiation in OSC means just --os-identity-api-version=3 won't work
-    KS_ENDPOINT_V3="$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3"
-    D_ID=$(openstack --os-token $OS_SERVICE_TOKEN --os-url=$KS_ENDPOINT_V3 \
-        --os-identity-api-version=3 domain show heat \
-        | grep ' id ' | get_field 2)
-    iniset $HEAT_CONF stack_user_domain ${D_ID}
-
     # paste_deploy
     [[ "$HEAT_STANDALONE" = "True" ]] && iniset $HEAT_CONF paste_deploy flavor standalone
 
@@ -211,9 +202,11 @@
     # Note we have to pass token/endpoint here because the current endpoint and
     # version negotiation in OSC means just --os-identity-api-version=3 won't work
     KS_ENDPOINT_V3="$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3"
-    openstack --os-token $OS_SERVICE_TOKEN --os-url=$KS_ENDPOINT_V3 \
+    D_ID=$(openstack --os-token $OS_TOKEN --os-url=$KS_ENDPOINT_V3 \
         --os-identity-api-version=3 domain create heat \
-        --description "Owns users and projects created by heat"
+        --description "Owns users and projects created by heat" \
+        | grep ' id ' | get_field 2)
+    iniset $HEAT_CONF DEFAULT stack_user_domain ${D_ID}
 }
 
 # Restore xtrace
diff --git a/lib/marconi b/lib/marconi
index 88312cb..1c8be49 100644
--- a/lib/marconi
+++ b/lib/marconi
@@ -2,7 +2,8 @@
 # Install and start **Marconi** service
 
 # To enable a minimal set of Marconi services, add the following to localrc:
-#   enable_service marconi-server
+#
+#     enable_service marconi-server
 #
 # Dependencies:
 # - functions
@@ -51,6 +52,11 @@
 MARCONICLIENT_REPO=${MARCONICLIENT_REPO:-${GIT_BASE}/openstack/python-marconiclient.git}
 MARCONICLIENT_BRANCH=${MARCONICLIENT_BRANCH:-master}
 
+# Set Marconi Connection Info
+MARCONI_SERVICE_HOST=${MARCONI_SERVICE_HOST:-$SERVICE_HOST}
+MARCONI_SERVICE_PORT=${MARCONI_SERVICE_PORT:-8888}
+MARCONI_SERVICE_PROTOCOL=${MARCONI_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
+
 # Tell Tempest this project is present
 TEMPEST_SERVICES+=,marconi
 
@@ -68,7 +74,9 @@
 # cleanup_marconi() - Remove residual data files, anything left over from previous
 # runs that a clean run would need to clean up
 function cleanup_marconi() {
-    mongo marconi --eval "db.dropDatabase();"
+    if ! timeout $SERVICE_TIMEOUT sh -c "while ! mongo marconi --eval 'db.dropDatabase();'; do sleep 1; done"; then
+        die $LINENO "Mongo DB did not start"
+    fi
 }
 
 # configure_marconiclient() - Set config files, create data dirs, etc
@@ -87,7 +95,7 @@
     sudo chown $USER $MARCONI_API_LOG_DIR
 
     iniset $MARCONI_CONF DEFAULT verbose True
-    iniset $MARCONI_CONF 'drivers:transport:wsgi' bind '0.0.0.0'
+    iniset $MARCONI_CONF 'drivers:transport:wsgi' bind $MARCONI_SERVICE_HOST
 
     iniset $MARCONI_CONF keystone_authtoken auth_protocol http
     iniset $MARCONI_CONF keystone_authtoken admin_user marconi
@@ -140,6 +148,10 @@
 # start_marconi() - Start running processes, including screen
 function start_marconi() {
     screen_it marconi-server "marconi-server --config-file $MARCONI_CONF"
+    echo "Waiting for Marconi to start..."
+    if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- $MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT/v1/health; do sleep 1; done"; then
+        die $LINENO "Marconi did not start"
+    fi
 }
 
 # stop_marconi() - Stop running processes
@@ -174,9 +186,9 @@
         openstack endpoint create \
             $MARCONI_SERVICE \
             --region RegionOne \
-            --publicurl "http://$SERVICE_HOST:8888" \
-            --adminurl "http://$SERVICE_HOST:8888" \
-            --internalurl "http://$SERVICE_HOST:8888"
+            --publicurl "$MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT" \
+            --adminurl "$MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT" \
+            --internalurl "$MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT"
     fi
 
 }
diff --git a/lib/savanna-dashboard b/lib/savanna-dashboard
index 7713a78..691b23f 100644
--- a/lib/savanna-dashboard
+++ b/lib/savanna-dashboard
@@ -37,8 +37,9 @@
 
 function configure_savanna_dashboard() {
 
-    echo -e "SAVANNA_URL = \"http://$SERVICE_HOST:8386/v1.1\"\nAUTO_ASSIGNMENT_ENABLED = False" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py
-    echo -e "HORIZON_CONFIG['dashboards'] += ('savanna',)\nINSTALLED_APPS += ('savannadashboard',)" >> $HORIZON_DIR/openstack_dashboard/settings.py
+    echo -e "AUTO_ASSIGNMENT_ENABLED = False" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py
+    echo -e "HORIZON_CONFIG['dashboards'] += ('savanna',)" >> $HORIZON_DIR/openstack_dashboard/settings.py
+    echo -e "INSTALLED_APPS += ('savannadashboard',)" >> $HORIZON_DIR/openstack_dashboard/settings.py
 
     if is_service_enabled neutron; then
         echo -e "SAVANNA_USE_NEUTRON = True" >> $HORIZON_DIR/openstack_dashboard/local/local_settings.py
diff --git a/lib/stackforge b/lib/stackforge
index 718b818..5fa4570 100644
--- a/lib/stackforge
+++ b/lib/stackforge
@@ -6,8 +6,9 @@
 # This is appropriate for python libraries that release to pypi and are
 # expected to be used beyond OpenStack like, but are requirements
 # for core services in global-requirements.
-#    * wsme
-#    * pecan
+#
+#     * wsme
+#     * pecan
 #
 # This is not appropriate for stackforge projects which are early stage
 # OpenStack tools
diff --git a/lib/tempest b/lib/tempest
index c8eebfc..596750b 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -314,8 +314,8 @@
     iniset $TEMPEST_CONFIG scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0}
 
     # Volume
-    if is_service_enabled c-bak; then
-        iniset $TEMPEST_CONFIG volume volume_backup_enabled "True"
+    if ! is_service_enabled c-bak; then
+        iniset $TEMPEST_CONFIG volume-feature-enabled backup False
     fi
     CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND)
     if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then
diff --git a/run_tests.sh b/run_tests.sh
index 9d9d186..b4f26c5 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -20,7 +20,7 @@
 else
     LIBS=`find lib -type f | grep -v \.md`
     SCRIPTS=`find . -type f -name \*\.sh`
-    EXTRA="functions"
+    EXTRA="functions functions-common stackrc openrc exerciserc eucarc"
     FILES="$SCRIPTS $LIBS $EXTRA"
 fi
 
diff --git a/stackrc b/stackrc
index 56fa402..0b081c4 100644
--- a/stackrc
+++ b/stackrc
@@ -35,7 +35,18 @@
 #  enable_service neutron
 #  # Optional, to enable tempest configuration as part of devstack
 #  enable_service tempest
-ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,rabbit,tempest,mysql
+
+# core compute (glance / keystone / nova (+ nova-network))
+ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,n-sch,n-novnc,n-xvnc,n-cauth
+# cinder
+ENABLED_SERVICES+=,c-sch,c-api,c-vol
+# heat
+ENABLED_SERVICES+=,h-eng,h-api,h-api-cfn,h-api-cw
+# dashboard
+ENABLED_SERVICES+=,horizon
+# additional services
+ENABLED_SERVICES+=,rabbit,tempest,mysql
+
 
 # Tell Tempest which services are available.  The default is set here as
 # Tempest falls late in the configuration sequence.  This differs from
diff --git a/tools/create_userrc.sh b/tools/create_userrc.sh
index a2d0c52..cd5a1c9 100755
--- a/tools/create_userrc.sh
+++ b/tools/create_userrc.sh
@@ -54,9 +54,7 @@
 EOF
 }
 
-if ! options=$(getopt -o hPAp:u:r:C: -l os-username:,os-password:,os-tenant-name:,os-tenant-id:,os-auth-url:,target-dir:,skip-tenant:,os-cacert:,help,debug -- "$@")
-then
-    #parse error
+if ! options=$(getopt -o hPAp:u:r:C: -l os-username:,os-password:,os-tenant-name:,os-tenant-id:,os-auth-url:,target-dir:,skip-tenant:,os-cacert:,help,debug -- "$@"); then
     display_help
     exit 1
 fi
diff --git a/tools/fixup_stuff.sh b/tools/fixup_stuff.sh
index a28e10e..47b0cd1 100755
--- a/tools/fixup_stuff.sh
+++ b/tools/fixup_stuff.sh
@@ -70,7 +70,8 @@
 fi
 
 # Ubuntu 12.04
-# -----
+# ------------
+
 # We can regularly get kernel crashes on the 12.04 default kernel, so attempt
 # to install a new kernel
 if [[ ${DISTRO} =~ (precise) ]]; then