Changes to runConformanceTests method
- Added parameter target: Kubernetes node to run tests from, as in our case k8s node was named k8s-ctl01
- Removed '&' from docker log generation as it created empty files
- Strongly recommended to push together with https://gerrit.mcp.mirantis.net/#/c/10822/
Change-Id: Ic60a4fe8c1e2c6235e88ef24a84f45b44d5676c7
diff --git a/src/com/mirantis/mk/Test.groovy b/src/com/mirantis/mk/Test.groovy
index 1ac19cc..1c596a2 100644
--- a/src/com/mirantis/mk/Test.groovy
+++ b/src/com/mirantis/mk/Test.groovy
@@ -9,24 +9,24 @@
/**
* Run e2e conformance tests
*
- * @param k8s_api Kubernetes api address
- * @param image Docker image with tests
- * @param timeout Timeout waiting for e2e conformance tests
+ * @param target Kubernetes node to run tests from
+ * @param k8s_api Kubernetes api address
+ * @param image Docker image with tests
+ * @param timeout Timeout waiting for e2e conformance tests
*/
-def runConformanceTests(master, k8s_api, image, timeout=2400) {
+def runConformanceTests(master, target, k8s_api, image, timeout=2400) {
def salt = new com.mirantis.mk.Salt()
def containerName = 'conformance_tests'
def outfile = "/tmp/" + image.replaceAll('/', '-') + '.output'
- salt.cmdRun(master, 'ctl01*', "docker rm -f ${containerName}", false)
- salt.cmdRun(master, 'ctl01*', "docker run -d --name ${containerName} --net=host -e API_SERVER=${k8s_api} ${image}")
+ salt.cmdRun(master, target, "docker rm -f ${containerName}", false)
+ salt.cmdRun(master, target, "docker run -d --name ${containerName} --net=host -e API_SERVER=${k8s_api} ${image}")
sleep(10)
print("Waiting for tests to run...")
- salt.runSaltProcessStep(master, 'ctl01*', 'cmd.run', ["docker wait ${containerName}"], null, false, timeout)
+ salt.runSaltProcessStep(master, target, 'cmd.run', ["docker wait ${containerName}"], null, false, timeout)
print("Writing test results to output file...")
- salt.runSaltProcessStep(master, 'ctl01*', 'cmd.run', ["docker logs -t ${containerName} &> ${outfile}"])
-
+ salt.runSaltProcessStep(master, target, 'cmd.run', ["docker logs -t ${containerName} > ${outfile}"])
print("Conformance test output saved in " + outfile)
}