예제 #1
0
 def test_delete_l2_gw_service(self):
     display_name = 'fake-gateway'
     node_uuid = _uuid()
     gw_id = self._create_gw_service(node_uuid, display_name)['uuid']
     l2gwlib.delete_l2_gw_service(self.fake_cluster, gw_id)
     results = l2gwlib.get_l2_gw_services(self.fake_cluster)
     self.assertEqual(len(results), 0)
예제 #2
0
 def test_list_l2_gw_service(self):
     gw_ids = []
     for name in ('fake-1', 'fake-2'):
         gw_ids.append(self._create_gw_service(_uuid(), name)['uuid'])
     results = l2gwlib.get_l2_gw_services(self.fake_cluster)
     self.assertEqual(len(results), 2)
     self.assertEqual(sorted(gw_ids), sorted([r['uuid'] for r in results]))
예제 #3
0
 def test_list_l2_gw_service_by_tenant(self):
     gw_ids = [self._create_gw_service(
               _uuid(), name, tenant_id=name)['uuid']
               for name in ('fake-1', 'fake-2')]
     results = l2gwlib.get_l2_gw_services(self.fake_cluster,
                                          tenant_id='fake-1')
     self.assertEqual(len(results), 1)
     self.assertEqual(results[0]['uuid'], gw_ids[0])
예제 #4
0
 def test_list_l2_gw_service_by_tenant(self):
     gw_ids = [self._create_gw_service(_uuid(), name, tenant_id=name)["uuid"] for name in ("fake-1", "fake-2")]
     results = l2gwlib.get_l2_gw_services(self.fake_cluster, tenant_id="fake-1")
     self.assertEqual(len(results), 1)
     self.assertEqual(results[0]["uuid"], gw_ids[0])