Skip to content
Snippets Groups Projects
Commit 724f1144 authored by Bob Lantz's avatar Bob Lantz
Browse files

Changed messages slightly.

For a network, we create "links" rather than "edges" on a graph.

"Edges" is a bit confusing because the links may not be edge links on
the network!

Also, since you're not necessarily running a "test", I changed it to
just say that we're "Done."
parent 8e4d818a
No related branches found
No related tags found
No related merge requests found
......@@ -99,8 +99,11 @@
DATAPATHS = [ 'kernel' ] # [ 'user', 'kernel' ]
def init():
"Initialize Mininet."
if init.inited:
return
if os.getuid() != 0:
# Note: this script must be run as root
# Perhaps we should do so automatically!
......@@ -111,6 +114,8 @@ def init():
if not quietRun( [ 'which', 'mnexec' ] ):
raise Exception( "Could not find mnexec - check $PATH" )
fixLimits()
init.inited = False
class Mininet( object ):
"Network emulation with hosts spawned in network namespaces."
......@@ -152,11 +157,13 @@ def __init__( self, topo, switch=KernelSwitch, host=Host,
self.dps = 0 # number of created kernel datapaths
self.terms = [] # list of spawned xterm processes
init()
switch.setup()
if build:
self.build()
def addHost( self, name, mac=None, ip=None ):
"""Add host.
name: name of host to add
......@@ -292,7 +299,7 @@ def addNode( prefix, addMethod, nodeId ):
info( '\n*** Adding switches:\n' )
for switchId in sorted( topo.switches() ):
addNode( 's', self.addSwitch, switchId )
info( '\n*** Adding edges:\n' )
info( '\n*** Adding links:\n' )
for srcId, dstId in sorted( topo.edges() ):
src, dst = self.idToNode[ srcId ], self.idToNode[ dstId ]
srcPort, dstPort = topo.port( srcId, dstId )
......@@ -373,7 +380,7 @@ def stop( self ):
info( '*** Stopping %i controllers\n' % len( self.controllers ) )
for controller in self.controllers:
controller.stop()
info( '*** Test complete\n' )
info( '*** Done\n' )
def run( self, test, *args, **kwargs ):
"Perform a complete start/test/stop cycle."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment