diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile index aa3aff588e..be8a9d4f6a 100644 --- a/tools/dev/bash_profile +++ b/tools/dev/bash_profile @@ -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" diff --git a/tools/test/topos/bmv2-demo.py b/tools/test/topos/bmv2-demo.py index d1aa5799f0..646c73535b 100644 --- a/tools/test/topos/bmv2-demo.py +++ b/tools/test/topos/bmv2-demo.py @@ -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: diff --git a/tools/test/topos/ectest.py b/tools/test/topos/ectest.py index 1b92415c5a..37acfc5d72 100755 --- a/tools/test/topos/ectest.py +++ b/tools/test/topos/ectest.py @@ -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 '{}' diff --git a/tools/test/topos/metro.py b/tools/test/topos/metro.py index 10bba5f986..76f4ed2dd6 100755 --- a/tools/test/topos/metro.py +++ b/tools/test/topos/metro.py @@ -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 '{}' diff --git a/tools/test/topos/opticalUtils.py b/tools/test/topos/opticalUtils.py index 6730b806f9..e8db648eec 100644 --- a/tools/test/topos/opticalUtils.py +++ b/tools/test/topos/opticalUtils.py @@ -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('{}'):