Fix stacklight-pytest install
Install stacklight-pytest into virtualenv to not broke system
libraries.
Change-Id: I89f9f00a2aacb1c86d7bbc7c047527b963f90024
diff --git a/tcp_tests/templates/shared-sl-tests.yaml b/tcp_tests/templates/shared-sl-tests.yaml
index e0f7823..fe7a98a 100644
--- a/tcp_tests/templates/shared-sl-tests.yaml
+++ b/tcp_tests/templates/shared-sl-tests.yaml
@@ -6,13 +6,14 @@
{%- macro MACRO_CLONE_SL_TESTS() %}
{############################################################}
-- description: Clone repo and install tests on cfg node
+- description: Install stacklight-pytest into virlual environemnt
cmd: |
set -e;
+ apt-get -y install python-virtualenv;
+ virtualenv venv-stacklight-pytest;
+ . venv-stacklight-pytest/bin/activate;
git clone -b {{ SL_TEST_BRANCH }} {{ SL_TEST_REPO }} /root/stacklight-pytest;
- cd /root/stacklight-pytest;
- python setup.py sdist;
- pip install dist/stacklight_tests-1.0.tar.gz --process-dependency-links
+ pip install /root/stacklight-pytest;
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 1}
skip_fail: false
@@ -24,11 +25,10 @@
- description: Configure tests
cmd: |
set -e;
+ . venv-stacklight-pytest/bin/activate;
stl-tests gen-config-mk;
- cp /usr/local/lib/python2.7/dist-packages/stacklight_tests/fixtures/config.yaml /root/stacklight-pytest/stacklight_tests/fixtures/config.yaml;
+ cp venv-stacklight-pytest/lib/python2.7/site-packages/stacklight_tests/fixtures/config.yaml /root/stacklight-pytest/stacklight_tests/fixtures/config.yaml;
node_name: {{ HOSTNAME_CFG01 }}
retry: {count: 1, delay: 1}
skip_fail: false
{%- endmacro %}
-
-