8 # Put built tools early in $PATH.
10 if test ! -e vswitchd
/ovs-vswitchd
; then
11 echo >&2 'not in build directory, please change directory or run via \"make check-ryu'
14 PATH
=$builddir/ovsdb
:$builddir/vswitchd
:$builddir/utilities
:$PATH; export PATH
18 '') srcdir
=$builddir ;;
20 *) srcdir
=`pwd`/$srcdir ;;
22 if test ! -e "$srcdir"/README.rst
; then
23 echo >&2 'source directory not found, please set $srcdir or run via \"make check-ryu'
27 # Make sure ryu is available.
28 if test X
"$RYUDIR" = X
; then
31 PYTHONPATH
=$RYUDIR:$PYTHONPATH; export PYTHONPATH
32 PATH
=$RYUDIR/bin
:$PATH; export PATH
33 if (ryu-manager
--version) >/dev
/null
2>&1; then
36 echo >&2 '"ryu-manager" binary not found or cannot be run, please set $RYUDIR'
46 # Set up environment for OVS programs to sandbox themselves.
47 OVS_RUNDIR
=$sandbox; export OVS_RUNDIR
48 OVS_LOGDIR
=$sandbox; export OVS_LOGDIR
49 OVS_DBDIR
=$sandbox; export OVS_DBDIR
50 OVS_SYSCONFDIR
=$sandbox; export OVS_SYSCONFDIR
52 for signal
in 0 1 2 3 13 14 15; do
53 trap 'kill `cat $sandbox/*.pid`; trap - $signal; kill -$signal $$' $signal
56 # Create database and start ovsdb-server.
59 run ovsdb-tool create conf.db
"$srcdir"/vswitchd
/vswitch.ovsschema
60 run ovsdb-server
--detach --no-chdir --pidfile -vconsole:off
--log-file \
61 --remote=punix
:"$sandbox"/db.sock
64 run ovs-vswitchd
--detach --no-chdir --pidfile -vconsole:off
--log-file \
65 --enable-dummy --disable-system -vvconn -vnetdev_dummy
67 # Add bridges for Ryu to use, and configure them to connect to Ryu.
69 'br0 0000000000000001 a b pstream=punix' \
70 'br1 0000000000000002 c d stream=unix'
73 bridge
=$1 dpid
=$2 port1
=$3 port2
=$4 stream_mode
=$5
74 run ovs-vsctl
--no-wait \
76 -- set bridge
$bridge \
77 datapath-type
=dummy fail-mode
=secure \
78 protocols
='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' \
79 other-config
:datapath-id
=$dpid \
80 -- set-controller
$bridge tcp
:127.0.0.1:6653 \
81 -- set controller
$bridge connection-mode
=out-of-band \
83 -- add-port
$bridge $port1 \
84 -- set interface
$port1 ofport_request
=1 type=dummy \
85 options
:${stream_mode}:"$sandbox"/p1.sock \
86 -- add-port
$bridge $port2 \
87 -- set interface
$port2 ofport_request
=2 type=dummy \
88 options
:${stream_mode}:"$sandbox"/p2.sock
100 logfile
=$sandbox/`echo $app | sed 's,/,.,g'`.log
103 ryu-manager
--ofp-tcp-listen-port=6653 "$app" --log-file="$logfile" & pid
=$
!
104 echo $pid > "$sandbox/ryu.pid"
107 if grep -q -E 'TEST_FINISHED|Test end|uncaught exception' "$logfile" \
114 if test $i -ge 600; then
115 echo "--- TIMEOUT after $i seconds"
126 ryu
/tests
/switch
/tester.py
131 # tweak OVS setup because the following tests assume single bridge.
132 run ovs-vsctl
-- del-br br1
135 ryu
/tests
/integrated
/test_add_flow_v10.py \
136 ryu
/tests
/integrated
/test_request_reply_v12.py \
137 ryu
/tests
/integrated
/test_add_flow_v12_actions.py \
138 ryu
/tests
/integrated
/test_add_flow_v12_matches.py
145 ----------------------------------------------------------------------
146 Logs may be found under $sandbox, e.g.:$logs
147 $sandbox/ovs-vswitchd.log
148 $sandbox/ovsdb-server.log
149 ----------------------------------------------------------------------