blob: 5d874b1b24228af224145ae1ee81490d0480e6d1 [file] [log] [blame]
Hanna Arhipova6a897b72019-10-04 16:41:27 +03001import pytest
2from tcp_tests import logger
3
4LOG = logger.logger
5
6
7class TestAddressedIssuesMu6(object):
8 """ Patches for MU6
9 https://docs.mirantis.com/mcp/master/mcp-release-notes/mu/mu-6.html
10
11 Issues resolutions requiring manual application
12 """
13
14 def test_gnocchi_measurements(self, show_step,
15 salt_actions, reclass_actions):
16 """Apply fix for '[32645] Missing measurements in Gnocchi on
17 environments with Barbican'
18
19 Scenario:
20 1. Update reclass with ks_notifications items
21 2. Run keystone.server state for @keystone targets
22 3. Run barbican.server state for @barbican targets
23
24 https://docs.mirantis.com/mcp/master/mcp-release-notes/mu/mu-6/mu-6-addressed/mu-6-os/mu6-os-manual.html#missing-measurements-in-gnocchi-on-environments-with-barbican
25
26 """
27 reclass = reclass_actions
28 salt = salt_actions
29 # ### Skip test if cluster without barbican ###########################
30 if not salt.get_single_pillar('I@salt:master',
31 '_param:barbican_enabled'):
32 pytest.skip("Test is skipped due to absent barbican component")
33
34 # ############# Update reclass with ks_notifications items ############
35 show_step(1)
36 reclass.add_key("parameters._param.keystone_notification_topics",
37 "${_param:openstack_notification_topics},barbican",
38 "classes/cluster/*/openstack/init.yml")
39
40 reclass.add_key("parameters.barbican.server.ks_notifications_topic",
41 "barbican",
42 "classes/cluster/*/openstack/barbican.yml")
43
44 salt.run_state("I@keystone:server", "saltutil.refresh_pillar")
45 salt.run_state("I@barbican:server", "saltutil.refresh_pillar")
46
47 # ############ Run keystone.server state for @keystone ################
48 show_step(2)
49 salt.enforce_state("I@keystone:server:role:primary",
50 "keystone.server")
51 salt.enforce_state("I@keystone:server",
52 "keystone.server")
53
54 # ############ Run barbican.server state for @barbican ################
55 show_step(3)
56 salt.enforce_state("I@barbican:server:role:primary",
57 "barbican.server")
58 salt.enforce_state("I@barbican:server",
59 "barbican.server")
60
61 def test_stacklight_sf_notifier_sfdc_sandbox_enabled(
62 self, show_step,
63 salt_actions, reclass_actions):
64 """ Apply fix for 'StackLight deployment fails with stack creation
65 failed error'
66
67 Scenario:
68 1. Add sf_notifier_sfdc_sandbox_enabled to reclass
69 2. Apply docker.client state for Prometheus
70
71 https://docs.mirantis.com/mcp/master/mcp-release-notes/mu/mu-6/mu-6-addressed/mu-6-sl/mu6-sl-manual.html#stacklight-deployment-fails-with-stack-creation-failed-error
72
73 """
74 reclass = reclass_actions
75 salt = salt_actions
76
77 # ##### Add sf_notifier_sfdc_sandbox_enabled to reclass ##############
78 show_step(1)
79 # Yes, here "True" should be as a string, it's not a mistake!
80 reclass.add_key("parameters._param.sf_notifier_sfdc_sandbox_enabled",
81 "True",
82 "classes/cluster/*/stacklight/server.yml")
83
84 # ############### Apply states for Prometheus ########################
85 show_step(2)
86 tgt = "I@prometheus:server and I@docker:client"
87
88 salt.run_state(tgt, "saltutil.refresh_pillar")
89 salt.enforce_state(tgt, "docker.client")