Do not use fixture salt_deployed where it is not needed
Closes-Bug: #PROD-30630
Change-Id: Ib6126a4589f861a1ca8aa0f69691c3862daf81fe
diff --git a/tcp_tests/managers/envmanager_empty.py b/tcp_tests/managers/envmanager_empty.py
index 39fd126..99b5c01 100644
--- a/tcp_tests/managers/envmanager_empty.py
+++ b/tcp_tests/managers/envmanager_empty.py
@@ -12,7 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
+from tcp_tests import settings
from tcp_tests import settings_oslo
+from tcp_tests import logger
+
+LOG = logger.logger
class EnvironmentManagerEmpty(object):
@@ -40,6 +44,12 @@
- Store the state of the environment <name> to the 'config' object
- Save 'config' object to a file 'config_<name>.ini'
"""
+ if not settings.MAKE_SNAPSHOT_STAGES:
+ msg = ("[ SKIP snapshot '{0}' because MAKE_SNAPSHOT_STAGES=false ]"
+ .format(name))
+ LOG.info("\n\n{0}\n{1}".format(msg, '*' * len(msg)))
+ return
+
self.__config.hardware.current_snapshot = name
settings_oslo.save_config(self.__config, name)
diff --git a/tcp_tests/managers/envmanager_heat.py b/tcp_tests/managers/envmanager_heat.py
index d6d7e90..9ee26a6 100644
--- a/tcp_tests/managers/envmanager_heat.py
+++ b/tcp_tests/managers/envmanager_heat.py
@@ -389,6 +389,12 @@
:name: string
"""
+ if not settings.MAKE_SNAPSHOT_STAGES:
+ msg = ("[ SKIP snapshot '{0}' because MAKE_SNAPSHOT_STAGES=false ]"
+ .format(name))
+ LOG.info("\n\n{0}\n{1}".format(msg, '*' * len(msg)))
+ return
+
LOG.info("Store INI config (without env snapshot) named '{0}'"
.format(name))
self.__config.hardware.current_snapshot = name
diff --git a/tcp_tests/managers/saltmanager.py b/tcp_tests/managers/saltmanager.py
index 617323a..b2abdce 100644
--- a/tcp_tests/managers/saltmanager.py
+++ b/tcp_tests/managers/saltmanager.py
@@ -275,7 +275,7 @@
result = self.local(tgt=tgt, fun='cmd.run', args=cmd)
return result['return']
- @utils.retry(3, exception=libpepper.PepperException)
+ @utils.retry(10, exception=libpepper.PepperException)
def sync_time(self, tgt='*'):
LOG.info("NTP time sync on the salt minions '{0}'".format(tgt))
# Force authentication update on the next API access
@@ -297,6 +297,8 @@
' touch /tmp/maas-proxy.work;'
'fi;'
'sleep 3;'
+ # note: maas-rackd will return 'pool' after start
+ 'sed -i \'s/^pool /server /g\' /etc/ntp/maas.conf;'
'if [ -x /usr/sbin/ntpdate ]; then'
' ntpdate -s ntp.ubuntu.com;'
'else'
@@ -311,7 +313,7 @@
' systemctl start maas-regiond; fi;')
self.run_state(
tgt,
- 'cmd.run', cmd, timeout=3600) # noqa
+ 'cmd.run', cmd, timeout=360) # noqa
new_time_res = self.run_state(tgt, 'cmd.run', 'date')
for node_name, time in sorted(new_time_res[0]['return'][0].items()):
LOG.info("{0}: {1}".format(node_name, time))
diff --git a/tcp_tests/tests/system/test_k8s_actions.py b/tcp_tests/tests/system/test_k8s_actions.py
index c93e152..c6d61dd 100644
--- a/tcp_tests/tests/system/test_k8s_actions.py
+++ b/tcp_tests/tests/system/test_k8s_actions.py
@@ -203,7 +203,7 @@
@pytest.mark.k8s_genie
@pytest.mark.k8s_system
def test_k8s_genie_flannel(self, show_step, config,
- salt_deployed, k8s_deployed):
+ salt_actions, k8s_deployed):
"""Test genie-cni+flannel cni setup
Scenario:
@@ -228,15 +228,15 @@
# Find out calico and flannel networks
tgt_k8s_control = "I@kubernetes:master"
- flannel_pillar = salt_deployed.get_pillar(
+ flannel_pillar = salt_actions.get_pillar(
tgt=tgt_k8s_control,
pillar="kubernetes:master:network:flannel:private_ip_range")[0]
flannel_network = netaddr.IPNetwork(flannel_pillar.values()[0])
LOG.info("Flannel network: {}".format(flannel_network))
- calico_network_pillar = salt_deployed.get_pillar(
+ calico_network_pillar = salt_actions.get_pillar(
tgt=tgt_k8s_control, pillar="_param:calico_private_network")[0]
- calico_netmask_pillar = salt_deployed.get_pillar(
+ calico_netmask_pillar = salt_actions.get_pillar(
tgt=tgt_k8s_control, pillar="_param:calico_private_netmask")[0]
calico_network = netaddr.IPNetwork(
"{0}/{1}".format(calico_network_pillar.values()[0],
@@ -322,8 +322,7 @@
@pytest.mark.fail_snapshot
@pytest.mark.k8s_dashboard
@pytest.mark.k8s_system
- def test_k8s_dashboard(self, show_step, config,
- salt_deployed, k8s_deployed):
+ def test_k8s_dashboard(self, show_step, config, k8s_deployed):
"""Test dashboard setup
Scenario:
@@ -399,8 +398,7 @@
@pytest.mark.fail_snapshot
@pytest.mark.k8s_ingress_nginx
@pytest.mark.k8s_system
- def test_k8s_ingress_nginx(self, show_step, config,
- salt_deployed, k8s_deployed):
+ def test_k8s_ingress_nginx(self, show_step, config, k8s_deployed):
"""Test ingress-nginx configured and working with metallb
Scenario:
@@ -471,7 +469,7 @@
@pytest.mark.grab_versions
@pytest.mark.fail_snapshot
def test_k8s_cicd_upgrade(self, show_step, config,
- salt_deployed, k8s_deployed):
+ salt_actions, k8s_deployed):
"""Test k8s upgrade cicd pipeline
Scenario:
@@ -480,10 +478,10 @@
3. Wait for job to end
"""
show_step(1)
- jenkins_info = salt_deployed.get_pillar(
+ jenkins_info = salt_actions.get_pillar(
tgt='cid*1*', pillar="jenkins:client:master")[0].values()[0]
- salt_api = salt_deployed.get_pillar(
+ salt_api = salt_actions.get_pillar(
tgt='cid*1*', pillar="_param:jenkins_salt_api_url")[0].values()[0]
show_step(2)