From eeb7bda510ad29dce7bfc5eb8aed9b6fe25efea1 Mon Sep 17 00:00:00 2001
From: Sean Dague <sean@dague.net>
Date: Wed, 25 Mar 2015 11:55:32 -0400
Subject: [PATCH] eliminate TEST_ONLY differentiation

devstack is a development and test environment, but by default we were
only installing the runtime dependencies. We should install all the
testing required packages as well.

Change-Id: I7c95927b9daad15766aac9d1276b10ca62efb24c
---
 files/debs/general      |  2 +-
 files/debs/glance       | 10 +++++-----
 files/debs/neutron      |  6 +++---
 files/debs/nova         |  2 +-
 files/debs/trove        |  2 +-
 files/rpms-suse/general |  2 +-
 files/rpms-suse/neutron |  4 ++--
 files/rpms-suse/trove   |  2 +-
 files/rpms/general      |  2 +-
 files/rpms/glance       | 12 ++++++------
 files/rpms/neutron      |  6 +++---
 files/rpms/nova         |  2 +-
 files/rpms/trove        |  2 +-
 functions-common        | 10 ----------
 inc/python              | 23 +++++++++++------------
 stackrc                 |  3 ---
 16 files changed, 38 insertions(+), 52 deletions(-)

diff --git a/files/debs/general b/files/debs/general
index 84d43029ff..5f10a20fc3 100644
--- a/files/debs/general
+++ b/files/debs/general
@@ -6,7 +6,7 @@ psmisc
 gcc
 g++
 git
-graphviz # testonly - docs
+graphviz # needed for docs
 lsof # useful when debugging
 openssh-server
 openssl
diff --git a/files/debs/glance b/files/debs/glance
index 9fda6a63d9..37877a85c2 100644
--- a/files/debs/glance
+++ b/files/debs/glance
@@ -1,6 +1,6 @@
-libmysqlclient-dev  # testonly
-libpq-dev           # testonly
-libssl-dev          # testonly
+libmysqlclient-dev
+libpq-dev
+libssl-dev
 libxml2-dev
-libxslt1-dev        # testonly
-zlib1g-dev           # testonly
+libxslt1-dev
+zlib1g-dev
diff --git a/files/debs/neutron b/files/debs/neutron
index aa3d7095ca..2d69a71c3a 100644
--- a/files/debs/neutron
+++ b/files/debs/neutron
@@ -1,12 +1,12 @@
-acl     # testonly
+acl
 ebtables
 iptables
 iputils-ping
 iputils-arping
-libmysqlclient-dev  # testonly
+libmysqlclient-dev
 mysql-server #NOPRIME
 sudo
-postgresql-server-dev-all       # testonly
+postgresql-server-dev-all
 python-mysqldb
 python-mysql.connector
 python-qpid # NOPRIME
diff --git a/files/debs/nova b/files/debs/nova
index 0c31385ddd..9d9acde3e9 100644
--- a/files/debs/nova
+++ b/files/debs/nova
@@ -4,7 +4,7 @@ conntrack
 kpartx
 parted
 iputils-arping
-libmysqlclient-dev  # testonly
+libmysqlclient-dev
 mysql-server # NOPRIME
 python-mysqldb
 python-mysql.connector
diff --git a/files/debs/trove b/files/debs/trove
index 09dcee8104..96f8f29277 100644
--- a/files/debs/trove
+++ b/files/debs/trove
@@ -1 +1 @@
-libxslt1-dev   # testonly
+libxslt1-dev
diff --git a/files/rpms-suse/general b/files/rpms-suse/general
index 63cf14bd5b..2219426141 100644
--- a/files/rpms-suse/general
+++ b/files/rpms-suse/general
@@ -6,7 +6,7 @@ euca2ools
 gcc
 gcc-c++
 git-core
-graphviz # testonly - docs
+graphviz # docs
 iputils
 libopenssl-devel # to rebuild pyOpenSSL if needed
 lsof # useful when debugging
diff --git a/files/rpms-suse/neutron b/files/rpms-suse/neutron
index 66d6e4cad0..d278363e98 100644
--- a/files/rpms-suse/neutron
+++ b/files/rpms-suse/neutron
@@ -1,11 +1,11 @@
-acl     # testonly
+acl
 dnsmasq
 dnsmasq-utils # dist:opensuse-12.3,opensuse-13.1
 ebtables
 iptables
 iputils
 mariadb # NOPRIME
-postgresql-devel        # testonly
+postgresql-devel
 python-eventlet
 python-greenlet
 python-iso8601
diff --git a/files/rpms-suse/trove b/files/rpms-suse/trove
index 09dcee8104..96f8f29277 100644
--- a/files/rpms-suse/trove
+++ b/files/rpms-suse/trove
@@ -1 +1 @@
-libxslt1-dev   # testonly
+libxslt1-dev
diff --git a/files/rpms/general b/files/rpms/general
index eac4ec36a7..d74ecc6e98 100644
--- a/files/rpms/general
+++ b/files/rpms/general
@@ -5,7 +5,7 @@ euca2ools # only for testing client
 gcc
 gcc-c++
 git-core
