blob: 3f2339faa9d4dc8c613418a58ea199cbc15e6395 [file] [log] [blame]
/**
*
* Service test pipeline
*
* Expected parameters:
* SALT_MASTER_URL URL of Salt master
* SALT_MASTER_CREDENTIALS Credentials to the Salt API
* Test settings:
* IMAGE_LINK Link to docker image with Rally
* RALLY_SCENARIO Rally test scenario
* TEST_TARGET Salt target for Rally node
* CONTAINER_NAME Name of the Docker container which runs Rally
* CLEANUP_REPORTS_AND_CONTAINER Cleanup reports from rally,tempest container, remove all containers started the IMAGE_LINK
* DO_CLEANUP_RESOURCES If "true": runs clean-up script for removing Rally and Tempest resources
*/
common = new com.mirantis.mk.Common()
salt = new com.mirantis.mk.Salt()
test = new com.mirantis.mk.Test()
def python = new com.mirantis.mk.Python()
def pepperEnv = "pepperEnv"
timeout(time: 12, unit: 'HOURS') {
node("python") {
try {
//
// Prepare connection
//
stage('Setup virtualenv for Pepper') {
python.setupPepperVirtualenv(pepperEnv, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
}
//
// Test
//
stage('Run OpenStack Rally scenario') {
test.runRallyScenarios(pepperEnv, IMAGE_LINK, TEST_TARGET, RALLY_SCENARIO, "/home/rally/rally_reports/",
DO_CLEANUP_RESOURCES)
}
stage('Copy test reports') {
test.copyTempestResults(pepperEnv, TEST_TARGET)
}
stage('Archiving test artifacts') {
test.archiveRallyArtifacts(pepperEnv, TEST_TARGET)
}
} catch (Throwable e) {
currentBuild.result = 'FAILURE'
throw e
} finally {
if (CLEANUP_REPORTS_AND_CONTAINER.toBoolean()) {
stage('Cleanup reports and container') {
test.removeReports(pepperEnv, TEST_TARGET, "rally_reports", 'rally_reports.tar')
test.removeDockerContainer(pepperEnv, TEST_TARGET, CONTAINER_NAME)
}
}
}
}
}