summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/unit_tests/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/unit_tests/test.py')
-rwxr-xr-xscripts/automation/trex_control_plane/unit_tests/test.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/unit_tests/test.py b/scripts/automation/trex_control_plane/unit_tests/test.py
new file mode 100755
index 00000000..dac765d6
--- /dev/null
+++ b/scripts/automation/trex_control_plane/unit_tests/test.py
@@ -0,0 +1,36 @@
+from mininet.topo import Topo
+from mininet.link import TCLink
+from mininet.net import Mininet
+from mininet.node import CPULimitedHost
+from mininet.link import TCLink
+from mininet.util import dumpNodeConnections
+from mininet.log import setLogLevel
+
+class MyTopo( Topo ):
+ "Simple topology example."
+
+ def __init__( self ):
+ "Create custom topo."
+
+ # Initialize topology
+ Topo.__init__( self )
+
+ # Add hosts and switches
+ leftHost = self.addHost( 'h1' )
+ rightHost = self.addHost( 'h2' )
+ Switch = self.addSwitch( 's1' )
+
+ # Add links
+ self.addLink( leftHost, Switch ,bw=10, delay='5ms')
+ self.addLink( Switch, rightHost )
+
+
+topos = { 'mytopo': ( lambda: MyTopo() ) }
+
+# 1. http server example
+#
+#mininet> h1 python -m SimpleHTTPServer 80 &
+#mininet> h2 wget -O - h1
+# 2. limit mss example
+#decrease the MTU ifconfig eth0 mtu 488
+