blob: d92d988fd1449632f070c0f89fa100f688e52eaa [file] [log] [blame]
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +03001/**
2 *
3 * Service test pipeline
4 *
5 * Expected parameters:
6 * SALT_MASTER_URL URL of Salt master
7 * SALT_MASTER_CREDENTIALS Credentials to the Salt API
8 * Test settings:
9 * IMAGE_LINK Link to docker image with Rally
10 * RALLY_SCENARIO Rally test scenario
11 * TEST_TARGET Salt target for Rally node
12 * CLEANUP_REPORTS_AND_CONTAINER Cleanup reports from rally,tempest container, remove all containers started the IMAGE_LINK
13 * DO_CLEANUP_RESOURCES If "true": runs clean-up script for removing Rally and Tempest resources
14 */
15
16
17common = new com.mirantis.mk.Common()
18salt = new com.mirantis.mk.Salt()
19test = new com.mirantis.mk.Test()
chnyda625f4b42017-10-11 14:10:31 +020020def python = new com.mirantis.mk.Python()
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030021
chnyda625f4b42017-10-11 14:10:31 +020022def pepperEnv = "pepperEnv"
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030023
24node("python") {
25 try {
26
27 //
28 // Prepare connection
29 //
chnyda625f4b42017-10-11 14:10:31 +020030 stage('Setup virtualenv for Pepper') {
Dmitrii Kabanovf31c8962017-10-12 21:00:30 -070031 python.setupPepperVirtualenv(pepperEnv, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030032 }
33
34 //
35 // Test
36 //
37
38 stage('Run OpenStack Rally scenario') {
chnyda625f4b42017-10-11 14:10:31 +020039 test.runRallyScenarios(pepperEnv, IMAGE_LINK, TEST_TARGET, RALLY_SCENARIO, "/home/rally/rally_reports/",
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030040 DO_CLEANUP_RESOURCES)
41 }
42 stage('Copy test reports') {
chnyda625f4b42017-10-11 14:10:31 +020043 test.copyTempestResults(pepperEnv, TEST_TARGET)
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030044 }
45 stage('Archiving test artifacts') {
chnyda625f4b42017-10-11 14:10:31 +020046 test.archiveRallyArtifacts(pepperEnv, TEST_TARGET)
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030047 }
48 } catch (Throwable e) {
49 currentBuild.result = 'FAILURE'
50 throw e
51 } finally {
52 if (CLEANUP_REPORTS_AND_CONTAINER.toBoolean()) {
53 stage('Cleanup reports and container') {
chnyda625f4b42017-10-11 14:10:31 +020054 test.removeReports(pepperEnv, TEST_TARGET, "rally_reports", 'rally_reports.tar')
55 test.removeDockerContainer(pepperEnv, TEST_TARGET, IMAGE_LINK)
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030056 }
57 }
58 }
59}