blob: d0f69b7dd8ad5c9b6a2a8cffa69c8ee5b62a62ea [file] [log] [blame]
Dennis Dmitrievb3b37492018-07-08 21:23:00 +03001@Library('tcp-qa')_
2
Dennis Dmitriev0f624a82018-06-11 12:57:13 +03003common = new com.mirantis.mk.Common()
Dennis Dmitrievb3b37492018-07-08 21:23:00 +03004shared = new com.mirantis.system_qa.SharedPipeline()
Dennis Dmitriev0f624a82018-06-11 12:57:13 +03005
6node ("${NODE_NAME}") {
7 try {
8
Dennis Dmitrievb3b37492018-07-08 21:23:00 +03009 stage("Clean the environment and clone tcp-qa") {
10 shared.prepare_working_dir()
Dennis Dmitriev0f624a82018-06-11 12:57:13 +030011 }
12
Dennis Dmitrievb3b37492018-07-08 21:23:00 +030013 stage("Create environment, generate mode, bootstrap the salt-cluster") {
14 shared.swarm_bootstrap_salt_cluster_devops()
Dennis Dmitriev0f624a82018-06-11 12:57:13 +030015 }
16
17 // Install core and cicd
18 stage("Run Jenkins job on salt-master [deploy_openstack:core]") {
19 shared.run_job_on_day01_node("core")
20 }
21
22 stage("Run Jenkins job on salt-master [deploy_openstack:cicd]") {
23 shared.run_job_on_day01_node("cicd")
24 }
25
26 // Install the cluster
Dennis Dmitrievb3b37492018-07-08 21:23:00 +030027 for (stack in "${PLATFORM_STACK_INSTALL}".split(",")) {
Dennis Dmitriev0f624a82018-06-11 12:57:13 +030028 stage("Run Jenkins job on CICD [deploy_openstack:${stack}]") {
29 shared.run_job_on_cicd_nodes(stack)
30 }
31 }
32
33 stage("Run tests") {
Dennis Dmitrievb3b37492018-07-08 21:23:00 +030034 shared.run_cmd("""\
Dennis Dmitriev0f624a82018-06-11 12:57:13 +030035 export ENV_NAME=${ENV_NAME}
36 . ./tcp_tests/utils/env_salt
37 . ./tcp_tests/utils/env_k8s
38
39 # Initialize variables used in tcp-qa tests
Dennis Dmitrievea48cf52018-07-18 18:04:39 +030040 export CURRENT_SNAPSHOT=stacklight_deployed # provide the snapshot name required by the test
Dennis Dmitriev0f624a82018-06-11 12:57:13 +030041 export TESTS_CONFIGS=\$(pwd)/${ENV_NAME}_salt_deployed.ini # some SSH data may be filled separatelly
42
43 export MANAGER=empty # skip 'hardware' fixture, disable snapshot/revert features
44 # export SSH='{...}' # non-empty SSH required to skip 'underlay' fixture. It is filled from TESTS_CONFIGS now
45 export salt_master_host=\$SALT_MASTER_IP # skip salt_deployed fixture
46 export salt_master_port=6969
47 export SALT_USER=\$SALTAPI_USER
48 export SALT_PASSWORD=\$SALTAPI_PASS
Dennis Dmitrievea48cf52018-07-18 18:04:39 +030049 export CORE_INSTALLED=true # skip core_deployed fixture
Dennis Dmitriev0f624a82018-06-11 12:57:13 +030050 export K8S_INSTALLED=true # skip k8s_deployed fixture
Dennis Dmitrievea48cf52018-07-18 18:04:39 +030051 export sl_installed=true # skip stacklight_deployed fixture
Dennis Dmitriev0f624a82018-06-11 12:57:13 +030052
53 py.test -vvv -s -p no:django -p no:ipdb --junit-xml=nosetests.xml -m k8s_calico_sl
54
55 #dos.py suspend ${ENV_NAME}
56 #dos.py snapshot ${ENV_NAME} test_completed
57 #dos.py resume ${ENV_NAME}
58 #dos.py time-sync ${ENV_NAME}
59 """)
60 }
61
62 } catch (e) {
63 common.printMsg("Job failed", "red")
64 throw e
65 } finally {
66 // TODO(ddmitriev): analyze the "def currentResult = currentBuild.result ?: 'SUCCESS'"
67 // and report appropriate data to TestRail
Dennis Dmitrievb3b37492018-07-08 21:23:00 +030068 shared.run_cmd("""\
Dennis Dmitriev0f624a82018-06-11 12:57:13 +030069 dos.py destroy ${ENV_NAME}
70 """)
71 }
72}