Add BATCH_SIZE parameter

Change-Id: I3164ecf4843ccf34e7e6f8e13e5389a11173248f
Related-Prod: #PROD-34436(PROD:34436)
diff --git a/jobs/pipelines/deploy-cicd-and-run-tests.groovy b/jobs/pipelines/deploy-cicd-and-run-tests.groovy
index afc07bc..82d79cc 100644
--- a/jobs/pipelines/deploy-cicd-and-run-tests.groovy
+++ b/jobs/pipelines/deploy-cicd-and-run-tests.groovy
@@ -4,6 +4,7 @@
 def shared = new com.mirantis.system_qa.SharedPipeline()
 def steps = "hardware,create_model,salt," + env.DRIVETRAIN_STACK_INSTALL + "," + env.PLATFORM_STACK_INSTALL
 def env_manager = env.ENV_MANAGER ?: 'devops'
+def batch_size = env.BATCH_SIZE ?: ''
 
 if (env_manager == 'devops') {
     jenkins_slave_node_name = "${NODE_NAME}"
@@ -48,7 +49,7 @@
         stage("Install core infrastructure and deploy CICD nodes") {
         if (env.DRIVETRAIN_STACK_INSTALL) {
                 // steps: env.DRIVETRAIN_STACK_INSTALL
-                shared.swarm_deploy_cicd(env.DRIVETRAIN_STACK_INSTALL, env.DRIVETRAIN_STACK_INSTALL_TIMEOUT, jenkins_slave_node_name, make_snapshot_stages)
+                shared.swarm_deploy_cicd(env.DRIVETRAIN_STACK_INSTALL, env.DRIVETRAIN_STACK_INSTALL_TIMEOUT, jenkins_slave_node_name, make_snapshot_stages, batch_size)
             } else {
                 common.printMsg("DRIVETRAIN_STACK_INSTALL is empty, skipping 'swarm-deploy-cicd' job", "green")
             }
@@ -57,7 +58,7 @@
         stage("Deploy platform components") {
             if (env.PLATFORM_STACK_INSTALL) {
                 // steps: env.PLATFORM_STACK_INSTALL
-                shared.swarm_deploy_platform(env.PLATFORM_STACK_INSTALL, env.PLATFORM_STACK_INSTALL_TIMEOUT, jenkins_slave_node_name, make_snapshot_stages)
+                shared.swarm_deploy_platform(env.PLATFORM_STACK_INSTALL, env.PLATFORM_STACK_INSTALL_TIMEOUT, jenkins_slave_node_name, make_snapshot_stages, batch_size)
             } else {
                 common.printMsg("PLATFORM_STACK_INSTALL is empty, skipping 'swarm-deploy-platform' job", "green")
             }
diff --git a/src/com/mirantis/system_qa/SharedPipeline.groovy b/src/com/mirantis/system_qa/SharedPipeline.groovy
index 18b70af..9f042f0 100644
--- a/src/com/mirantis/system_qa/SharedPipeline.groovy
+++ b/src/com/mirantis/system_qa/SharedPipeline.groovy
@@ -314,7 +314,7 @@
         build_pipeline_job('swarm-bootstrap-salt-cluster-heat', parameters)
 }
 
-def swarm_deploy_cicd(String stack_to_install, String install_timeout, String jenkins_slave_node_name, Boolean make_snapshot_stages) {
+def swarm_deploy_cicd(String stack_to_install, String install_timeout, String jenkins_slave_node_name, Boolean make_snapshot_stages, batch_size) {
         // Run openstack_deploy job on cfg01 Jenkins for specified stacks
         def common = new com.mirantis.mk.Common()
         def tcp_qa_refs = env.TCP_QA_REFS ?: ''
@@ -325,13 +325,14 @@
                 string(name: 'STACK_INSTALL', value: stack_to_install),
                 string(name: 'STACK_INSTALL_TIMEOUT', value: install_timeout),
                 string(name: 'TCP_QA_REFS', value: "${tcp_qa_refs}"),
+                string(name: 'BATCH_SIZE', value: batch_size),
                 booleanParam(name: 'MAKE_SNAPSHOT_STAGES', value: make_snapshot_stages),
                 booleanParam(name: 'SHUTDOWN_ENV_ON_TEARDOWN', value: false),
             ]
         build_pipeline_job('swarm-deploy-cicd', parameters)
 }
 
-def swarm_deploy_platform(String stack_to_install, String install_timeout, String jenkins_slave_node_name, Boolean make_snapshot_stages) {
+def swarm_deploy_platform(String stack_to_install, String install_timeout, String jenkins_slave_node_name, Boolean make_snapshot_stages, batch_size) {
         // Run openstack_deploy job on CICD Jenkins for specified stacks
         def common = new com.mirantis.mk.Common()
         def tcp_qa_refs = env.TCP_QA_REFS ?: ''
@@ -342,6 +343,7 @@
                 string(name: 'STACK_INSTALL', value: stack_to_install),
                 string(name: 'STACK_INSTALL_TIMEOUT', value: install_timeout),
                 string(name: 'TCP_QA_REFS', value: "${tcp_qa_refs}"),
+                string(name: 'BATCH_SIZE', value: batch_size),
                 booleanParam(name: 'MAKE_SNAPSHOT_STAGES', value: make_snapshot_stages),
                 booleanParam(name: 'SHUTDOWN_ENV_ON_TEARDOWN', value: false),
             ]
@@ -515,6 +517,7 @@
             export JENKINS_BUILD_TIMEOUT=${timeout}
             JOB_PARAMETERS=\"{
                 \\\"SALT_MASTER_URL\\\": \\\"\${SALTAPI_URL}\\\",
+                \\\"BATCH_SIZE\\\": \\\"\${BATCH_SIZE}\\\",
                 \\\"STACK_INSTALL\\\": \\\"${stack}\\\"
             }\"
             JOB_PREFIX="[ ${ENV_NAME}/{build_number}:drivetrain {time} ] "
@@ -548,6 +551,7 @@
             export JENKINS_BUILD_TIMEOUT=${timeout}
             JOB_PARAMETERS=\"{
                 \\\"SALT_MASTER_URL\\\": \\\"\${SALTAPI_URL}\\\",
+                \\\"BATCH_SIZE\\\": \\\"\${BATCH_SIZE}\\\",
                 \\\"STACK_INSTALL\\\": \\\"${stack}\\\"
             }\"
             JOB_PREFIX="[ ${ENV_NAME}/{build_number}:platform {time} ] "
diff --git a/tcp_tests/settings.py b/tcp_tests/settings.py
index 54aafae..59b2bd0 100644
--- a/tcp_tests/settings.py
+++ b/tcp_tests/settings.py
@@ -99,6 +99,7 @@
                                             'external-pool01')
 
 STACK_INSTALL = os.environ.get('STACK_INSTALL', None)
+BATCH_SIZE = os.environ.get('BATCH_SIZE', None)
 SKIP_SYNC_TIME = get_var_as_bool("SKIP_SYNC_TIME", False)
 
 # OpenStack parameters to work with Heat stacks