blob: db19cc4d491701cc73f81110caa36d66ea191427 [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 -x
Andrea Campanella4f9085e2018-05-29 12:04:16 +02008
Carmelo Cascone0bcbe262019-02-28 23:14:28 -08009[[ ! -d "$ONOS_ROOT" ]] && echo "ONOS_ROOT is not defined" >&2 && exit 1
10. $ONOS_ROOT/tools/build/envDefaults
Andrea Campanella4f9085e2018-05-29 12:04:16 +020011
Carmelo Cascone0bcbe262019-02-28 23:14:28 -080012remote="$ONOS_USER@$OCN"
13log="screenlog.0"
14trellisp4Sh="/tmp/start_trellisp4.sh"
15stratumRoot="/home/sdn/stratum"
16
17ssh -tt ${remote} "
18 rm -f $log && echo logfile flush 1 > ~/.screenrc && \
19 echo \"cd ~/routing/trellis && \
20 sudo -E env PYTHONPATH=/tmp/bmv2_py STRATUM_ROOT=${stratumRoot} \
21 ONOS_WEB_USER=$ONOS_WEB_USER ONOS_WEB_PASS=$ONOS_WEB_PASS \
22 python trellisp4.py --onos-ip $OC1 --agent stratum\" \
23 > ${trellisp4Sh} && chmod +x ${trellisp4Sh}
24"
25
26(
Carmelo Cascone34d116c2019-03-13 18:58:41 -070027 ssh -t -t ${remote} "screen -L -S mininet ${trellisp4Sh}"
Carmelo Cascone0bcbe262019-02-28 23:14:28 -080028 scp ${ONOS_USER}@[${OCN}]:$log /tmp/mininet.log
29 ssh ${remote} rm -f $log
30) &
Andrea Campanella4f9085e2018-05-29 12:04:16 +020031
32
33
34
35