コード例 #1
0
 def test_get_name_from_dn(self):
     """
     Test that ConcreteEp._get_name_from_dn returns the name
     derived from the dn provided
     """
     dn = 'topology/pod-1/node-103/sys/ctx-[vxlan-2293760]/bd-[vxlan-15597456]/db-ep/ip-[100.100.101.1]'
     self.assertEquals(ConcreteEp._get_name_from_dn(dn), '[vxlan-2293760]')
コード例 #2
0
 def test_get_table(self):
     """
     Test ConcreteEp create table function
     """
     node1 = Node('103')
     node2 = Node('102')
     concreteEp1 = ConcreteEp(node1)
     concreteEp2 = ConcreteEp(node2)
     concreteEp1.attr['tenant'] = 'tenant1'
     concreteEp1.attr['context'] = 'context1'
     concreteEp1.attr['bridge_domain'] = 'bridge_domain1'
     concreteEp2.attr['tenant'] = 'tenant2'
     concreteEp2.attr['context'] = 'context2'
     concreteEp2.attr['bridge_domain'] = 'bridge_domain2'
     concreteEps = [concreteEp1, concreteEp2]
     self.assertTrue(
         isinstance(
             ConcreteEp.get_table(concreteEps)[0],
             Table))
コード例 #3
0
 def test_get_parent_class(self):
     """
     Ensure class has the correct parent class
     """
     self.assertEquals(ConcreteEp._get_parent_class(), Node)