aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/tools/test/bin/onos-mininet
diff options
context:
space:
mode:
authorCNlucius <lukai1@huawei.com>2016-09-13 11:40:12 +0800
committerCNlucius <lukai1@huawei.com>2016-09-13 11:41:53 +0800
commitb731e2f1dd0972409b136aebc7b463dd72c9cfad (patch)
tree5107d7d80c19ad8076c2c97c2b5ef8d1cf3ab903 /framework/src/onos/tools/test/bin/onos-mininet
parentee93993458266114c29271a481ef9ce7ce621b2a (diff)
ONOSFW-171
O/S-SFC-ONOS scenario documentation Change-Id: I51ae1cf736ea24ab6680f8edca1b2bf5dd598365 Signed-off-by: CNlucius <lukai1@huawei.com>
Diffstat (limited to 'framework/src/onos/tools/test/bin/onos-mininet')
-rwxr-xr-xframework/src/onos/tools/test/bin/onos-mininet69
1 files changed, 0 insertions, 69 deletions
diff --git a/framework/src/onos/tools/test/bin/onos-mininet b/framework/src/onos/tools/test/bin/onos-mininet
deleted file mode 100755
index ef2c8ea5..00000000
--- a/framework/src/onos/tools/test/bin/onos-mininet
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-# -----------------------------------------------------------------------------
-# Starts or interacts with mininet in a remote screen session.
-# -----------------------------------------------------------------------------
-
-[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
-. $ONOS_ROOT/tools/build/envDefaults
-
-export MAX_WAIT=60
-
-cmd="$1" && shift
-log="screenlog.0"
-remote="$ONOS_USER@$OCN"
-mininet="ssh -t -t $remote screen -L -S mininet"
-
-case $cmd in
-send)
- $mininet -X "stuff \"$@\\n\"" 2>/dev/null
- ;;
-
-sendAndExpect)
- cmd=""
- for a in $*; do shift; if [ "$a" = "--expect" ]; then break; fi; cmd="$cmd $a"; done
- $mininet -X "stuff \"$cmd\\n\"" 2>/dev/null
- onos-mininet expect "$@"
- ;;
-
-wait)
- ssh $remote "
- let count=0
- sleep 1 && while test ! -f $log; do if test \$count -ge $MAX_WAIT; then exit 1; fi; sleep 1; let count=count+1; done
- while ! (tail -n1 $log | egrep -q '^mininet>'); do if [ \$count -ge $MAX_WAIT ]; then exit 1; fi; sleep 1; done
- sleep ${1-:1}
- "
- ;;
-
-expect)
- aux=/tmp/mininet.$$.log
- ssh $remote "
- sleep 1
- if [ ! -f $log ]; then exit 1; fi;
- let count=0
- while ! (tail -n1 $log | egrep -q '^mininet>'); do if test \$count -ge $MAX_WAIT; then exit 1; fi; sleep 1; let count=count+1; done
- tac $log | awk '{ print \$0; } /^mininet>/ { if (on) { exit 0; } on=1; }' | tac > $aux
- cat $aux
- set -x
- egrep \"$@\" $aux
- "
- ;;
-
-attach)
- $mininet -x
- ;;
-
-start)
- ssh $remote "rm -f $log; echo logfile flush 1 > ~/.screenrc"
- (
- $mininet "$@"
- scp $remote:$log /tmp/mininet.log
- ssh $remote rm -f $log
- ) &
- ;;
-
-stop)
- $mininet -X "stuff \"^C\\n\"" 2>/dev/null && \
- $mininet -X "stuff \"^C\\n\"" 2>/dev/null && \
- $mininet -X "stuff \"exit\\n\"" 2>/dev/null
- ;;
-esac