|
|
@ -1624,6 +1624,7 @@ class TestPolicyCommunicationMap(NsxPolicyLibTestCase): |
|
|
|
service1_id = 'c1' |
|
|
|
service2_id = 'c2' |
|
|
|
tag = 'abc1234' |
|
|
|
tags = ['dummy'] |
|
|
|
with mock.patch.object(self.policy_api, |
|
|
|
"create_or_update") as api_call: |
|
|
|
result = self.resourceApi.create_entry( |
|
|
@ -1637,7 +1638,7 @@ class TestPolicyCommunicationMap(NsxPolicyLibTestCase): |
|
|
|
sequence_number=1, |
|
|
|
direction=nsx_constants.IN, |
|
|
|
ip_protocol=nsx_constants.IPV4, |
|
|
|
tag=tag, |
|
|
|
tag=tag, tags=tags, |
|
|
|
tenant=TEST_TENANT) |
|
|
|
|
|
|
|
expected_entry_def = self.entryDef( |
|
|
@ -1656,6 +1657,7 @@ class TestPolicyCommunicationMap(NsxPolicyLibTestCase): |
|
|
|
scope=None, |
|
|
|
logged=False, |
|
|
|
tag=tag, |
|
|
|
tags=tags, |
|
|
|
tenant=TEST_TENANT) |
|
|
|
|
|
|
|
self.assert_called_with_def(api_call, expected_entry_def) |
|
|
@ -1669,6 +1671,7 @@ class TestPolicyCommunicationMap(NsxPolicyLibTestCase): |
|
|
|
source_group = 'g1' |
|
|
|
dest_group = 'g2' |
|
|
|
tag = 'abc1234' |
|
|
|
tags = ['abc1234'] |
|
|
|
with mock.patch.object(self.policy_api, |
|
|
|
"create_or_update") as api_call: |
|
|
|
result = self.resourceApi.create_entry( |
|
|
@ -1677,7 +1680,7 @@ class TestPolicyCommunicationMap(NsxPolicyLibTestCase): |
|
|
|
source_groups=[source_group], |
|
|
|
dest_groups=[dest_group], |
|
|
|
sequence_number=1, |
|
|
|
tag=tag, |
|
|
|
tag=tag, tags=tags, |
|
|
|
tenant=TEST_TENANT) |
|
|
|
|
|
|
|
expected_entry_def = self.entryDef( |
|
|
@ -1696,6 +1699,7 @@ class TestPolicyCommunicationMap(NsxPolicyLibTestCase): |
|
|
|
scope=None, |
|
|
|
logged=False, |
|
|
|
tag=tag, |
|
|
|
tags=tags, |
|
|
|
tenant=TEST_TENANT) |
|
|
|
|
|
|
|
self.assert_called_with_def(api_call, expected_entry_def) |
|
|
@ -1713,6 +1717,7 @@ class TestPolicyCommunicationMap(NsxPolicyLibTestCase): |
|
|
|
seq_num = 1 |
|
|
|
ret_comm = {'rules': [{'sequence_number': seq_num}]} |
|
|
|
tag = 'abc1234' |
|
|
|
tags = ['dummy'] |
|
|
|
with mock.patch.object(self.policy_api, |
|
|
|
"create_or_update") as api_call,\ |
|
|
|
mock.patch.object(self.policy_api, |
|
|
@ -1724,7 +1729,7 @@ class TestPolicyCommunicationMap(NsxPolicyLibTestCase): |
|
|
|
source_groups=[source_group], |
|
|
|
dest_groups=[dest_group], |
|
|
|
logged=False, |
|
|
|
tag=tag, |
|
|
|
tag=tag, tags=tags, |
|
|
|
tenant=TEST_TENANT) |
|
|
|
|
|
|
|
expected_entry_def = self.entryDef( |
|
|
@ -1743,6 +1748,7 @@ class TestPolicyCommunicationMap(NsxPolicyLibTestCase): |
|
|
|
scope=None, |
|
|
|
logged=False, |
|
|
|
tag=tag, |
|
|
|
tags=tags, |
|
|
|
tenant=TEST_TENANT) |
|
|
|
|
|
|
|
self.assert_called_with_def(api_call, expected_entry_def) |
|
|
|