Parametrize FORMULAS_SOURCE variable
Sometimes there is need to test setup with formulas
from git repositories.
Change-Id: Ie0294fcecf06226e9d61bfaaade8301cf98f8757
diff --git a/src/com/mirantis/mk/SaltModelTesting.groovy b/src/com/mirantis/mk/SaltModelTesting.groovy
index f1c52f3..095aa98 100644
--- a/src/com/mirantis/mk/SaltModelTesting.groovy
+++ b/src/com/mirantis/mk/SaltModelTesting.groovy
@@ -5,10 +5,11 @@
*
* @param masterName salt master's name
* @param extraFormulas extraFormulas to install
+ * @param formulasSource formulas source (git or pkg)
* @param testDir directory of model
*/
-def setupAndTestNode(masterName, extraFormulas, testDir) {
+def setupAndTestNode(masterName, extraFormulas, testDir, formulasSource = 'pkg') {
def saltOpts = "--retcode-passthrough --force-color"
def common = new com.mirantis.mk.Common()
def workspace = common.getWorkspace()
@@ -46,7 +47,7 @@
sh("git config --global user.email || git config --global user.email 'ci@ci.local'")
sh("git config --global user.name || git config --global user.name 'CI'")
- withEnv(["FORMULAS_SOURCE=pkg", "EXTRA_FORMULAS=${extraFormulas}", "DEBUG=1", "MASTER_HOSTNAME=${masterName}", "MINION_ID=${masterName}", "HOSTNAME=cfg01", "DOMAIN=mk-ci.local"]){
+ withEnv(["FORMULAS_SOURCE=${formulasSource}", "EXTRA_FORMULAS=${extraFormulas}", "DEBUG=1", "MASTER_HOSTNAME=${masterName}", "MINION_ID=${masterName}", "HOSTNAME=cfg01", "DOMAIN=mk-ci.local"]){
sh("bash -c 'echo $MASTER_HOSTNAME'")
sh("bash -c 'source /srv/salt/scripts/salt-master-init.sh; cd /srv/salt/scripts && system_config'")
sh("bash -c 'source /srv/salt/scripts/salt-master-init.sh; cd /srv/salt/scripts && saltmaster_bootstrap'")