Skip to content
Snippets Groups Projects
Commit 49f91cf0 authored by David Hancock's avatar David Hancock
Browse files

Confirm conditions for running tests / no unwanted output

Unwanted output noted in previous commit was result of forgetting
that the hp4controller modules had been installed to /usr/local/...
via setuptools (setup.py in hp4-ctrl), so the modules being
accessed were not the ones I was modifying in my home directory.

To more easily modify these files and run tests, instead of
using setuptools we modify PYTHONPATH in .profile in the home
directory.  We must also modify sudoers to preserve the
environment when running commands via sudo, because the
test requires the use of sudo, because of mininet.

We should add basic instructions to this effect.
parent d04c6f48
No related branches found
No related tags found
No related merge requests found
......@@ -7,13 +7,6 @@
import os
import subprocess
#command = ['bash', '-c', 'set -a && source ../env.sh && env']
#proc = subprocess.Popen(command, stdout = subprocess.PIPE)
#for line in proc.stdout:
# (key, _, value) = line.partition("=")
# os.environ[key] = value
#proc.communicate()
import sys
from p4_mininet import P4Switch, P4Host
......@@ -128,6 +121,7 @@ def mndebug_print(s):
def hp4_ctrl_start(devname, slicename):
controllerpath = os.environ['HP4_CTRL_PATH'].rstrip() + '/hp4controller/controller.py'
p = subprocess.Popen([controllerpath])
# TODO: cleaner solution?
sleep(1) # wait until socket is open
......
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