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 -x |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 8 | |
Carmelo Cascone | 0bcbe26 | 2019-02-28 23:14:28 -0800 | [diff] [blame] | 9 | [[ ! -d "$ONOS_ROOT" ]] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 10 | . $ONOS_ROOT/tools/build/envDefaults |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 11 | |
Carmelo Cascone | 0bcbe26 | 2019-02-28 23:14:28 -0800 | [diff] [blame] | 12 | remote="$ONOS_USER@$OCN" |
| 13 | log="screenlog.0" |
| 14 | trellisp4Sh="/tmp/start_trellisp4.sh" |
| 15 | stratumRoot="/home/sdn/stratum" |
| 16 | |
| 17 | ssh -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 Cascone | 34d116c | 2019-03-13 18:58:41 -0700 | [diff] [blame] | 27 | ssh -t -t ${remote} "screen -L -S mininet ${trellisp4Sh}" |
Carmelo Cascone | 0bcbe26 | 2019-02-28 23:14:28 -0800 | [diff] [blame] | 28 | scp ${ONOS_USER}@[${OCN}]:$log /tmp/mininet.log |
| 29 | ssh ${remote} rm -f $log |
| 30 | ) & |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |