Change barbican pillars in runtests
Currently we have 3 cases:
* barbican is disabled
* barbican is enabled but integration is disabled
* barbican and integration is enabled
So in this patch:
* strict tgt to ctl01
* get data separately for barbican service
and for it integration
* Add if for command as image sign is
needed only when integration set in true
Change-Id: I821c5af6e85a6937b525072094446d0eb4963c28
diff --git a/tcp_tests/managers/runtestmanager.py b/tcp_tests/managers/runtestmanager.py
index a45663b..3723fb6 100644
--- a/tcp_tests/managers/runtestmanager.py
+++ b/tcp_tests/managers/runtestmanager.py
@@ -103,10 +103,14 @@
def prepare(self):
salt_call_cmd = "salt-call -l info --hard-crash --state-output=mixed "
+ barbican_enabled = self.__salt_api.get_single_pillar(
+ tgt='ctl01*', pillar='_param:barbican_enabled')
barbican_integration = self.__salt_api.get_single_pillar(
- tgt="I@barbican:client and ctl*",
+ tgt="ctl01*",
pillar="_param:barbican_integration_enabled")
- LOG.info("barbican_integration: {}".format(barbican_integration))
+
+ LOG.info("Barbican enabled {0}: Barbican integration {1}".format(
+ barbican_enabled, barbican_integration))
commands = [
{
'description': ("Install docker-ce package and "
@@ -129,7 +133,7 @@
"runtest.orchestrate.tempest")},
]
- if barbican_integration == 'True':
+ if barbican_enabled:
commands.append({
'description': "Configure barbican",
'node_name': self.master_name,
@@ -137,7 +141,13 @@
salt_call_cmd +
" state.sls barbican.client && " +
salt_call_cmd +
- " state.sls runtest.test_accounts && " +
+ " state.sls runtest.test_accounts")},
+ )
+ if barbican_integration:
+ commands.append({
+ 'description': "Configure barbican",
+ 'node_name': self.master_name,
+ 'cmd': ("set -ex;" +
salt_call_cmd +
" state.sls runtest.barbican_sign_image")},
)