Exemple #1
0
 def test_infrastructure(self):
     try:
         topology = app_testing_objects.Topology(self.neutron, self.nb_api)
         subnet1 = topology.create_subnet(cidr='192.168.10.0/24')
         subnet2 = topology.create_subnet(cidr='192.168.11.0/24')
         port1 = subnet1.create_port()
         port2 = subnet2.create_port()
         topology.create_router([subnet1.subnet_id, subnet2.subnet_id])
         LOG.info('Port1 name: {}'.format(port1.tap.tap.name))
         LOG.info('Port2 name: {}'.format(port2.tap.tap.name))
         test_utils.print_command(['ip', 'addr'])
         test_utils.print_command(['ovs-vsctl', 'show'], True)
         test_utils.print_command(
             ['ovs-ofctl', 'show', self.integration_bridge], True)
         test_utils.print_command(
             ['ovs-ofctl', 'dump-flows', self.integration_bridge], True)
         test_utils.print_command(['ovsdb-client', 'dump', 'Open_vSwitch'],
                                  True)
     except Exception as e:
         traceback = sys.exc_info()[2]
         try:
             topology.close()
         except Exception:
             pass  # Ignore
         # Just calling raise may raise an exception from topology.close()
         raise e, None, traceback
     topology.close()
Exemple #2
0
 def test_infrastructure(self):
     try:
         topology = app_testing_objects.Topology(self.neutron, self.nb_api)
         subnet1 = topology.create_subnet(cidr='192.168.10.0/24')
         subnet2 = topology.create_subnet(cidr='192.168.11.0/24')
         port1 = subnet1.create_port()
         port2 = subnet2.create_port()
         topology.create_router([subnet1.subnet_id, subnet2.subnet_id])
         LOG.info('Port1 name: {}'.format(port1.tap.tap.name))
         LOG.info('Port2 name: {}'.format(port2.tap.tap.name))
         test_utils.print_command(['ip', 'addr'])
         test_utils.print_command(['ovs-vsctl', 'show'], True)
         test_utils.print_command(
             ['ovs-ofctl', 'show', self.integration_bridge],
             True
         )
         test_utils.print_command(
             ['ovs-ofctl', 'dump-flows', self.integration_bridge],
             True
         )
         test_utils.print_command(
             ['ovsdb-client', 'dump', 'Open_vSwitch'],
             True
         )
     except Exception:
         with excutils.save_and_reraise_exception():
             try:
                 topology.close()
             except Exception:
                 pass  # Ignore
     topology.close()
Exemple #3
0
 def test_infrastructure(self):
     try:
         topology = app_testing_objects.Topology(self.neutron, self.nb_api)
         subnet1 = topology.create_subnet(cidr='192.168.10.0/24')
         subnet2 = topology.create_subnet(cidr='192.168.11.0/24')
         port1 = subnet1.create_port()
         port2 = subnet2.create_port()
         topology.create_router([subnet1.subnet_id, subnet2.subnet_id])
         LOG.info(_LI('Port1 name: {}').format(port1.tap.tap.name))
         LOG.info(_LI('Port2 name: {}').format(port2.tap.tap.name))
         test_utils.print_command(['ip', 'addr'])
         test_utils.print_command(['ovs-vsctl', 'show'], True)
         test_utils.print_command(
             ['ovs-ofctl', 'show', 'br-int'],
             True
         )
         test_utils.print_command(
             ['ovs-ofctl', 'dump-flows', 'br-int'],
             True
         )
         test_utils.print_command(
             ['ovsdb-client', 'dump', 'Open_vSwitch'],
             True
         )
     except Exception as e:
         traceback = sys.exc_info()[2]
         try:
             topology.close()
         except Exception:
             pass  # Ignore
         # Just calling raise may raise an exception from topology.close()
         raise e, None, traceback
     topology.close()
 def _simulate(self, port_number, packet):
     packet_str = packet_raw_data_to_hex(packet)
     args = [
         'ovs-appctl',
         'ofproto/trace',
         'br-int',
         'in_port:{}'.format(port_number),
         packet_str,
     ]
     test_utils.print_command(args, True)
 def _simulate(self, port_number, packet):
     packet_str = packet_raw_data_to_hex(packet)
     args = [
         'ovs-appctl',
         'ofproto/trace',
         'br-int',
         'in_port:{}'.format(port_number),
         packet_str,
     ]
     test_utils.print_command(args, True)