Pass DockerContainerName to tests
Change-Id: I1046c8315caeb3645c839df1f8f562a1822b2c2d
diff --git a/generate-cookiecutter-products.groovy b/generate-cookiecutter-products.groovy
index 0a2888e..b3dc718 100644
--- a/generate-cookiecutter-products.groovy
+++ b/generate-cookiecutter-products.groovy
@@ -169,7 +169,8 @@
stage("Test") {
if (sharedReclassUrl != "" && TEST_MODEL && TEST_MODEL.toBoolean()) {
sh("cp -r ${modelEnv} ${testEnv}")
- saltModelTesting.setupAndTestNode("${saltMaster}.${clusterDomain}", "", testEnv)
+ def DockerCName = "${env.JOB_NAME.toLowerCase()}_${env.BUILD_TAG.toLowerCase()}"
+ saltModelTesting.setupAndTestNode("${saltMaster}.${clusterDomain}", "", testEnv, dockerContainerName: DockerCName)
}
}
diff --git a/test-cookiecutter-reclass.groovy b/test-cookiecutter-reclass.groovy
index 14c49be..57fcb74 100644
--- a/test-cookiecutter-reclass.groovy
+++ b/test-cookiecutter-reclass.groovy
@@ -96,7 +96,9 @@
while (nbTry < 5) {
nbTry++
try {
- saltModelTesting.setupAndTestNode("cfg01.${clusterDomain}", clusterName, EXTRA_FORMULAS, testEnv, "pkg", DISTRIB_REVISION)
+ def DockerCName = "${env.JOB_NAME.toLowerCase()}_${env.BUILD_TAG.toLowerCase()}"
+ saltModelTesting.setupAndTestNode("cfg01.${clusterDomain}", clusterName, EXTRA_FORMULAS, testEnv, "pkg",
+ DISTRIB_REVISION, dockerContainerName: DockerCName)
break
} catch (Exception e) {
if (e.getMessage() == "script returned exit code 124") {
diff --git a/test-salt-model-node.groovy b/test-salt-model-node.groovy
index 7fc333d..ccea1f4 100644
--- a/test-salt-model-node.groovy
+++ b/test-salt-model-node.groovy
@@ -64,7 +64,10 @@
def workspace = common.getWorkspace()
common.infoMsg("Running salt model test for node ${NODE_TARGET} in cluster ${CLUSTER_NAME}")
try {
- saltModelTesting.setupAndTestNode(NODE_TARGET, CLUSTER_NAME, EXTRA_FORMULAS, workspace, FORMULAS_SOURCE, FORMULAS_REVISION, RECLASS_VERSION, MAX_CPU_PER_JOB.toInteger(), RECLASS_IGNORE_CLASS_NOTFOUND, LEGACY_TEST_MODE, APT_REPOSITORY, APT_REPOSITORY_GPG)
+ def DockerCName = "${env.JOB_NAME.toLowerCase()}_${env.BUILD_TAG.toLowerCase()}"
+ saltModelTesting.setupAndTestNode(NODE_TARGET, CLUSTER_NAME, EXTRA_FORMULAS, workspace, FORMULAS_SOURCE,
+ FORMULAS_REVISION, RECLASS_VERSION, MAX_CPU_PER_JOB.toInteger(), RECLASS_IGNORE_CLASS_NOTFOUND,
+ LEGACY_TEST_MODE, APT_REPOSITORY, APT_REPOSITORY_GPG, dockerContainerName: DockerCName)
} catch (Exception e) {
if (e.getMessage() == "script returned exit code 124") {
common.errorMsg("Impossible to test node due to timeout of salt-master, ABORTING BUILD")