def _test_create_lrouter_dnat_rule(self, func): tenant_id = 'pippo' lrouter = nvplib.create_lrouter(self.fake_cluster, tenant_id, 'fake_router', '192.168.0.1') nat_rule = func( self.fake_cluster, lrouter['uuid'], '10.0.0.99', match_criteria={'destination_ip_addresses': '192.168.0.5'}) uri = nvplib._build_uri_path(nvplib.LROUTERNAT_RESOURCE, nat_rule['uuid'], lrouter['uuid']) return json.loads( nvplib.do_single_request("GET", uri, cluster=self.fake_cluster))
def _test_create_lrouter_dnat_rule(self, func): tenant_id = 'pippo' lrouter = nvplib.create_lrouter(self.fake_cluster, tenant_id, 'fake_router', '192.168.0.1') nat_rule = func(self.fake_cluster, lrouter['uuid'], '10.0.0.99', match_criteria={'destination_ip_addresses': '192.168.0.5'}) uri = nvplib._build_uri_path(nvplib.LROUTERNAT_RESOURCE, nat_rule['uuid'], lrouter['uuid']) return json.loads(nvplib.do_single_request("GET", uri, cluster=self.fake_cluster))