Add 'test_run_cvp_ha_smoke'
- TEMPEST_TARGET_NODE is taken from environment-template
class features/runtest/runtest.yaml, so this class
is required on cfg01 node
- use self.master_minion to target salt master node,
instead of hostname
Change-Id: Ib66cab9ffe001048dc4f4c52af2fd67ea53638ce
Related-Task: #PROD-25353
diff --git a/tcp_tests/tests/system/test_cvp_pipelines.py b/tcp_tests/tests/system/test_cvp_pipelines.py
index 5d2e060..80154a1 100644
--- a/tcp_tests/tests/system/test_cvp_pipelines.py
+++ b/tcp_tests/tests/system/test_cvp_pipelines.py
@@ -120,6 +120,7 @@
job_name = 'cvp-sanity'
job_parameters = {
'TEST_SET': '/var/lib/cvp-sanity/cvp_checks/tests/',
+ 'TESTS_SETTINGS': 'drivetrain_version=proposed',
}
show_step(2)
@@ -147,3 +148,67 @@
assert cvp_func_sanity_result == 'SUCCESS', "{0}\n{1}".format(
description, '\n'.join(stages))
+
+ @pytest.mark.grab_versions
+ @pytest.mark.parametrize("_", [settings.ENV_NAME])
+ @pytest.mark.run_cvp_ha_smoke
+ def test_run_cvp_ha_smoke(self, underlay_actions, salt_actions,
+ show_step, _):
+ """Runner for Pipeline CVP - HA tests
+
+ Scenario:
+ 1. Get CICD Jenkins access credentials from salt
+ 2. Run job cvp-ha with tempest set=smoke
+ 3. Get passed stages from cvp-ha
+ """
+ salt = salt_actions
+ show_step(1)
+
+ tgt = 'I@docker:client:stack:jenkins and cid01*'
+ jenkins_host = salt.get_single_pillar(
+ tgt=tgt, pillar="jenkins:client:master:host")
+ jenkins_port = salt.get_single_pillar(
+ tgt=tgt, pillar="jenkins:client:master:port")
+ jenkins_url = 'http://{0}:{1}'.format(jenkins_host, jenkins_port)
+ jenkins_user = salt.get_single_pillar(
+ tgt=tgt, pillar="jenkins:client:master:username")
+ jenkins_pass = salt.get_single_pillar(
+ tgt=tgt, pillar="jenkins:client:master:password")
+ jenkins_start_timeout = 60
+ jenkins_build_timeout = 1800
+
+ tempest_target_node = salt.get_single_pillar(
+ tgt='cfg01*',
+ pillar="runtest:tempest:test_target")
+
+ job_name = 'cvp-ha'
+ job_parameters = {
+ 'TEMPEST_TARGET_NODE': tempest_target_node,
+ 'TEMPEST_TEST_PATTERN': 'set=smoke',
+ }
+
+ show_step(2)
+ cvp_ha_smoke_result = run_jenkins_job.run_job(
+ host=jenkins_url,
+ username=jenkins_user,
+ password=jenkins_pass,
+ start_timeout=jenkins_start_timeout,
+ build_timeout=jenkins_build_timeout,
+ verbose=True,
+ job_name=job_name,
+ job_parameters=job_parameters,
+ job_output_prefix='[ cvp-ha/{build_number} {time} ] ')
+
+ show_step(3)
+ (description, stages) = get_jenkins_job_stages.get_deployment_result(
+ host=jenkins_url,
+ username=jenkins_user,
+ password=jenkins_pass,
+ job_name=job_name,
+ build_number='lastBuild')
+
+ LOG.info(description)
+ LOG.info('\n'.join(stages))
+
+ assert cvp_ha_smoke_result == 'SUCCESS', "{0}\n{1}".format(
+ description, '\n'.join(stages))