Generate Tempest service list rather than hard-code it

The list of services that Tempest used to set its 'service_available'
config values was hard-coded. To be plugin-friendly have each
service (project) add its name to the TEMPEST_SERVICES variable
and use that for setting the 'service_avilable' values.

Change-Id: I208efd7fd0798b18ac2e6353ee70b773e84a2683
diff --git a/lib/ceilometer b/lib/ceilometer
index 6f3896f..30bf3ae 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -52,7 +52,10 @@
 CEILOMETER_SERVICE_PROTOCOL=http
 CEILOMETER_SERVICE_HOST=$SERVICE_HOST
 CEILOMETER_SERVICE_PORT=${CEILOMETER_SERVICE_PORT:-8777}
-#
+
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,ceilometer
+
 
 # Functions
 # ---------
diff --git a/lib/cinder b/lib/cinder
index d76a41d..9f70b2a 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -79,6 +79,9 @@
 
 VOLUME_NAME_PREFIX=${VOLUME_NAME_PREFIX:-volume-}
 
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,cinder
+
 
 # Functions
 # ---------
diff --git a/lib/glance b/lib/glance
index 55d5fb3..2d41ea4 100644
--- a/lib/glance
+++ b/lib/glance
@@ -52,6 +52,9 @@
 # Glance connection info.  Note the port must be specified.
 GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$SERVICE_HOST:9292}
 
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,glance
+
 
 # Functions
 # ---------
diff --git a/lib/heat b/lib/heat
index b9b8aa6..467619f 100644
--- a/lib/heat
+++ b/lib/heat
@@ -38,6 +38,10 @@
 HEAT_ENV_DIR=$HEAT_CONF_DIR/environment.d
 HEAT_TEMPLATES_DIR=$HEAT_CONF_DIR/templates
 
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,heat
+
+
 # Functions
 # ---------
 
diff --git a/lib/horizon b/lib/horizon
index 5bff712..c64d850 100644
--- a/lib/horizon
+++ b/lib/horizon
@@ -31,6 +31,9 @@
 # The example file in Horizon repo is used by default.
 HORIZON_SETTINGS=${HORIZON_SETTINGS:-$HORIZON_DIR/openstack_dashboard/local/local_settings.py.example}
 
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,horizon
+
 
 # Functions
 # ---------
diff --git a/lib/ironic b/lib/ironic
index afbc3e0..b8838f5 100644
--- a/lib/ironic
+++ b/lib/ironic
@@ -42,6 +42,9 @@
 IRONIC_SERVICE_PROTOCOL=http
 IRONIC_HOSTPORT=${IRONIC_HOSTPORT:-$SERVICE_HOST:6385}
 
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,ironic
+
 
 # Functions
 # ---------
diff --git a/lib/marconi b/lib/marconi
index 6b9ffdc..1eaebbd 100644
--- a/lib/marconi
+++ b/lib/marconi
@@ -51,6 +51,10 @@
 MARCONICLIENT_REPO=${MARCONICLIENT_REPO:-${GIT_BASE}/openstack/python-marconiclient.git}
 MARCONICLIENT_BRANCH=${MARCONICLIENT_BRANCH:-master}
 
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,marconi
+
+
 # Functions
 # ---------
 
diff --git a/lib/neutron b/lib/neutron
index 960f11b..68dfd4a 100644
--- a/lib/neutron
+++ b/lib/neutron
@@ -237,6 +237,10 @@
     Q_USE_SECGROUP=False
 fi
 
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,neutron
+
+
 # Functions
 # ---------
 
diff --git a/lib/nova b/lib/nova
index dbaa3f5..9db19ed 100644
--- a/lib/nova
+++ b/lib/nova
@@ -122,6 +122,9 @@
 TEST_FLOATING_POOL=${TEST_FLOATING_POOL:-test}
 TEST_FLOATING_RANGE=${TEST_FLOATING_RANGE:-192.168.253.0/29}
 
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,nova
+
 
 # Functions
 # ---------
diff --git a/lib/savanna b/lib/savanna
index c7d59f7..176f290 100644
--- a/lib/savanna
+++ b/lib/savanna
@@ -40,6 +40,10 @@
     SAVANNA_BIN_DIR=$(get_python_exec_prefix)
 fi
 
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,savanna
+
+
 # Functions
 # ---------
 
diff --git a/lib/swift b/lib/swift
index 37b630c..afdf995 100644
--- a/lib/swift
+++ b/lib/swift
@@ -111,6 +111,9 @@
 CONTAINER_PORT_BASE=${CONTAINER_PORT_BASE:-6011}
 ACCOUNT_PORT_BASE=${ACCOUNT_PORT_BASE:-6012}
 
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,swift
+
 
 # Functions
 # ---------
diff --git a/lib/tempest b/lib/tempest
index ef9dfe2..ee99665 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -329,7 +329,7 @@
     iniset $TEMPEST_CONF network-feature-enabled api_extensions "${NETWORK_API_EXTENSIONS:-all}"
 
     # service_available
-    for service in nova cinder glance neutron swift heat horizon ceilometer ironic savanna trove marconi; do
+    for service in ${TEMPEST_SERVICES//,/ }; do
         if is_service_enabled $service ; then
             iniset $TEMPEST_CONF service_available $service "True"
         else
diff --git a/lib/trove b/lib/trove
index 9c91024..1fd011a 100644
--- a/lib/trove
+++ b/lib/trove
@@ -38,6 +38,10 @@
     TROVE_BIN_DIR=$(get_python_exec_prefix)
 fi
 
+# Tell Tempest this project is present
+TEMPEST_SERVICES+=,trove
+
+
 # Functions
 # ---------
 
diff --git a/stackrc b/stackrc
index 8a0280e..197b4cf 100644
--- a/stackrc
+++ b/stackrc
@@ -37,6 +37,12 @@
 #  enable_service tempest
 ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,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
+# ``ENABLED_SERVICES`` in that the project names are used here rather than
+# the service names, i.e.: TEMPEST_SERVICES="key,glance,nova"
+TEMPEST_SERVICES=""
+
 # Set the default Nova APIs to enable
 NOVA_ENABLED_APIS=ec2,osapi_compute,metadata