Currently, run_mininet uses low level APIs of mininet.
This patch fixes to use utility methods of Mininet class.

Signed-off-by: IWASE Yusuke <[email protected]>
---
 ryu/tests/switch/run_mininet.py | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/ryu/tests/switch/run_mininet.py b/ryu/tests/switch/run_mininet.py
index 3a8c6ae..1f94d6e 100755
--- a/ryu/tests/switch/run_mininet.py
+++ b/ryu/tests/switch/run_mininet.py
@@ -4,11 +4,9 @@ import sys
 
 from mininet.cli import CLI
 from mininet.net import Mininet
-from mininet.link import Link
 from mininet.node import RemoteController
 from mininet.node import OVSSwitch
 from mininet.node import UserSwitch
-from mininet.term import makeTerm
 
 from oslo_config import cfg
 from ryu import version
@@ -37,14 +35,11 @@ if '__main__' == __name__:
     s1 = net.addSwitch('s1')
     s2 = net.addSwitch('s2')
 
-    Link(s1, s2)
-    Link(s1, s2)
-    Link(s1, s2)
+    net.addLink(s1, s2)
+    net.addLink(s1, s2)
+    net.addLink(s1, s2)
 
-    net.build()
-    c0.start()
-    s1.start([c0])
-    s2.start([c0])
+    net.start()
 
     if conf.switch == 'ovs':
         s1.cmd('ovs-vsctl set Bridge s1 protocols=%s' % conf.protocols)
-- 
1.9.1


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to