-graphviz # testonly - docs
+graphviz # needed only for docs
 openssh-server
 openssl
 openssl-devel # to rebuild pyOpenSSL if needed
diff --git a/files/rpms/glance b/files/rpms/glance
index 119492a3f8..479194f918 100644
--- a/files/rpms/glance
+++ b/files/rpms/glance
@@ -1,6 +1,6 @@
-libxml2-devel       # testonly
-libxslt-devel       # testonly
-mysql-devel         # testonly
-openssl-devel       # testonly
-postgresql-devel    # testonly
-zlib-devel          # testonly
+libxml2-devel
+libxslt-devel
+mysql-devel
+openssl-devel
+postgresql-devel
+zlib-devel
diff --git a/files/rpms/neutron b/files/rpms/neutron
index c0dee78a48..8292e7bffe 100644
--- a/files/rpms/neutron
+++ b/files/rpms/neutron
@@ -1,15 +1,15 @@
 MySQL-python
-acl     # testonly
+acl
 dnsmasq # for q-dhcp
 dnsmasq-utils # for dhcp_release
 ebtables
 iptables
 iputils
 mysql-connector-python
-mysql-devel  # testonly
+mysql-devel
 mysql-server # NOPRIME
 openvswitch # NOPRIME
-postgresql-devel        # testonly
+postgresql-devel
 rabbitmq-server # NOPRIME
 qpid-cpp-server        # NOPRIME
 sqlite
diff --git a/files/rpms/nova b/files/rpms/nova
index 527928a581..ebd667454a 100644
--- a/files/rpms/nova
+++ b/files/rpms/nova
@@ -17,7 +17,7 @@ libxml2-python
 numpy # needed by websockify for spice console
 m2crypto
 mysql-connector-python
-mysql-devel  # testonly
+mysql-devel
 mysql-server # NOPRIME
 parted
 polkit
diff --git a/files/rpms/trove b/files/rpms/trove
index c5cbdea012..e7bbd43cd6 100644
--- a/files/rpms/trove
+++ b/files/rpms/trove
@@ -1 +1 @@
-libxslt-devel   # testonly
+libxslt-devel
diff --git a/functions-common b/functions-common
index f96da5b799..48e400dfb1 100644
--- a/functions-common
+++ b/functions-common
@@ -883,16 +883,6 @@ function _parse_package_files {
                 fi
             fi
 
-            # Look for # testonly in comment
-            if [[ $line =~ (.*)#.*testonly.* ]]; then
-                package=${BASH_REMATCH[1]}
-                # Are we installing test packages? (test for the default value)
-                if [[ $INSTALL_TESTONLY_PACKAGES = "False" ]]; then
-                    # If not installing test packages the skip this package
-                    inst_pkg=0
-                fi
-            fi
-
             if [[ $inst_pkg = 1 ]]; then
                 echo $package
             fi
diff --git a/inc/python b/inc/python
index 229c54009d..2d76081a52 100644
--- a/inc/python
+++ b/inc/python
@@ -101,18 +101,17 @@ function pip_install {
         $cmd_pip install \
         $@
 
-    INSTALL_TESTONLY_PACKAGES=$(trueorfalse False INSTALL_TESTONLY_PACKAGES)
-    if [[ "$INSTALL_TESTONLY_PACKAGES" == "True" ]]; then
-        local test_req="$@/test-requirements.txt"
-        if [[ -e "$test_req" ]]; then
-            $sudo_pip \
-                http_proxy=${http_proxy:-} \
-                https_proxy=${https_proxy:-} \
-                no_proxy=${no_proxy:-} \
-                PIP_FIND_LINKS=$PIP_FIND_LINKS \
-                $cmd_pip install \
-                -r $test_req
-        fi
+    # Also install test requirements
+    local test_req="$@/test-requirements.txt"
+    if [[ -e "$test_req" ]]; then
+        echo "Installing test-requirements for $test_req"
+        $sudo_pip \
+            http_proxy=${http_proxy:-} \
+            https_proxy=${https_proxy:-} \
+            no_proxy=${no_proxy:-} \
+            PIP_FIND_LINKS=$PIP_FIND_LINKS \
+            $cmd_pip install \
+            -r $test_req
     fi
 }
 
diff --git a/stackrc b/stackrc
index f8d9c43c38..a13f82a889 100644
--- a/stackrc
+++ b/stackrc
@@ -615,9 +615,6 @@ USE_SCREEN=${SCREEN_DEV:-$USE_SCREEN}
 # Set default screen name
 SCREEN_NAME=${SCREEN_NAME:-stack}
 
-# Do not install packages tagged with 'testonly' by default
-INSTALL_TESTONLY_PACKAGES=${INSTALL_TESTONLY_PACKAGES:-False}
-
 # Undo requirements changes by global requirements
 UNDO_REQUIREMENTS=${UNDO_REQUIREMENTS:-True}