Skip to content

Commit

Permalink
fix mininext to reference tnode.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ggardner42 committed Dec 30, 2015
1 parent d826c58 commit 290d5c8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
22 changes: 12 additions & 10 deletions examples/test-ms/mininext/sdx_mininext.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def __init__( self ):
"Initialize topology"
Topo.__init__( self )

"Directory where this file / script is located"
scriptdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # script directory
# location of config dir
configdir = os.path.abspath(sys.argv[1])

"Initialize a service helper for Quagga with default options"
quaggaSvc = QuaggaService(autoStop=False)

"Path configurations for mounts"
quaggaBaseConfigPath=scriptdir + '/configs/'
quaggaBaseConfigPath = configdir

"List of Quagga host configs"
quaggaHosts = []
Expand Down Expand Up @@ -75,7 +75,7 @@ def __init__( self ):
for host in quaggaHosts:
"Set Quagga service configuration for this node"
quaggaSvcConfig = \
{ 'quaggaConfigPath' : scriptdir + '/configs/' + host.name }
{ 'quaggaConfigPath' : os.path.join(configdir, host.name) }

quaggaContainer = self.addHost( name=host.name,
ip=host.ip,
Expand All @@ -90,6 +90,8 @@ def __init__( self ):
self.addLink( quaggaContainer, main_switch , port2=host.port)

def addInterfacesForSDXNetwork( net ):
# location of tnode relative to location of this script file
scriptdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../test/tnode.py'))
hosts=net.hosts
print "Configuring participating ASs\n\n"
for host in hosts:
Expand All @@ -98,19 +100,19 @@ def addInterfacesForSDXNetwork( net ):
host.cmd('sudo ifconfig lo:1 100.0.0.1 netmask 255.255.255.0 up')
host.cmd('sudo ifconfig lo:2 100.0.0.2 netmask 255.255.255.0 up')
host.cmd('sudo ifconfig lo:110 110.0.0.1 netmask 255.255.255.0 up')
host.cmd('sudo python ../../../test/tnode.py a1 &')
host.cmd('sudo python '+scriptdir+' '+host.name+' &')
if host.name=='b1':
host.cmd('sudo ifconfig lo:140 140.0.0.1 netmask 255.255.255.0 up')
host.cmd('sudo ifconfig lo:150 150.0.0.1 netmask 255.255.255.0 up')
host.cmd('sudo python ../../../test/tnode.py b1 &')
host.cmd('sudo python '+scriptdir+' '+host.name+' &')
if host.name=='c1':
host.cmd('sudo ifconfig lo:140 140.0.0.1 netmask 255.255.255.0 up')
host.cmd('sudo ifconfig lo:150 150.0.0.1 netmask 255.255.255.0 up')
host.cmd('sudo python ../../../test/tnode.py c1 &')
host.cmd('sudo python '+scriptdir+' '+host.name+' &')
if host.name=='c2':
host.cmd('sudo ifconfig lo:140 140.0.0.1 netmask 255.255.255.0 up')
host.cmd('sudo ifconfig lo:150 150.0.0.1 netmask 255.255.255.0 up')
host.cmd('sudo python ../../../test/tnode.py c2 &')
host.cmd('sudo python '+scriptdir+' '+host.name+' &')
if host.name == "exabgp":
host.cmd( 'route add -net 172.0.0.0/16 dev exabgp-eth0')

Expand All @@ -119,8 +121,8 @@ def startNetwork():
topo = QuaggaTopo()
global net
net = Mininext(topo=topo,
controller=lambda name: RemoteController( name, ip='127.0.0.1' ))
controller=lambda name: RemoteController( name, ip='127.0.0.1' ))

info( '** Starting the network\n' )
net.start()

Expand Down
10 changes: 6 additions & 4 deletions launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ case $2 in

(2)
# the following gets around issues with vagrant direct mount
sudo rm -rf ~/mini_rundir
MINICONFIGDIR=~/mini_rundir
sudo rm -rf $MINICONFIGDIR
mkdir -p $MINICONFIGDIR
cd $RUN_DIR/examples/$TEST_DIR/mininext
find * | cpio -pdm ~/mini_rundir
cd ~/mini_rundir
sudo ./sdx_mininext.py
find configs | cpio -pdm $MINICONFIGDIR
cd ~
sudo $RUN_DIR/examples/$TEST_DIR/mininext/sdx_mininext.py $MINICONFIGDIR/configs

#cd $RUN_DIR/examples/$TEST_DIR/mininext
#sudo ./sdx_mininext.py
Expand Down

0 comments on commit 290d5c8

Please sign in to comment.