2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00

ovs-test: Enhancements to the ovs-test tool

-Implemented support for ovs-test client, so that it could automatically
spawn an ovs-test server process from itself. This reduces the number of
commands the user have to type to get tests running.
-Automated creation of OVS bridges and ports (for VLAN and GRE tests), so that
user would not need to invoke ovs-vsctl manually to switch from direct, 802.1Q
and GRE tests.
-Fixed some pylint reported warnings.
-Fixed ethtool invocation so that we always try to query the physical interface
to get the driver name and version.
-and some others enhancements.

The new usage:
Node1:ovs-test -s 15531
Node2:ovs-test -c 127.0.0.1,1.1.1.1 192.168.122.151,1.1.1.2 -d -l 125 -t gre

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
This commit is contained in:
Ansis Atteka
2012-03-29 19:03:08 -07:00
parent b20a8f7c11
commit 8d25d9a254
10 changed files with 869 additions and 218 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2011 Nicira Networks
# Copyright (c) 2011, 2012 Nicira Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -29,14 +29,10 @@ class TcpListenerConnection(Protocol):
def __init__(self):
self.stats = 0
def connectionMade(self):
print "Started TCP Listener connection"
def dataReceived(self, data):
self.stats += len(data)
def connectionLost(self, reason):
print "Stopped TCP Listener connection"
self.factory.stats += self.stats
@@ -50,16 +46,10 @@ class TcpListenerFactory(Factory):
def __init__(self):
self.stats = 0
def startFactory(self):
print "Starting TCP listener factory"
def stopFactory(self):
print "Stopping TCP listener factory"
def getResults(self):
""" returns the number of bytes received as string"""
#XML RPC does not support 64bit int (http://bugs.python.org/issue2985)
#so we have to convert the amount of bytes into a string
# XML RPC does not support 64bit int (http://bugs.python.org/issue2985)
# so we have to convert the amount of bytes into a string
return str(self.stats)
@@ -104,18 +94,13 @@ class TcpSenderConnection(Protocol):
"""
def connectionMade(self):
print "Started TCP sender connection"
producer = Producer(self, self.factory.duration)
self.transport.registerProducer(producer, True)
producer.resumeProducing()
def dataReceived(self, data):
print "Sender received data!", data
self.transport.loseConnection()
def connectionLost(self, reason):
print "Stopped TCP sender connection"
class TcpSenderFactory(ClientFactory):
"""
@@ -128,12 +113,6 @@ class TcpSenderFactory(ClientFactory):
self.duration = duration
self.stats = 0
def startFactory(self):
print "Starting TCP sender factory"
def stopFactory(self):
print "Stopping TCP sender factory"
def getResults(self):
"""Returns amount of bytes sent to the Listener (as a string)"""
return str(self.stats)