188
def test_open_close_ports_subordinate(self):
189
"""Verify that opening/closing ports triggers the appropriate firewall
190
management for the corresponding service units.
193
service_states, relation_state, unit_states = (
194
yield self.setup_subordinate_defaults())
195
(logging0, _), (logging1, _) = unit_states
196
logging = yield logging0.get_service_state()
197
yield logging.set_exposed_flag()
200
expected_units = self.wait_on_expected_units(
203
yield logging0.open_port(443, "tcp")
204
yield logging0.open_port(80, "tcp")
205
yield logging0.close_port(443, "tcp")
206
self.assertTrue((yield expected_units))
208
expected_units = self.wait_on_expected_units(
209
set(["logging/0", "logging/1"]))
210
yield logging0.open_port(53, "udp")
211
yield logging1.open_port(80, "tcp")
212
self.assertTrue((yield expected_units))
214
expected_units = self.wait_on_expected_units(
215
set(["logging/0", "logging/1"]))
216
yield logging.clear_exposed_flag()
217
self.assertTrue((yield expected_units))
188
221
def test_remove_service_state(self):
189
222
"""Verify that firewall mgmt for corresponding service units
190
223
is triggered upon the service's removal.