| package com.mirantis.mk |
| |
| /** |
| * |
| * Tests providing functions |
| * |
| */ |
| |
| /** |
| * Run e2e conformance tests |
| * |
| * @param k8s_api Kubernetes api address |
| * @param image Docker image with tests |
| */ |
| def runConformanceTests(master, k8s_api, image) { |
| def salt = new com.mirantis.mk.Salt() |
| def outfile = "/tmp/" + image.replaceAll('/', '-') + '.output' |
| salt.runSaltProcessStep(master, 'ctl01*', 'cmd.run', ["docker run --rm --net=host -e API_SERVER=${k8s_api} ${image} > ${outfile}"]) |
| print("Conformance test output saved in " + outfile) |
| } |
| |
| /** |
| * Copy test output to cfg node |
| * |
| * @param image Docker image with tests |
| */ |
| def copyTestsOutput(master, image) { |
| def salt = new com.mirantis.mk.Salt() |
| salt.runSaltProcessStep(master, 'cfg01*', 'cmd.run', ["scp ctl01:/root/${image}.output /home/ubuntu/"]) |
| } |
| |
| /** |
| * Execute tempest tests |
| * |
| * @param tempestLink Docker image link with rally and tempest |
| */ |
| def runTempestTests(master, tempestLink) { |
| def salt = new com.mirantis.mk.Salt() |
| salt.runSaltProcessStep(master, 'ctl01*', 'cmd.run', ["docker run --rm --net=host " + |
| "-e TEMPEST_CONF=mcp.conf " + |
| "-e SKIP_LIST=mcp_skip.list " + |
| "-e SOURCE_FILE=keystonercv3 " + |
| "-v /root/:/home/rally ${tempestLink} >> docker-tempest.log"]) |
| } |
| |
| /** |
| * Upload results to worker |
| * |
| */ |
| def copyTempestResults(master) { |
| def salt = new com.mirantis.mk.Salt() |
| salt.runSaltProcessStep(master, 'ctl01*', 'cmd.run', ["scp /root/docker-tempest.log cfg01:/home/ubuntu/ && " + |
| "find /root -name result.xml -exec scp {} cfg01:/home/ubuntu \\;"]) |
| } |
| |
| |
| /** Store tests results on host |
| * |
| * @param image Docker image name |
| */ |
| def catTestsOutput(master, image) { |
| def salt = new com.mirantis.mk.Salt() |
| salt.runSaltProcessStep(master, 'cfg01*', 'cmd.run', ["cat /home/ubuntu/${image}.output"]) |
| } |