Esempio n. 1
0
    def test_create_network(self):
        """Test brocade specific network db."""

        net_id = str(uuid.uuid4())

        # Create a network
        self.context = context.get_admin_context()
        brocade_db.create_network(self.context, net_id, TEST_VLAN)

        # Get the network and verify
        net = brocade_db.get_network(self.context, net_id)
        self.assertEqual(net['id'], net_id)
        self.assertEqual(int(net['vlan']), TEST_VLAN)

        # Delete the network
        brocade_db.delete_network(self.context, net['id'])
        self.assertFalse(brocade_db.get_networks(self.context))
Esempio n. 2
0
    def test_create_network(self):
        """Test brocade specific network db."""

        net_id = str(uuid.uuid4())

        # Create a network
        self.context = context.get_admin_context()
        brocade_db.create_network(self.context, net_id, TEST_VLAN)

        # Get the network and verify
        net = brocade_db.get_network(self.context, net_id)
        self.assertEqual(net['id'], net_id)
        self.assertEqual(int(net['vlan']), TEST_VLAN)

        # Delete the network
        brocade_db.delete_network(self.context, net['id'])
        self.assertFalse(brocade_db.get_networks(self.context))
Esempio n. 3
0
 def __init__(self, ctxt):
     """Initialize the vlan as a set."""
     self.vlans = set(int(net['vlan'])
                      for net in brocade_db.get_networks(ctxt)
                      if net['vlan']
                      )
Esempio n. 4
0
 def __init__(self, ctxt):
     """Initialize the vlan as a set."""
     self.vlans = set(
         int(net['vlan']) for net in brocade_db.get_networks(ctxt)
         if net['vlan'])