Search is not available for this dataset
repo
stringlengths
2
152
file
stringlengths
15
239
code
stringlengths
0
58.4M
file_length
int64
0
58.4M
avg_line_length
float64
0
1.81M
max_line_length
int64
0
12.7M
extension_type
stringclasses
364 values
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/miniedit.py
#!/usr/bin/python """ MiniEdit: a simple network editor for Mininet This is a simple demonstration of how one might build a GUI application using Mininet as the network model. Bob Lantz, April 2010 Gregory Gee, July 2013 Controller icon from http://semlabs.co.uk/ OpenFlow icon from https://www.opennetworking.org/ "...
154,479
42.090656
254
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/tree1024.py
#!/usr/bin/python """ Create a 1024-host network, and run the CLI on it. If this fails because of kernel limits, you may have to adjust them, e.g. by adding entries to /etc/sysctl.conf and running sysctl -p. Check util/sysctl_addon. """ from mininet.cli import CLI from mininet.log import setLogLevel from mininet.node...
522
26.526316
61
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/natnet.py
#!/usr/bin/python """ natnet.py: Example network with NATs h0 | s0 | ---------------- | | nat1 nat2 | | s1 s2 | | h1 h2 """ from mininet.topo import Topo from mininet.net ...
1,948
26.842857
77
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/linearbandwidth.py
#!/usr/bin/python """ Test bandwidth (using iperf) on linear networks of varying size, using both kernel and user datapaths. We construct a network of N hosts and N-1 switches, connected as follows: h1 <-> s1 <-> s2 .. sN-1 | | | h2 h3 hN WARNING: by default, the reference controller o...
3,988
30.409449
73
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/intfoptions.py
#!/usr/bin/python ''' example of using various TCIntf options. reconfigures a single interface using intf.config() to use different traffic control commands to test bandwidth, loss, and delay ''' from mininet.net import Mininet from mininet.log import setLogLevel, info from mininet.link import TCLink def intfOptions...
1,320
25.959184
65
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/sshd.py
#!/usr/bin/python """ Create a network and start sshd(8) on each host. While something like rshd(8) would be lighter and faster, (and perfectly adequate on an in-machine network) the advantage of running sshd is that scripts can work unchanged on mininet and hardware. In addition to providing ssh access to hosts, th...
3,040
34.360465
73
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/controlnet.py
#!/usr/bin/python """ controlnet.py: Mininet with a custom control network We create two Mininet() networks, a control network and a data network, running four DataControllers on the control network to control the data network. Since we're using UserSwitch on the data network, it should correctly fail over to a back...
4,967
30.245283
76
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/cluster.py
#!/usr/bin/python """ cluster.py: prototyping/experimentation for distributed Mininet, aka Mininet: Cluster Edition Author: Bob Lantz Core classes: RemoteNode: a Node() running on a remote server RemoteOVSSwitch(): an OVSSwitch() running on a remote server RemoteLink: a Link() on a remote se...
33,412
35.51694
79
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/popenpoll.py
#!/usr/bin/python "Monitor multiple hosts using popen()/pmonitor()" from mininet.net import Mininet from mininet.topo import SingleSwitchTopo from mininet.util import pmonitor from time import time from signal import SIGINT def pmonitorTest( N=3, seconds=10 ): "Run pings and monitor multiple hosts using pmonitor...
932
26.441176
57
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/consoles.py
#!/usr/bin/python """ consoles.py: bring up a bunch of miniature consoles on a virtual network This demo shows how to monitor a set of nodes by using Node's monitor() and Tkinter's createfilehandler(). We monitor nodes in a couple of ways: - First, each individual node is monitored, and its output is added to its...
15,612
32.432548
79
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/nat.py
#!/usr/bin/python """ Example to create a Mininet topology and connect it to the internet via NAT """ from mininet.cli import CLI from mininet.log import lg from mininet.topolib import TreeNet if __name__ == '__main__': lg.setLogLevel( 'info') net = TreeNet( depth=1, fanout=4 ) # Add NAT connectivity ...
550
24.045455
75
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/mobility.py
#!/usr/bin/python """ Simple example of Mobility with Mininet (aka enough rope to hang yourself.) We move a host from s1 to s2, s2 to s3, and then back to s1. Gotchas: The reference controller doesn't support mobility, so we need to manually flush the switch flow tables! Good luck! to-do: - think about wifi/hub ...
4,198
30.103704
71
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/multilink.py
#!/usr/bin/python """ This is a simple example that demonstrates multiple links between nodes. """ from mininet.cli import CLI from mininet.log import setLogLevel from mininet.net import Mininet from mininet.topo import Topo def runMultiLink(): "Create and run multiple link network" topo = simpleMultiLinkTop...
834
21.567568
59
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/scratchnetuser.py
#!/usr/bin/python """ Build a simple network from scratch, using mininet primitives. This is more complicated than using the higher-level classes, but it exposes the configuration details and allows customization. For most tasks, the higher-level API will be preferable. This version uses the user datapath and an exp...
2,455
32.189189
74
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/simpleperf.py
#!/usr/bin/python """ Simple example of setting network and CPU parameters NOTE: link params limit BW, add latency, and loss. There is a high chance that pings WILL fail and that iperf will hang indefinitely if the TCP handshake fails to complete. """ from mininet.topo import Topo from mininet.net import Mininet fro...
1,888
31.568966
71
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/vlanhost.py
#!/usr/bin/env python """ vlanhost.py: Host subclass that uses a VLAN tag for the default interface. Dependencies: This class depends on the "vlan" package $ sudo apt-get install vlan Usage (example uses VLAN ID=1000): From the command line: sudo mn --custom vlanhost.py --host vlan,vlan=1000 ...
3,679
28.44
75
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/treeping64.py
#!/usr/bin/python "Create a 64-node tree network, and test connectivity using ping." from mininet.log import setLogLevel from mininet.node import UserSwitch, OVSKernelSwitch # , KernelSwitch from mininet.topolib import TreeNet def treePing64(): "Run ping test on 64-node tree networks." results = {} swi...
950
27.818182
70
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/numberedports.py
#!/usr/bin/python """ Create a network with 5 hosts, numbered 1-4 and 9. Validate that the port numbers match to the interface name, and that the ovs ports match the mininet ports. """ from mininet.net import Mininet from mininet.node import Controller from mininet.log import setLogLevel, info, warn def validatePort...
2,330
28.1375
72
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/controllers2.py
#!/usr/bin/python """ This example creates a multi-controller network from semi-scratch by using the net.add*() API and manually starting the switches and controllers. This is the "mid-level" API, which is an alternative to the "high-level" Topo() API which supports parametrized topology classes. Note that one could...
1,612
25.016129
76
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/bind.py
#!/usr/bin/python """ bind.py: Bind mount example This creates hosts with private directories that the user specifies. These hosts may have persistent directories that will be available across multiple mininet session, or temporary directories that will only last for one mininet session. To specify a persistent direc...
2,310
32.985294
69
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/clustercli.py
#!/usr/bin/python "CLI for Mininet Cluster Edition prototype demo" from mininet.cli import CLI from mininet.log import output, error # pylint: disable=global-statement nx, graphviz_layout, plt = None, None, None # Will be imported on demand class ClusterCLI( CLI ): "CLI with additional commands for Cluster Ed...
3,875
37.376238
77
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/README.md
Mininet Examples ======================================================== These examples are intended to help you get started using Mininet's Python API. ======================================================== #### baresshd.py: This example uses Mininet's medium-level API to create an sshd process running in a nam...
4,965
26.588889
82
md
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/baresshd.py
#!/usr/bin/python "This example doesn't use OpenFlow, but attempts to run sshd in a namespace." import sys from mininet.node import Host from mininet.util import ensureRoot, waitListening ensureRoot() timeout = 5 print "*** Creating nodes" h1 = Host( 'h1' ) root = Host( 'root', inNamespace=False ) print "*** Crea...
1,074
23.431818
77
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/scratchnet.py
#!/usr/bin/python """ Build a simple network from scratch, using mininet primitives. This is more complicated than using the higher-level classes, but it exposes the configuration details and allows customization. For most tasks, the higher-level API will be preferable. """ from mininet.net import Mininet from minin...
2,032
28.463768
67
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/linuxrouter.py
#!/usr/bin/python """ linuxrouter.py: Example network with Linux IP router This example converts a Node into a router using IP forwarding already built into Linux. The example topology creates a router and three IP subnets: - 192.168.1.0/24 (r0-eth1, IP: 192.168.1.1) - 172.16.0.0/12 (r0-eth2, IP: 172.16.0.1...
2,826
30.411111
70
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/controllers.py
#!/usr/bin/python """ Create a network where different switches are connected to different controllers, by creating a custom Switch() subclass. """ from mininet.net import Mininet from mininet.node import OVSSwitch, Controller, RemoteController from mininet.topolib import TreeTopo from mininet.log import setLogLevel ...
1,061
27.702703
69
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/__init__.py
""" Mininet Examples See README for details """
48
8.8
22
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/limit.py
#!/usr/bin/python """ limit.py: example of using link and CPU limits """ from mininet.net import Mininet from mininet.link import TCIntf from mininet.node import CPULimitedHost from mininet.topolib import TreeTopo from mininet.util import custom, quietRun from mininet.log import setLogLevel, info def testLinkLimit(...
2,034
32.360656
75
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/popen.py
#!/usr/bin/python """ This example monitors a number of hosts using host.popen() and pmonitor() """ from mininet.net import Mininet from mininet.node import CPULimitedHost from mininet.topo import SingleSwitchTopo from mininet.log import setLogLevel from mininet.util import custom, pmonitor def monitorhosts( hosts=5...
1,023
26.675676
64
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/emptynet.py
#!/usr/bin/python """ This example shows how to create an empty Mininet object (without a topology object) and add nodes to it manually. """ from mininet.net import Mininet from mininet.node import Controller from mininet.cli import CLI from mininet.log import setLogLevel, info def emptyNet(): "Create an empty ...
960
20.355556
57
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/cpu.py
#!/usr/bin/python """ cpu.py: test iperf bandwidth for varying cpu limits """ from mininet.net import Mininet from mininet.node import CPULimitedHost from mininet.topolib import TreeTopo from mininet.util import custom, waitListening from mininet.log import setLogLevel, info def bwtest( cpuLimits, period_us=100000,...
2,119
27.648649
68
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/hwintf.py
#!/usr/bin/python """ This example shows how to add an interface (for example a real hardware interface) to a network after the network is created. """ import re import sys from mininet.cli import CLI from mininet.log import setLogLevel, info, error from mininet.net import Mininet from mininet.link import Intf from ...
1,549
27.703704
69
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/dockerhosts.py
#!/usr/bin/python """ This example shows how to create a simple network and how to create docker containers (based on existing images) to it. """ from mininet.net import Containernet from mininet.node import Controller, Docker, OVSSwitch from mininet.cli import CLI from mininet.log import setLogLevel, info from minin...
2,290
27.6375
104
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/multitest.py
#!/usr/bin/python """ This example shows how to create a network and run multiple tests. For a more complicated test example, see udpbwtest.py. """ from mininet.cli import CLI from mininet.log import lg, info from mininet.net import Mininet from mininet.node import OVSKernelSwitch from mininet.topolib import TreeTopo...
1,049
28.166667
78
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/clusterdemo.py
#!/usr/bin/python "clusterdemo.py: demo of Mininet Cluster Edition prototype" from mininet.examples.cluster import MininetCluster, SwitchBinPlacer from mininet.topolib import TreeTopo from mininet.log import setLogLevel from mininet.examples.clustercli import ClusterCLI as CLI def demo(): "Simple Demo of Cluster...
639
26.826087
68
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/multipoll.py
#!/usr/bin/python """ Simple example of sending output to multiple files and monitoring them """ from mininet.topo import SingleSwitchTopo from mininet.net import Mininet from mininet.log import setLogLevel from time import time from select import poll, POLLIN from subprocess import Popen, PIPE def monitorFiles( ou...
2,469
29.121951
68
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/multiping.py
#!/usr/bin/python """ multiping.py: monitor multiple sets of hosts using ping This demonstrates how one may send a simple shell script to multiple hosts and monitor their output interactively for a period= of time. """ from mininet.net import Mininet from mininet.node import Node from mininet.topo import SingleSwitc...
2,235
25.619048
67
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/clusterSanity.py
#!/usr/bin/env python ''' A sanity check for cluster edition ''' from mininet.examples.cluster import MininetCluster from mininet.log import setLogLevel from mininet.examples.clustercli import ClusterCLI as CLI from mininet.topo import SingleSwitchTopo def clusterSanity(): "Sanity check for cluster mode" top...
501
20.826087
57
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_popen.py
#!/usr/bin/env python """ Test for popen.py and popenpoll.py """ import unittest import pexpect class testPopen( unittest.TestCase ): def pingTest( self, name ): "Verify that there are no dropped packets for each host" p = pexpect.spawn( 'python -m %s' % name ) opts = [ "<(h\d+)>: PING "...
1,322
27.76087
71
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_sshd.py
#!/usr/bin/env python """ Test for sshd.py """ import unittest import pexpect from mininet.clean import sh class testSSHD( unittest.TestCase ): opts = [ '\(yes/no\)\?', 'refused', 'Welcome|\$|#', pexpect.EOF, pexpect.TIMEOUT ] def connected( self, ip ): "Log into ssh server, check banner, then exit...
1,853
29.393443
86
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_multipoll.py
#!/usr/bin/env python """ Test for multipoll.py """ import unittest import pexpect class testMultiPoll( unittest.TestCase ): def testMultiPoll( self ): "Verify that we receive one ping per second per host" p = pexpect.spawn( 'python -m mininet.examples.multipoll' ) opts = [ "\*\*\* (h\d)...
1,105
27.358974
67
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_multiping.py
#!/usr/bin/env python """ Test for multiping.py """ import unittest import pexpect from collections import defaultdict class testMultiPing( unittest.TestCase ): def testMultiPing( self ): """Verify that each target is pinged at least once, and that pings to 'real' targets are successful and u...
1,595
31.571429
86
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_hwintf.py
#!/usr/bin/env python """ Test for hwintf.py """ import unittest import re import pexpect from mininet.log import setLogLevel from mininet.node import Node from mininet.link import Link class testHwintf( unittest.TestCase ): prompt = 'mininet>' def setUp( self ): self.h3 = Node( 't0', ip='10.0.0...
1,870
27.348485
89
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_baresshd.py
#!/usr/bin/env python """ Tests for baresshd.py """ import unittest import pexpect from mininet.clean import cleanup, sh class testBareSSHD( unittest.TestCase ): opts = [ 'Welcome to h1', pexpect.EOF, pexpect.TIMEOUT ] def connected( self ): "Log into ssh server, check banner, then exit" p ...
2,072
30.892308
97
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_multilink.py
#!/usr/bin/env python ''' Test for multiple links between nodes validates mininet interfaces against systems interfaces ''' import unittest import pexpect class testMultiLink( unittest.TestCase ): prompt = 'mininet>' def testMultiLink(self): p = pexpect.spawn( 'python -m mininet.examples.multilink'...
1,571
27.071429
71
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_linearbandwidth.py
#!/usr/bin/env python """ Test for linearbandwidth.py """ import unittest import pexpect import sys class testLinearBandwidth( unittest.TestCase ): @unittest.skipIf( '-quick' in sys.argv, 'long test' ) def testLinearBandwidth( self ): "Verify that bandwidth is monotonically decreasing as # of hops i...
1,659
32.2
82
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_controlnet.py
#!/usr/bin/env python """ Test for controlnet.py """ import unittest import pexpect class testControlNet( unittest.TestCase ): prompt = 'mininet>' def testPingall( self ): "Simple pingall test that verifies 0% packet drop in data network" p = pexpect.spawn( 'python -m mininet.examples.contr...
1,454
29.3125
74
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_nat.py
#!/usr/bin/env python """ Test for nat.py """ import unittest import pexpect from mininet.util import quietRun destIP = '8.8.8.8' # Google DNS class testNAT( unittest.TestCase ): prompt = 'mininet>' @unittest.skipIf( '0 received' in quietRun( 'ping -c 1 %s' % destIP ), 'Destination I...
854
24.909091
74
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_tree1024.py
#!/usr/bin/env python """ Test for tree1024.py """ import unittest import pexpect import sys class testTree1024( unittest.TestCase ): prompt = 'mininet>' @unittest.skipIf( '-quick' in sys.argv, 'long test' ) def testTree1024( self ): "Run the example and do a simple ping test from h1 to h1024" ...
908
27.40625
73
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_vlanhost.py
#!/usr/bin/env python """ Test for vlanhost.py """ import unittest import pexpect import sys from mininet.util import quietRun class testVLANHost( unittest.TestCase ): prompt = 'mininet>' @unittest.skipIf( '-quick' in sys.argv, 'long test' ) def testVLANTopo( self ): "Test connectivity (or lack...
1,539
29.196078
83
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_emptynet.py
#!/usr/bin/env python """ Test for emptynet.py """ import unittest import pexpect class testEmptyNet( unittest.TestCase ): prompt = 'mininet>' def testEmptyNet( self ): "Run simple CLI tests: pingall (verify 0% drop) and iperf (sanity)" p = pexpect.spawn( 'python -m mininet.examples.emptyne...
835
24.333333
75
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_linuxrouter.py
#!/usr/bin/env python """ Test for linuxrouter.py """ import unittest import pexpect from mininet.util import quietRun class testLinuxRouter( unittest.TestCase ): prompt = 'mininet>' def testPingall( self ): "Test connectivity between hosts" p = pexpect.spawn( 'python -m mininet.examples.li...
1,534
27.962264
69
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/runner.py
#!/usr/bin/env python """ Run all mininet.examples tests -v : verbose output -quick : skip tests that take more than ~30 seconds """ import unittest import os import sys from mininet.util import ensureRoot from mininet.clean import cleanup class MininetTestResult( unittest.TextTestResult ): def addFailure( sel...
1,263
29.095238
82
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_multitest.py
#!/usr/bin/env python """ Test for multitest.py """ import unittest import pexpect class testMultiTest( unittest.TestCase ): prompt = 'mininet>' def testMultiTest( self ): "Verify pingall (0% dropped) and hX-eth0 interface for each host (ifconfig)" p = pexpect.spawn( 'python -m mininet.exam...
806
23.454545
84
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_controllers.py
#!/usr/bin/env python """ Tests for controllers.py and controllers2.py """ import unittest import pexpect class testControllers( unittest.TestCase ): prompt = 'mininet>' def connectedTest( self, name, cmap ): "Verify that switches are connected to the controller specified by cmap" p = pexpe...
1,463
28.877551
80
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_cpu.py
#!/usr/bin/env python """ Test for cpu.py results format: sched cpu client MB/s cfs 45.00% 13254.669841 cfs 40.00% 11822.441399 cfs 30.00% 5112.963009 cfs 20.00% 3449.090009 cfs 10.00% 2271.741564 """ import unittest import pexpect import sys class testCPU( unittest.TestCase ): ...
1,426
25.425926
84
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_treeping64.py
#!/usr/bin/env python """ Test for treeping64.py """ import unittest import pexpect import sys class testTreePing64( unittest.TestCase ): prompt = 'mininet>' @unittest.skipIf( '-quick' in sys.argv, 'long test' ) def testTreePing64( self ): "Run the example and verify ping results" p = p...
844
24.606061
70
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_bind.py
#!/usr/bin/env python """ Tests for bind.py """ import unittest import pexpect class testBind( unittest.TestCase ): prompt = 'mininet>' def setUp( self ): self.net = pexpect.spawn( 'python -m mininet.examples.bind' ) self.net.expect( "Private Directories: \[([\w\s,'/]+)\]" ) self.di...
2,270
32.895522
75
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_limit.py
#!/usr/bin/env python """ Test for limit.py """ import unittest import pexpect import sys class testLimit( unittest.TestCase ): @unittest.skipIf( '-quick' in sys.argv, 'long test' ) def testLimit( self ): "Verify that CPU limits are within a 2% tolerance of limit for each scheduler" p = pexp...
1,137
26.756098
86
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_simpleperf.py
#!/usr/bin/env python """ Test for simpleperf.py """ import unittest import pexpect import sys from mininet.log import setLogLevel from mininet.examples.simpleperf import SingleSwitchTopo class testSimplePerf( unittest.TestCase ): @unittest.skipIf( '-quick' in sys.argv, 'long test' ) def testE2E( self ): ...
976
26.914286
77
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_numberedports.py
#!/usr/bin/env python """ Test for numberedports.py """ import unittest import pexpect from collections import defaultdict from mininet.node import OVSSwitch class testNumberedports( unittest.TestCase ): @unittest.skipIf( OVSSwitch.setup() or OVSSwitch.isOldOVS(), "old version of OVS" ) def testConsistency(...
1,744
31.924528
107
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_scratchnet.py
#!/usr/bin/env python """ Test for scratchnet.py """ import unittest import pexpect class testScratchNet( unittest.TestCase ): opts = [ "1 packets transmitted, 1 received, 0% packet loss", pexpect.EOF ] def pingTest( self, name ): "Verify that no ping packets were dropped" p = pexpect.spawn...
647
22.142857
79
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_intfoptions.py
#!/usr/bin/env python """ Test for intfOptions.py """ import unittest import pexpect import sys class testIntfOptions( unittest.TestCase ): def testIntfOptions( self ): "verify that intf.config is correctly limiting traffic" p = pexpect.spawn( 'python -m mininet.examples.intfoptions ' ) ...
1,549
33.444444
83
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_clusterSanity.py
#!/usr/bin/env python ''' A simple sanity check test for cluster edition ''' import unittest import pexpect class clusterSanityCheck( unittest.TestCase ): prompt = 'mininet>' def testClusterPingAll( self ): p = pexpect.spawn( 'python -m mininet.examples.clusterSanity' ) p.expect( self.promp...
624
21.321429
71
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_mobility.py
#!/usr/bin/env python """ Test for mobility.py """ import unittest from subprocess import check_output class testMobility( unittest.TestCase ): def testMobility( self ): "Run the example and verify its 4 ping results" cmd = 'python -m mininet.examples.mobility 2>&1' grep = ' | grep -c " ...
472
21.52381
56
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/examples/test/test_natnet.py
#!/usr/bin/env python """ Test for natnet.py """ import unittest import pexpect from mininet.util import quietRun class testNATNet( unittest.TestCase ): prompt = 'mininet>' def setUp( self ): self.net = pexpect.spawn( 'python -m mininet.examples.natnet' ) self.net.expect( self.prompt ) ...
1,827
30.517241
76
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/test/test_nets.py
#!/usr/bin/env python """Package: mininet Test creation and all-pairs ping for each included mininet topo type.""" import unittest import sys from functools import partial from mininet.net import Mininet from mininet.node import Host, Controller from mininet.node import UserSwitch, OVSSwitch, IVSSwitch from minin...
3,743
33.348624
77
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/test/test_hifi.py
#!/usr/bin/env python """Package: mininet Test creation and pings for topologies with link and/or CPU options.""" import unittest import sys from functools import partial from mininet.net import Mininet from mininet.node import OVSSwitch, UserSwitch, IVSSwitch from mininet.node import CPULimitedHost from mininet....
11,315
41.066914
79
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/test/test_walkthrough.py
#!/usr/bin/env python """ Tests for the Mininet Walkthrough TODO: missing xterm test """ import unittest import pexpect import os import re from mininet.util import quietRun from distutils.version import StrictVersion def tsharkVersion(): "Return tshark version" versionStr = quietRun( 'tshark -v' ) vers...
12,869
34.849582
78
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/test/test_switchdpidassignment.py
#!/usr/bin/env python """Package: mininet Regression tests for switch dpid assignment.""" import unittest import sys from mininet.net import Mininet from mininet.node import Host, Controller from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch ) from mininet.topo import Topo from mininet.log import setLogL...
3,638
36.132653
78
py
cba-pipeline-public
cba-pipeline-public-master/containernet/mininet/test/test_containernet.py
import unittest import os import time import subprocess import docker from mininet.net import Containernet from mininet.node import Host, Controller, OVSSwitch, Docker from mininet.link import TCLink from mininet.topo import SingleSwitchTopo, LinearTopo from mininet.log import setLogLevel from mininet.util import quiet...
23,033
37.39
122
py
cba-pipeline-public
cba-pipeline-public-master/containernet/ansible/install.yml
- hosts: localhost tasks: - name: updates apt shell: apt-get -qq update - name: install basic packages apt: name={{item}} state=installed with_items: - aptitude - apt-transport-https - ca-certificates - curl - python-setuptools - python-dev - buil...
1,927
25.777778
127
yml
cba-pipeline-public
cba-pipeline-public-master/containernet/custom/topo-2sw-2host.py
"""Custom topology example Two directly connected switches plus a host for each switch: host --- switch --- switch --- host Adding the 'topos' dict with a key/value pair to generate our newly defined topology enables one to pass in '--topo=mytopo' from the command line. """ from mininet.topo import Topo class M...
894
24.571429
75
py
cba-pipeline-public
cba-pipeline-public-master/visualization/figure_configuration_ieee_standard.py
import matplotlib def figure_configuration_ieee_standard(): # IEEE Standard Figure Configuration - Version 1.0 # run this code before the plot command # # According to the standard of IEEE Transactions and Journals: # Times New Roman is the suggested font in labels. # For a singlepart figu...
2,053
32.672131
77
py
cba-pipeline-public
cba-pipeline-public-master/visualization/make_fairness_graph.py
import numpy as np import matplotlib.pyplot as plt import pickle import pandas as pd from figure_configuration_ieee_standard import figure_configuration_ieee_standard from scipy.interpolate import interp1d def main(): #sbu_client1 = np.load('sbu-100-doubles-tc-mem_client1.npy') #sbu_client2 = np.load('sbu-100...
11,808
35.560372
129
py