Add shared sl tests yaml
Change-Id: Ic9422d44e58e2ce5d08a6371a855b7e60f8766e2
Reviewed-on: https://review.gerrithub.io/377203
Reviewed-by: Tatyanka Leontovich <tleontovich@mirantis.com>
Tested-by: Tatyanka Leontovich <tleontovich@mirantis.com>
diff --git a/tcp_tests/templates/shared-sl-tests.yaml b/tcp_tests/templates/shared-sl-tests.yaml
new file mode 100644
index 0000000..e0f7823
--- /dev/null
+++ b/tcp_tests/templates/shared-sl-tests.yaml
@@ -0,0 +1,34 @@
+{# Collection of sl tests macroses shared across different deployments #}
+
+{% set SL_TEST_BRANCH = os_env('SL_TEST_BRANCH','master') %}
+{% set SL_TEST_REPO = os_env('SL_TEST_REPO','https://github.com/dkalashnik/stacklight-pytest') %}
+{% set SL_TEST_TO_RUN = os_env('set SL_TEST_TO_RUN','stacklight_tests/tests/prometheus/test_smoke.py') %}
+
+{%- macro MACRO_CLONE_SL_TESTS() %}
+{############################################################}
+- description: Clone repo and install tests on cfg node
+ cmd: |
+ set -e;
+ 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
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 1, delay: 1}
+ skip_fail: false
+{%- endmacro %}
+
+
+{%- macro MACRO_CONFIGURE_TESTS() %}
+{#######################################################}
+- description: Configure tests
+ cmd: |
+ set -e;
+ 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;
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 1, delay: 1}
+ skip_fail: false
+{%- endmacro %}
+
+
diff --git a/tcp_tests/templates/virtual-mcp-ocata-dvr/sl.yaml b/tcp_tests/templates/virtual-mcp-ocata-dvr/sl.yaml
index b5d7bc5..c5c710a 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-dvr/sl.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-dvr/sl.yaml
@@ -1,5 +1,5 @@
{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
-
+{% import 'shared-sl-tests.yaml' as SHARED_SL_TESTS with context %}
# Install docker swarm
- description: Install keepalived on mon nodes
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
@@ -139,19 +139,7 @@
- description: Update mine
cmd: salt -C 'I@salt:minion' mine.update; sleep 5;
node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 1, delay: 10}
- skip_fail: false
-
-# Change environment configuration before deploy
-- description: Set SL docker images deploy parameters
- cmd: |
- {% for sl_opt, value in config.sl_deploy.items() %}
- {% if value|string() %}
- salt-call reclass.cluster_meta_set {{ sl_opt }} {{ value }};
- {% endif %}
- {% endfor %}
- node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 1, delay: 1}
+ retry: {count: 5, delay: 15}
skip_fail: false
# Configure the services running in Docker Swarm
@@ -185,3 +173,5 @@
retry: {count: 1, delay: 10}
skip_fail: false
+{{ SHARED_SL_TESTS.MACRO_CLONE_SL_TESTS() }}
+{{ SHARED_SL_TESTS.MACRO_CONFIGURE_TESTS() }}
diff --git a/tcp_tests/templates/virtual-mcp11-k8s-contrail/sl.yaml b/tcp_tests/templates/virtual-mcp11-k8s-contrail/sl.yaml
index d277c56..f7fb360 100644
--- a/tcp_tests/templates/virtual-mcp11-k8s-contrail/sl.yaml
+++ b/tcp_tests/templates/virtual-mcp11-k8s-contrail/sl.yaml
@@ -123,19 +123,7 @@
- description: Update mine
cmd: salt -C 'I@salt:minion' mine.update; sleep 5;
node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 1, delay: 10}
- skip_fail: false
-
-# Change environment configuration before deploy
-- description: Set SL docker images deploy parameters
- cmd: |
- {% for sl_opt, value in config.sl_deploy.items() %}
- {% if value|string() %}
- salt-call reclass.cluster_meta_set {{ sl_opt }} {{ value }};
- {% endif %}
- {% endfor %}
- node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 1, delay: 1}
+ retry: {count: 3, delay: 10}
skip_fail: false
# Configure the services running in Docker Swarm