Fixed the path of the onos-netcfg

Change-Id: I60e5cdf6c8863c235395d341c4db21d4c5ba2ef3
This commit is contained in:
Devin Lim 2017-06-23 15:17:53 -07:00 committed by Thomas Vachuska
parent cde9e2f0ee
commit 0d944e2682
5 changed files with 23 additions and 11 deletions

View File

@ -25,7 +25,8 @@ export KARAF_LOG=$KARAF_ROOT/data/log/karaf.log
# Setup a path
export PATH="$PATH:$ONOS_ROOT/tools/dev/bin"
export PATH="$PATH:$ONOS_ROOT/tools/test/bin:$ONOS_ROOT/tools/test/scenarios/bin"
export PATH="$ONOS_ROOT/tools/package/runtime/bin:$PATH"
export RUN_PACK_PATH=${RUN_PACK_PATH:-$ONOS_ROOT/tools/package/runtime/bin}
export PATH="$RUN_PACK_PATH:$PATH"
export PATH="$PATH:$ONOS_ROOT/tools/build"
export PATH="$PATH:$MAVEN/bin:$KARAF_ROOT/bin"

View File

@ -10,6 +10,11 @@ if 'ONOS_ROOT' not in os.environ:
else:
ONOS_ROOT = os.environ["ONOS_ROOT"]
sys.path.append(ONOS_ROOT + "/tools/dev/mininet")
if 'RUN_PACK_PATH' not in os.environ:
print "Environment var $RUN_PACK_PATH not set"
exit()
else:
RUN_PACK_PATH = os.environ["RUN_PACK_PATH"]
from onos import ONOSCluster, ONOSCLI
from bmv2 import ONOSBmv2Switch
@ -161,7 +166,7 @@ def main(args):
# net.hosts[0].startIperfClient(net.hosts[-1], flowBw="200k", numFlows=100, duration=10)
print "Setting netcfg..."
call(("%s/tools/test/bin/onos-netcfg" % ONOS_ROOT, onosIp,
call(("%s/onos-netcfg" % RUN_PACK_PATH, onosIp,
"%s/tools/test/topos/bmv2-demo-cfg.json" % ONOS_ROOT))
if not args.onos_ip:

View File

@ -209,8 +209,8 @@ def setup(argv):
with open(filename, 'w') as outfile:
json.dump(domainCfgs[i], outfile, indent=4, separators=(',', ': '))
output = quietRun('%s/tools/test/bin/onos-netcfg %s %s &'\
% (LINCSwitch.onosDir,
output = quietRun('%s/onos-netcfg %s %s &'\
% (LINCSwitch.runPackDir,
domains[i].getControllers()[0].ip,
filename), shell=True)
# successful output contains the two characters '{}'

View File

@ -232,8 +232,8 @@ def setup(argv):
with open(filename, 'w') as outfile:
json.dump(domainCfgs[i], outfile, indent=4, separators=(',', ': '))
output = quietRun('%s/tools/test/bin/onos-netcfg %s %s &'\
% (LINCSwitch.onosDir,
output = quietRun('%s/onos-netcfg %s %s &'\
% (LINCSwitch.runPackDir,
domains[i].getControllers()[0].ip,
filename), shell=True)
# successful output contains the two characters '{}'

View File

@ -264,7 +264,7 @@ class LINCSwitch(OpticalSwitch):
sysConfig = "/home/{}/linc-oe/rel/linc/releases/1.0/sys.config".format(user)
### dict of containing dpids as key and corresponding LINC switchId as values ###
dpidsToLINCSwitchId = dpids_to_ids(sysConfig)
### ONOS Directory ###
try:
onosDir = os.environ[ 'ONOS_ROOT' ]
@ -274,6 +274,12 @@ class LINCSwitch(OpticalSwitch):
error('Please set ONOS_ROOT environment variable!\n')
else:
os.environ[ 'ONOS_ROOT' ] = onosDir
### ONOS-netcfg directory ###
try:
runPackDir = os.environ[ 'RUN_PACK_PATH' ]
except:
runPackDir = onosDir+"/tools/package/runtime/bin"
os.environ[ 'RUN_PACK_PATH' ] = runPackDir
### REST USER/PASS ###
try:
restUser = os.environ[ 'ONOS_WEB_USER' ]
@ -412,8 +418,8 @@ class LINCSwitch(OpticalSwitch):
with open("crossConnect.json", 'w') as fd:
json.dump(crossConnectJSON, fd, indent=4, separators=(',', ': '))
info('*** Pushing crossConnect.json to ONOS\n')
output = quietRun('%s/tools/test/bin/onos-netcfg %s\
Topology.json' % (self.onosDir, self.controllers[ 0 ].ip), shell=True)
output = quietRun('%s/onos-netcfg %s\
Topology.json' % (self.runPackDir, self.controllers[ 0 ].ip), shell=True)
def stop_oe(self):
'''
@ -578,8 +584,8 @@ class LINCSwitch(OpticalSwitch):
info('*** Pushing Topology.json to ONOS\n')
for index in range(len(LINCSwitch.controllers)):
output = quietRun('%s/tools/test/bin/onos-netcfg %s Topology.json &'\
% (LINCSwitch.onosDir, LINCSwitch.controllers[ index ].ip), shell=True)
output = quietRun('%s/onos-netcfg %s Topology.json &'\
% (LINCSwitch.runPackDir, LINCSwitch.controllers[ index ].ip), shell=True)
# successful output contains the two characters '{}'
# if there is more output than this, there is an issue
if output.strip('{}'):