Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Carmelo Cascone | 0bcbe26 | 2019-02-28 23:14:28 -0800 | [diff] [blame] | 3 | # ----------------------------------------------------------------------------- |
| 4 | # Starts mininet in the network machine with the Trellis P4 topology |
| 5 | # ----------------------------------------------------------------------------- |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 6 | |
Carmelo Cascone | 0bcbe26 | 2019-02-28 23:14:28 -0800 | [diff] [blame] | 7 | set -e |
| 8 | set -x |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 9 | |
Carmelo Cascone | 0bcbe26 | 2019-02-28 23:14:28 -0800 | [diff] [blame] | 10 | [[ ! -d "$ONOS_ROOT" ]] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 11 | . $ONOS_ROOT/tools/build/envDefaults |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 12 | |
Carmelo Cascone | 0bcbe26 | 2019-02-28 23:14:28 -0800 | [diff] [blame] | 13 | remote="$ONOS_USER@$OCN" |
| 14 | log="screenlog.0" |
| 15 | trellisp4Sh="/tmp/start_trellisp4.sh" |
| 16 | stratumRoot="/home/sdn/stratum" |
| 17 | |
| 18 | ssh -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 Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |