Jakub Josef | 79ecec3 | 2017-02-17 14:36:28 +0100 | [diff] [blame] | 1 | package com.mirantis.mk |
| 2 | |
| 3 | /** |
| 4 | * |
| 5 | * Tests providing functions |
| 6 | * |
| 7 | */ |
| 8 | |
| 9 | /** |
| 10 | * Run e2e conformance tests |
| 11 | * |
| 12 | * @param k8s_api Kubernetes api address |
| 13 | * @param image Docker image with tests |
| 14 | */ |
| 15 | def runConformanceTests(master, k8s_api, image) { |
| 16 | def salt = new com.mirantis.mk.Salt() |
Tatyana Leontovich | c73d63c | 2017-02-28 14:41:38 +0200 | [diff] [blame] | 17 | salt.runSaltProcessStep(master, 'ctl01*', 'cmd.run', ["docker run --rm --net=host -e API_SERVER=${k8s_api} ${image} >> ${image}.output"]) |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Copy test output to cfg node |
| 22 | * |
| 23 | * @param image Docker image with tests |
| 24 | */ |
| 25 | def copyTestsOutput(master, image) { |
| 26 | def salt = new com.mirantis.mk.Salt() |
| 27 | salt.runSaltProcessStep(master, 'cfg01*', 'cmd.run', ["scp ctl01:/root/${image}.output /home/ubuntu/"]) |
| 28 | } |
| 29 | |
Victor Ryzhenkin | c5b3029 | 2017-02-21 19:26:24 +0400 | [diff] [blame^] | 30 | /** |
| 31 | * Execute tempest tests |
| 32 | * |
| 33 | * @param tempestLink Docker image link with rally and tempest |
| 34 | */ |
| 35 | def runTempestTests(master, tempestLink) { |
| 36 | def salt = new com.mirantis.mk.Salt() |
| 37 | salt.runSaltProcessStep(master, 'ctl01*', 'cmd.run', ["docker run --rm --net=host " + |
| 38 | "-e TEMPEST_CONF=mcp.conf " + |
| 39 | "-e SKIP_LIST=mcp_skip.list " + |
| 40 | "-e SOURCE_FILE=keystonercv3 " + |
| 41 | "-v /root/:/home/rally ${tempestLink} >> docker-tempest.log"]) |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Upload results to worker |
| 46 | * |
| 47 | */ |
| 48 | def copyTempestResults(master) { |
| 49 | def salt = new com.mirantis.mk.Salt() |
| 50 | salt.runSaltProcessStep(master, 'ctl01*', 'cmd.run', ["scp /root/docker-tempest.log cfg01:/home/ubuntu/ && " + |
| 51 | "find /root -name result.xml -exec scp {} cfg01:/home/ubuntu \\;"]) |
| 52 | } |
| 53 | |
| 54 | |
| 55 | /** |
| 56 | * Upload results to testrail |
| 57 | * |
| 58 | */ |