blob: b5a3593213f06db31f94e310f6b8a62207072011 [file] [log] [blame]
Andrea Campanella4f9085e2018-05-29 12:04:16 +02001#!/bin/bash
2
Carmelo Cascone0bcbe262019-02-28 23:14:28 -08003# -----------------------------------------------------------------------------
4# Starts mininet in the network machine with the Trellis P4 topology
5# -----------------------------------------------------------------------------
Andrea Campanella4f9085e2018-05-29 12:04:16 +02006
Carmelo Cascone0bcbe262019-02-28 23:14:28 -08007set -e
8set -x
Andrea Campanella4f9085e2018-05-29 12:04:16 +02009
Carmelo Cascone0bcbe262019-02-28 23:14:28 -080010[[ ! -d "$ONOS_ROOT" ]] && echo "ONOS_ROOT is not defined" >&2 && exit 1
11. $ONOS_ROOT/tools/build/envDefaults
Andrea Campanella4f9085e2018-05-29 12:04:16 +020012
Carmelo Cascone0bcbe262019-02-28 23:14:28 -080013remote="$ONOS_USER@$OCN"
14log="screenlog.0"
15trellisp4Sh="/tmp/start_trellisp4.sh"
16stratumRoot="/home/sdn/stratum"
17
18ssh -tt ${remote} "
19 rm -f $log && echo logfile flush 1 > ~/.screenrc && \
20 echo \"cd ~/routing/trellis && \
21 sudo -E env PYTHONPATH=/tmp/bmv2_py STRATUM_ROOT=${stratumRoot} \
22 ONOS_WEB_USER=$ONOS_WEB_USER ONOS_WEB_PASS=$ONOS_WEB_PASS \
23 python trellisp4.py --onos-ip $OC1 --agent stratum\" \
24 > ${trellisp4Sh} && chmod +x ${trellisp4Sh}
25"
26
27(
28 ssh -t -t ${remote} "screen -L -S mininet sudo ${trellisp4Sh}"
29 scp ${ONOS_USER}@[${OCN}]:$log /tmp/mininet.log
30 ssh ${remote} rm -f $log
31) &
Andrea Campanella4f9085e2018-05-29 12:04:16 +020032
33
34
35
36