Skip to content

Commit

Permalink
Fix netmaster starting script in tesing codes (#1064)
Browse files Browse the repository at this point in the history
We need to add fwd_mode in netmaster starting code, also ensured
log directory exists when start contiv v2plugin container.

Signed-off-by: Wei Tie <wtie@cisco.com>
  • Loading branch information
tiewei authored and chrisplo committed Nov 14, 2017
1 parent 92cd1fe commit 875b175
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion install/v2plugin/startcontiv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

set -e

if [ $log_dir == "" ]; then
if [ "$log_dir" == "" ]; then
log_dir="/var/log/contiv"
fi
mkdir -p $log_dir
BOOTUP_LOGFILE="$log_dir/plugin_bootup.log"

# Redirect stdout and stdin to BOOTUP_LOGFILE
Expand Down
9 changes: 5 additions & 4 deletions scripts/python/api/tnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def createV2Plugin(self, args=""):
# Enable v2plugin on vagrant node
def enableV2Plugin(self, role="master", args=""):
ssh_object = self.sshConnect(self.username, self.password)
command = "docker plugin set " + os.environ.get("CONTIV_V2PLUGIN_NAME", "contiv/v2plugin:0.0") + " ctrl_ip="+ self.addr + " control_url=" + self.addr + ":9999 vxlan_port=8472 iflist=eth2,eth3 plugin_name=" + os.environ.get("CONTIV_V2PLUGIN_NAME","contiv/v2plugin:0.0") + args + " >> /tmp/netplugin.log 2>&1"
fwd_mode = os.environ.get("CONTIV_V2PLUGIN_FWDMODE", "bridge")
command = "docker plugin set " + os.environ.get("CONTIV_V2PLUGIN_NAME", "contiv/v2plugin:0.0") + " ctrl_ip="+ self.addr + " control_url=" + self.addr + ":9999 vxlan_port=8472 iflist=eth2,eth3 plugin_name=" + os.environ.get("CONTIV_V2PLUGIN_NAME","contiv/v2plugin:0.0") + " fwd_mode=" + fwd_mode + " " + args + " >> /tmp/netplugin.log 2>&1"
self.runCmd(command)
command = "docker plugin enable " + os.environ.get("CONTIV_V2PLUGIN_NAME", "contiv/v2plugin:0.0") + args + " >> /tmp/netplugin.log 2>&1"
self.npThread = threading.Thread(target=ssh_exec_thread, args=(ssh_object, command))
Expand Down Expand Up @@ -107,13 +108,13 @@ def startNetmaster(self):
# npThread.setDaemon(True)
self.nmThread.start()

# Execute command in a thread
# Execute command in a thread
def runCmdThread(self, command):
ssh_object = self.sshConnect(self.username, self.password)
self.swThread = threading.Thread(target=ssh_exec_thread, args=(ssh_object, command))
self.swThread.start()
# Stop v2plugin by force rm

# Stop v2plugin by force rm
def stopV2Plugin(self, args=""):
command = "docker plugin disable " + os.environ.get("CONTIV_V2PLUGIN_NAME", "contiv/v2plugin:0.0") + "> /tmp/netplugin.log 2>&1"
command = "docker plugin rm -f " + os.environ.get("CONTIV_V2PLUGIN_NAME", "contiv/v2plugin:0.0") + "> /tmp/netplugin.log 2>&1"
Expand Down

0 comments on commit 875b175

Please sign in to comment.