diff options
author | Yuichi Ito <ito.yuichi0@gmail.com> | 2013-12-11 17:16:58 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-12-13 17:27:49 +0900 |
commit | f3e3ccc98fdf56900be97c3784f49615575c1aed (patch) | |
tree | 85fa753de1feefe65e5c8ab508767b151e1f208a | |
parent | bef570dfe7b6f8cbbb2e9d4dfbbd5f96928f3fec (diff) |
test tool: add a script to make the test environment on mininet
What this patch implements:
This patch implements a script that provides the simple test environment that includes 2 switches and 2 links for the test tool as follows:
+-----------+
+----------| target sw | The OpenFlow switch to be tested (Open vSwitch)
| +-----------+
+------------+ (1) (2)
| controller | | |
+------------+ (1) (2)
| +-----------+
+----------| tester sw | OpenFlow Switch (Open vSwitch)
+-----------+
(X) : port number
How to run:
Do the following command:
sudo ryu/tests/switch/run_mininet.py
And then, run the test tool at another terminal:
ryu-manager ryu/tests/switch/tester.py
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rwxr-xr-x | ryu/tests/switch/run_mininet.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ryu/tests/switch/run_mininet.py b/ryu/tests/switch/run_mininet.py new file mode 100755 index 00000000..40ef3998 --- /dev/null +++ b/ryu/tests/switch/run_mininet.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +from mininet.cli import CLI +from mininet.link import Link +from mininet.net import Mininet +from mininet.node import RemoteController +from mininet.term import makeTerm + +if '__main__' == __name__: + net = Mininet(controller=RemoteController) + + c0 = net.addController('c0') + + s1 = net.addSwitch('s1') + s2 = net.addSwitch('s2') + + Link(s1, s2) + Link(s1, s2) + + net.build() + c0.start() + s1.start([c0]) + s2.start([c0]) + + s1.cmd('ovs-vsctl set Bridge s1 protocols=OpenFlow13') + s2.cmd('ovs-vsctl set Bridge s2 protocols=OpenFlow13') + + CLI(net) + + net.stop() |