Add tests to start Tempest tests fron cid-nodes with cvp-tempest job
Change-Id: Icb0d8e5a7d0ce4cfe12dd7ea74a18e0a81dc64cb
Related-Prod:#PROD-33098(PROD:33098)
diff --git a/tcp_tests/managers/drivetrain_manager.py b/tcp_tests/managers/drivetrain_manager.py
index 8ef758d..3851e8d 100644
--- a/tcp_tests/managers/drivetrain_manager.py
+++ b/tcp_tests/managers/drivetrain_manager.py
@@ -38,8 +38,11 @@
label='Install Drivetrain Tools')
self.__config.drivetrain.drivetrain_installed = True
- def start_job_on_cid_jenkins(self, job_name,
- **kwargs):
+ def start_job_on_jenkins(
+ self,
+ job_name,
+ jenkins_tgt='I@docker:client:stack:jenkins and cid01*',
+ **kwargs):
"""
Starts job with specific parameters on cluster Jenkins
@@ -54,7 +57,7 @@
:return: string, Result of passed job, "SUCCESS"| "FAILED" | "UNSTABLE"
"""
jenkins_url, jenkins_user, jenkins_pass = self.get_jenkins_creds(
- tgt='I@docker:client:stack:jenkins and cid01*')
+ tgt=jenkins_tgt)
job_result = run_jenkins_job.run_job(
host=jenkins_url,
diff --git a/tcp_tests/managers/runtestmanager.py b/tcp_tests/managers/runtestmanager.py
index cf9b487..0c5fdf7 100644
--- a/tcp_tests/managers/runtestmanager.py
+++ b/tcp_tests/managers/runtestmanager.py
@@ -85,11 +85,16 @@
target_host)[0]
return self.__target_minion
- def fetch_arficats(self, username=None, file_format='xml'):
+ def fetch_arficats(
+ self,
+ username=None,
+ file_format='xml',
+ report_pattern="report_*",
+ report_dir=TEMPEST_CFG_DIR):
with self.underlay.remote(node_name=self.target_name,
username=None) as tgt:
- result = tgt.execute('find {} -name "report_*.{}"'.format(
- TEMPEST_CFG_DIR, file_format))
+ result = tgt.execute('find {} -name "{}.{}"'.format(
+ report_dir, report_pattern, file_format))
LOG.debug("Find result {0}".format(result))
assert len(result['stdout']) > 0, ('No report found, please check'
' if test run was successful.')
@@ -118,7 +123,7 @@
indent=4, sort_keys=True)
f.write(container_inspect)
- def prepare(self):
+ def prepare(self, pipeline=False):
salt_call_cmd = "salt-call -l info --hard-crash --state-output=mixed "
barbican_integration = self.__salt_api.get_single_pillar(
tgt="ctl01*",
@@ -147,14 +152,18 @@
'node_name': self.target_name,
'cmd': ("set -ex;" +
salt_call_cmd + " pip.install setuptools && " +
- salt_call_cmd + " pip.install docker")},
- {
- 'description': "Generate config for Tempest",
- 'node_name': self.master_name,
- 'cmd': ("set -ex;" +
- "salt-run state.orchestrate " +
- "runtest.orchestrate.tempest")},
+ salt_call_cmd + " pip.install docker")}
]
+ if not pipeline:
+ commands.append(
+ {
+ 'description': "Generate config for Tempest",
+ 'node_name': self.master_name,
+ 'cmd': ("set -ex;" +
+ "salt-run state.orchestrate " +
+ "runtest.orchestrate.tempest")
+ }
+ )
if contrail_integration:
vsrx_router = self.__salt_api.get_single_pillar(
diff --git a/tcp_tests/tests/system/test_backup_restore.py b/tcp_tests/tests/system/test_backup_restore.py
index defe475..dddfdcc 100644
--- a/tcp_tests/tests/system/test_backup_restore.py
+++ b/tcp_tests/tests/system/test_backup_restore.py
@@ -388,7 +388,7 @@
# Execute 'backupninja_backup' pipeline to create a backup
show_step(1)
- status = dt.start_job_on_cid_jenkins(
+ status = dt.start_job_on_jenkins(
job_name=self.BACKUP_JOB_NAME,
job_parameters=self.BACKUP_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
@@ -414,7 +414,7 @@
# Restore the backup
show_step(4)
- status = dt.start_job_on_cid_jenkins(
+ status = dt.start_job_on_jenkins(
job_name=self.RESTORE_JOB_NAME,
job_parameters=self.RESTORE_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
@@ -659,7 +659,7 @@
# Execute 'backupninja_backup' pipeline to create a backup
show_step(1)
- status = dt.start_job_on_cid_jenkins(
+ status = dt.start_job_on_jenkins(
job_name=self.BACKUP_JOB_NAME,
job_parameters=self.BACKUP_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
@@ -685,7 +685,7 @@
# Restore the backup
show_step(4)
- status = dt.start_job_on_cid_jenkins(
+ status = dt.start_job_on_jenkins(
job_name=self.RESTORE_JOB_NAME,
job_parameters=self.RESTORE_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
diff --git a/tcp_tests/tests/system/test_backup_restore_cassandra.py b/tcp_tests/tests/system/test_backup_restore_cassandra.py
index 6ce692b..bbbc6f3 100644
--- a/tcp_tests/tests/system/test_backup_restore_cassandra.py
+++ b/tcp_tests/tests/system/test_backup_restore_cassandra.py
@@ -164,7 +164,7 @@
salt.run_state("I@jenkins:client", "jenkins.client")
show_step(4)
job_name = "deploy-cassandra-db-restore"
- run_cassandra_restore = dt.start_job_on_cid_jenkins(
+ run_cassandra_restore = dt.start_job_on_jenkins(
start_timeout=jenkins_start_timeout,
build_timeout=jenkins_build_timeout,
job_name=job_name)
diff --git a/tcp_tests/tests/system/test_backup_restore_galera.py b/tcp_tests/tests/system/test_backup_restore_galera.py
index fd250a5..4480f88 100644
--- a/tcp_tests/tests/system/test_backup_restore_galera.py
+++ b/tcp_tests/tests/system/test_backup_restore_galera.py
@@ -98,7 +98,7 @@
job_parameters = {
'ASK_CONFIRMATION': False
}
- backup_galera_pipeline = dt.start_job_on_cid_jenkins(
+ backup_galera_pipeline = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
@@ -122,7 +122,7 @@
'test_ceph_status', 'test_prometheus_alert_count',
'test_uncommited_changes')
}
- run_cvp_sanity = dt.start_job_on_cid_jenkins(
+ run_cvp_sanity = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_cvp_sanity_parameters)
@@ -134,7 +134,7 @@
job_parameters = {
'TEMPEST_ENDPOINT_TYPE': 'internalURL'
}
- run_cvp_tempest = dt.start_job_on_cid_jenkins(
+ run_cvp_tempest = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
@@ -148,7 +148,7 @@
'RESTORE_TYPE': 'ONLY_RESTORE',
'ASK_CONFIRMATION': False
}
- run_galera_verify_restore = dt.start_job_on_cid_jenkins(
+ run_galera_verify_restore = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
@@ -164,7 +164,7 @@
show_step(7)
job_name = 'cvp-sanity'
- run_cvp_sanity = dt.start_job_on_cid_jenkins(
+ run_cvp_sanity = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_cvp_sanity_parameters)
@@ -175,7 +175,7 @@
job_parameters = {
'TEMPEST_ENDPOINT_TYPE': 'internalURL'
}
- run_cvp_tempest = dt.start_job_on_cid_jenkins(
+ run_cvp_tempest = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
diff --git a/tcp_tests/tests/system/test_backup_restore_zookeeper.py b/tcp_tests/tests/system/test_backup_restore_zookeeper.py
index 3f6b948..b06f1f8 100644
--- a/tcp_tests/tests/system/test_backup_restore_zookeeper.py
+++ b/tcp_tests/tests/system/test_backup_restore_zookeeper.py
@@ -175,7 +175,7 @@
show_step(4)
job_name = 'deploy-zookeeper-restore'
- run_zookeeper_restore = dt.start_job_on_cid_jenkins(
+ run_zookeeper_restore = dt.start_job_on_jenkins(
start_timeout=jenkins_start_timeout,
build_timeout=jenkins_build_timeout,
job_name=job_name)
diff --git a/tcp_tests/tests/system/test_cvp_pipelines.py b/tcp_tests/tests/system/test_cvp_pipelines.py
index d010664..e55fc08 100644
--- a/tcp_tests/tests/system/test_cvp_pipelines.py
+++ b/tcp_tests/tests/system/test_cvp_pipelines.py
@@ -352,3 +352,53 @@
except jenkins.NotFoundException:
raise jenkins.NotFoundException("{0}\n{1}".format(
description, '\n'.join(stages)))
+
+ @pytest.mark.grab_versions
+ @pytest.mark.parametrize("_", [settings.ENV_NAME])
+ @pytest.mark.run_cvp_tempest
+ def test_run_cvp_tempest(
+ self,
+ salt_actions,
+ show_step,
+ drivetrain_actions,
+ tempest_actions, _):
+ """Runner for Pipeline CVP - Tempest tests
+
+ Scenario:
+ 1. Sync time on the environment nodes
+ 2. Execute pre-requites for Tempest
+ 3. Run cvp-tempest Jenkins job and get results
+ 4. Download Tempest xml report from Jenkins node to foundation
+ node
+
+ """
+ salt = salt_actions
+ dt = drivetrain_actions
+ jenkins_start_timeout = 60
+ jenkins_build_timeout = 3 * 60 * 60
+
+ show_step(1)
+ salt.sync_time()
+
+ show_step(2)
+ tempest_actions.prepare(pipeline=True)
+
+ show_step(3)
+ job_name = 'cvp-tempest'
+ job_parameters = {
+ 'TEMPEST_ENDPOINT_TYPE': 'internalURL',
+ 'TEMPEST_TEST_PATTERN': 'set=full',
+ }
+ cvp_tempest_result = dt.start_job_on_jenkins(
+ job_name,
+ jenkins_tgt='I@docker:client:stack:jenkins and cfg01*',
+ start_timeout=jenkins_start_timeout,
+ build_timeout=jenkins_build_timeout,
+ verbose=True,
+ job_parameters=job_parameters,
+ job_output_prefix='[ cvp-func/{build_number}:platform {time} ] ')
+ LOG.info('Job {0} result: {1}'.format(job_name, cvp_tempest_result))
+
+ show_step(4)
+ tempest_actions.fetch_arficats(
+ username='root', report_dir="/root/test/")
diff --git a/tcp_tests/tests/system/test_failover_ceph.py b/tcp_tests/tests/system/test_failover_ceph.py
index 6745f80..44658ea 100644
--- a/tcp_tests/tests/system/test_failover_ceph.py
+++ b/tcp_tests/tests/system/test_failover_ceph.py
@@ -126,7 +126,7 @@
# Run Tempest smoke test suite
show_step(5)
- status = dt.start_job_on_cid_jenkins(
+ status = dt.start_job_on_jenkins(
job_name=self.TEMPEST_JOB_NAME,
job_parameters=self.TEMPEST_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
@@ -141,7 +141,7 @@
# Run Sanity test
show_step(6)
- status = dt.start_job_on_cid_jenkins(
+ status = dt.start_job_on_jenkins(
job_name=self.SANITY_JOB_NAME,
job_parameters=self.SANITY_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
@@ -222,7 +222,7 @@
# Run Tempest smoke test suite
show_step(5)
- status = dt.start_job_on_cid_jenkins(
+ status = dt.start_job_on_jenkins(
job_name=self.TEMPEST_JOB_NAME,
job_parameters=self.TEMPEST_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
@@ -237,7 +237,7 @@
# Run Sanity test
show_step(6)
- status = dt.start_job_on_cid_jenkins(
+ status = dt.start_job_on_jenkins(
job_name=self.SANITY_JOB_NAME,
job_parameters=self.SANITY_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
@@ -317,7 +317,7 @@
# Run Tempest smoke test suite
show_step(5)
- status = dt.start_job_on_cid_jenkins(
+ status = dt.start_job_on_jenkins(
job_name=self.TEMPEST_JOB_NAME,
job_parameters=self.TEMPEST_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
@@ -332,7 +332,7 @@
# Run Sanity test
show_step(6)
- status = dt.start_job_on_cid_jenkins(
+ status = dt.start_job_on_jenkins(
job_name=self.SANITY_JOB_NAME,
job_parameters=self.SANITY_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
diff --git a/tcp_tests/tests/system/test_mcp_update.py b/tcp_tests/tests/system/test_mcp_update.py
index e20e579..1d275fe 100644
--- a/tcp_tests/tests/system/test_mcp_update.py
+++ b/tcp_tests/tests/system/test_mcp_update.py
@@ -147,7 +147,7 @@
job_parameters = {
'BRANCHES': 'release/proposed/2019.2.0'
}
- update_pipelines = dt.start_job_on_cid_jenkins(
+ update_pipelines = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
@@ -159,7 +159,7 @@
job_parameters = {
'BRANCHES': 'release/proposed/2019.2.0'
}
- update_pipeline_library = dt.start_job_on_cid_jenkins(
+ update_pipeline_library = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
@@ -174,7 +174,7 @@
'MK_PIPELINES_REFSPEC': 'release/proposed/2019.2.0',
'TARGET_MCP_VERSION': '2019.2.0'
}
- update_drivetrain = dt.start_job_on_cid_jenkins(
+ update_drivetrain = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters,
build_timeout=90 * 60)
@@ -214,7 +214,7 @@
show_step(3)
job_name = 'update-glusterfs'
- update_glusterfs = dt.start_job_on_cid_jenkins(
+ update_glusterfs = dt.start_job_on_jenkins(
job_name=job_name,
build_timeout=40 * 60)
@@ -286,7 +286,7 @@
'INTERACTIVE': 'false'
}
- update_galera = dt.start_job_on_cid_jenkins(
+ update_galera = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters,
build_timeout=40 * 60)
@@ -420,7 +420,7 @@
'INTERACTIVE': 'false'
}
- update_rabbit = dt.start_job_on_cid_jenkins(
+ update_rabbit = dt.start_job_on_jenkins(
job_name='deploy-upgrade-rabbitmq',
job_parameters=job_parameters,
build_timeout=40 * 60
@@ -451,7 +451,7 @@
show_step(2)
job_parameters = {}
- update_ceph = dt.start_job_on_cid_jenkins(
+ update_ceph = dt.start_job_on_jenkins(
job_name='ceph-update',
job_parameters=job_parameters)
@@ -481,7 +481,7 @@
"STAGE_UPGRADE_ES_KIBANA": True,
"STAGE_UPGRADE_SYSTEM_PART": True
}
- upgrade_control_pipeline = drivetrain.start_job_on_cid_jenkins(
+ upgrade_control_pipeline = drivetrain.start_job_on_jenkins(
job_name="stacklight-upgrade",
job_parameters=job_parameters)
@@ -533,7 +533,7 @@
"OS_DIST_UPGRADE": True,
"OS_UPGRADE": True,
"INTERACTIVE": False}
- upgrade_control_pipeline = drivetrain_actions.start_job_on_cid_jenkins(
+ upgrade_control_pipeline = drivetrain_actions.start_job_on_jenkins(
job_name="deploy-upgrade-control",
job_parameters=job_parameters)
@@ -550,7 +550,7 @@
"OS_DIST_UPGRADE": True,
"OS_UPGRADE": True,
"INTERACTIVE": False}
- upgrade_data_pipeline = drivetrain_actions.start_job_on_cid_jenkins(
+ upgrade_data_pipeline = drivetrain_actions.start_job_on_jenkins(
job_name="deploy-upgrade-ovs-gateway",
job_parameters=job_parameters)
@@ -565,7 +565,7 @@
"OS_DIST_UPGRADE": True,
"OS_UPGRADE": True,
"INTERACTIVE": False}
- upgrade_compute_pipeline = drivetrain_actions.start_job_on_cid_jenkins(
+ upgrade_compute_pipeline = drivetrain_actions.start_job_on_jenkins(
job_name="deploy-upgrade-compute",
job_parameters=job_parameters)
diff --git a/tcp_tests/tests/system/test_security_updates.py b/tcp_tests/tests/system/test_security_updates.py
index db1d7a7..0e83990 100644
--- a/tcp_tests/tests/system/test_security_updates.py
+++ b/tcp_tests/tests/system/test_security_updates.py
@@ -72,7 +72,7 @@
:param dt: DrivetrainManager, tcp-qa Drivetrain manager instance
:return: str, build execution status of cvp-sanity pipeline
"""
- return dt.start_job_on_cid_jenkins(
+ return dt.start_job_on_jenkins(
job_name=self.SANITY_JOB_NAME,
job_parameters=self.SANITY_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
@@ -128,7 +128,7 @@
# Execute 'deploy-update-package' pipeline to upgrade packages on nodes
show_step(2)
self.UPDATE_JOB_PARAMETERS["TARGET_SERVERS"] = role
- status = dt.start_job_on_cid_jenkins(
+ status = dt.start_job_on_jenkins(
job_name=self.UPDATE_JOB_NAME,
job_parameters=self.UPDATE_JOB_PARAMETERS,
start_timeout=self.JENKINS_START_TIMEOUT,
diff --git a/tcp_tests/tests/system/test_upgrade_contrail.py b/tcp_tests/tests/system/test_upgrade_contrail.py
index 6f7715c..55fa571 100644
--- a/tcp_tests/tests/system/test_upgrade_contrail.py
+++ b/tcp_tests/tests/system/test_upgrade_contrail.py
@@ -44,7 +44,7 @@
job_parameters = {
'ASK_CONFIRMATION': False
}
- update_control_vms = dt.start_job_on_cid_jenkins(
+ update_control_vms = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
assert update_control_vms == 'SUCCESS'
@@ -65,7 +65,7 @@
'test_ceph_status', 'test_prometheus_alert_count',
'test_uncommited_changes')
}
- run_cvp_sanity = dt.start_job_on_cid_jenkins(
+ run_cvp_sanity = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
assert run_cvp_sanity == 'SUCCESS'
@@ -75,7 +75,7 @@
job_parameters = {
'TEMPEST_ENDPOINT_TYPE': 'internalURL'
}
- run_cvp_tempest = dt.start_job_on_cid_jenkins(
+ run_cvp_tempest = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
assert run_cvp_tempest == 'SUCCESS'
diff --git a/tcp_tests/tests/system/test_upgrade_pike_queens.py b/tcp_tests/tests/system/test_upgrade_pike_queens.py
index 1f206f1..57ee701 100644
--- a/tcp_tests/tests/system/test_upgrade_pike_queens.py
+++ b/tcp_tests/tests/system/test_upgrade_pike_queens.py
@@ -193,28 +193,28 @@
}
# ####### Run job for ctl* ###
job_parameters["TARGET_SERVERS"] = "ctl*"
- update_control_vms = dt.start_job_on_cid_jenkins(
+ update_control_vms = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
assert update_control_vms == 'SUCCESS'
# ####### Run job for mdb* ###
job_parameters["TARGET_SERVERS"] = "mdb*"
- update_control_vms = dt.start_job_on_cid_jenkins(
+ update_control_vms = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
assert update_control_vms == 'SUCCESS'
# ####### Run job for kmn* ###
job_parameters["TARGET_SERVERS"] = "kmn*"
- update_control_vms = dt.start_job_on_cid_jenkins(
+ update_control_vms = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
assert update_control_vms == 'SUCCESS'
# ####### Run job for prx* ###
job_parameters["TARGET_SERVERS"] = "prx*"
- update_control_vms = dt.start_job_on_cid_jenkins(
+ update_control_vms = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
assert update_control_vms == 'SUCCESS'
@@ -230,7 +230,7 @@
'OS_UPGRADE': True,
'TARGET_SERVERS': "gtw*"
}
- update_gateway = dt.start_job_on_cid_jenkins(
+ update_gateway = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
assert update_gateway == 'SUCCESS'
@@ -247,7 +247,7 @@
'OS_UPGRADE': True,
'TARGET_SERVERS': "cmp*"
}
- update_computes = dt.start_job_on_cid_jenkins(
+ update_computes = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
assert update_computes == 'SUCCESS'
@@ -287,7 +287,7 @@
'test_ceph_status', 'test_prometheus_alert_count',
'test_uncommited_changes')
}
- run_cvp_sanity = dt.start_job_on_cid_jenkins(
+ run_cvp_sanity = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
assert run_cvp_sanity == 'SUCCESS'
@@ -297,7 +297,7 @@
job_parameters = {
'TEMPEST_ENDPOINT_TYPE': 'internalURL'
}
- run_cvp_tempest = dt.start_job_on_cid_jenkins(
+ run_cvp_tempest = dt.start_job_on_jenkins(
job_name=job_name,
job_parameters=job_parameters)
assert run_cvp_tempest == 'SUCCESS'