[CVP,master] Replace hardcode in runCVPrally method
Change-Id: I3afe13f6ceb3d6c923c1b00bbecc1ed3d9090472
Related-PROD: PROD-30328
(cherry picked from commit d2bb3f24cae3d1d7ab2993e07a00b8fd662f582f)
diff --git a/src/com/mirantis/mcp/Validate.groovy b/src/com/mirantis/mcp/Validate.groovy
index e0317a8..a1079ca 100644
--- a/src/com/mirantis/mcp/Validate.groovy
+++ b/src/com/mirantis/mcp/Validate.groovy
@@ -725,16 +725,17 @@
* @param tempest_version Version of tempest to use. This value will be just passed to configure.sh script (cvp-configuration repo).
* @param conf_script_path Path to configuration script.
* @param ext_variables Some custom extra variables to add into container
+ * @param container_name Name of container to use
*/
def configureContainer(master, target, proxy, testing_tools_repo, tempest_repo,
tempest_endpoint_type="internalURL", tempest_version="",
- conf_script_path="", ext_variables = []) {
+ conf_script_path="", ext_variables = [], container_name="cvp") {
def salt = new com.mirantis.mk.Salt()
def common = new com.mirantis.mk.Common()
if (testing_tools_repo != "" ) {
workdir = ''
if (testing_tools_repo.contains('http://') || testing_tools_repo.contains('https://')) {
- salt.cmdRun(master, target, "docker exec cvp git clone ${testing_tools_repo} cvp-configuration")
+ salt.cmdRun(master, target, "docker exec ${container_name} git clone ${testing_tools_repo} cvp-configuration")
configure_script = conf_script_path != "" ? conf_script_path : "cvp-configuration/configure.sh"
}
else {
@@ -744,7 +745,7 @@
ext_variables.addAll("PROXY=${proxy}", "TEMPEST_REPO=${tempest_repo}",
"TEMPEST_ENDPOINT_TYPE=${tempest_endpoint_type}",
"tempest_version=${tempest_version}")
- salt.cmdRun(master, target, "docker exec -e " + ext_variables.join(' -e ') + " ${workdir} cvp bash -c ${configure_script}")
+ salt.cmdRun(master, target, "docker exec -e " + ext_variables.join(' -e ') + " ${workdir} ${container_name} bash -c ${configure_script}")
}
else {
common.infoMsg("TOOLS_REPO is empty, no configuration is needed for this container")
@@ -783,16 +784,17 @@
* @param test_pattern Test pattern to run
* @param scenarios_path Path to Rally scenarios
* @param output_dir Directory on target host for storing results (containers is not a good place)
+ * @param container_name Name of container to use
*/
-def runCVPrally(master, target, scenarios_path, output_dir, output_filename="docker-rally") {
+def runCVPrally(master, target, scenarios_path, output_dir, output_filename="docker-rally", container_name="cvp") {
def salt = new com.mirantis.mk.Salt()
def xml_file = "${output_filename}.xml"
def html_file = "${output_filename}.html"
- salt.cmdRun(master, target, "docker exec cvp rally task start ${scenarios_path}")
- salt.cmdRun(master, target, "docker exec cvp rally task report --out ${html_file}")
- salt.cmdRun(master, target, "docker exec cvp rally task report --junit --out ${xml_file}")
- salt.cmdRun(master, target, "docker cp cvp:/home/rally/${xml_file} ${output_dir}")
- salt.cmdRun(master, target, "docker cp cvp:/home/rally/${html_file} ${output_dir}")
+ salt.cmdRun(master, target, "docker exec ${container_name} rally task start ${scenarios_path}")
+ salt.cmdRun(master, target, "docker exec ${container_name} rally task report --out ${html_file}")
+ salt.cmdRun(master, target, "docker exec ${container_name} rally task report --junit --out ${xml_file}")
+ salt.cmdRun(master, target, "docker cp ${container_name}:/home/rally/${xml_file} ${output_dir}")
+ salt.cmdRun(master, target, "docker cp ${container_name}:/home/rally/${html_file} ${output_dir}")
}