Commit Graph

1644 Commits

Author SHA1 Message Date
Rich Lane a1edb167b1 Merge pull request #1 from lantz/devel/fix-readline-history
Move cmdloop() wrapper into a new run() method
2015-03-02 14:20:11 -08:00
Bob Lantz 613fac4bab Move cmdloop() wrapper into a new run() method
I also added another try/catch block so that interrupting
the 'Interrupt' message should no longer occur.
2015-02-20 16:46:18 -08:00
Rich Lane e0cd11ab21 cli: don't read/write readline history more than once
Previously, when creating multiple CLI objects, each one would append the
~/.mininet_history file to readline's internal list. When writing the file back
it would be duplicated for each CLI object created. So, over a few mininet runs
the history file would grow exponentially.

This change moves the readline setup code out of the CLI constructor into a
class method and adds a flag to prevent it from being executed more than once.
2015-02-20 10:47:43 -08:00
Bob Lantz 17ba6a7c4d Add ip:port shorthand to Controller
Fixes #475
2015-02-04 11:16:42 -08:00
Bob Lantz f77a8b9e17 Fix customConstructor to work correctly with newargs 2015-02-04 10:56:32 -08:00
Bob Lantz 3dd8c2cda6 A controller should delete its interfaces if necessary
This was causing controlnet.py to not clean up its interfaces, since
those interfaces were linked from the controller to the switch
rather than vice-versa!!

deleteIntfs already will only delete interfaces whose names match
our name, which should usually prevent us from accidentally deleting
a hardware interface from the root namespace!
2015-02-04 10:30:26 -08:00
Bob Lantz 48a8ed857e 2.2.0+ -> 2.2.1d1 2015-02-04 05:27:51 -08:00
Bob Lantz 74c3511d5c pass code check 2015-02-04 05:27:14 -08:00
Bob Lantz 5ac113cfaa Batch link delete commands (and minor edits) 2015-02-04 05:21:15 -08:00
Bob Lantz cd02954c91 pass code check 2015-02-04 04:45:46 -08:00
Bob Lantz 93be1d0401 Fix OVS protocols option 2015-02-04 04:44:55 -08:00
Bob Lantz 6a38811f1a Clarify makeIntfPair behavior and pass code check 2015-02-04 04:44:14 -08:00
Bob Lantz 4ac45a3967 Fix super() arg in DataController 2015-02-04 04:43:23 -08:00
Bob Lantz d7e01bb821 Pass code check 2015-02-04 04:43:02 -08:00
Bob Lantz 340bf3cb7a Remove now-unused quietRun import 2015-02-04 04:29:08 -08:00
Bob Lantz 5f8547a5e0 Remove now-unused Link import 2015-02-04 04:28:57 -08:00
Bob Lantz 09e9c0550a Indent one line for consistency 2015-02-04 04:27:31 -08:00
Bob Lantz c1dc80571a Correctly group switches for batch operations 2015-02-04 04:26:58 -08:00
Bob Lantz ec9b23ba9c Delete tap9 for CE
In the future, we should probably not hardwire this,
or should at least make it a constant!!
2015-02-04 04:15:19 -08:00
Bob Lantz 7c0b56f9ba Delete both tunnel interfaces
We also clean things up a bit and check for error messages,
which now can cause exceptions which should invoke cleanup.
2015-02-04 04:14:40 -08:00
Bob Lantz d90a45514f node shell: remove unnecessary -m and unset HISTFILE
Since we already disable job notification with +m, it doesn't
make sense to set it in the original invocation!

It's also annoying if all of the host commands end up overwriting
your regular bash_history!!
2015-02-03 22:02:29 -08:00
Bob Lantz b2fe0778dc Change iperf() to use waitListening() 2015-02-03 21:44:21 -08:00
lantz 3e4f254573 Merge pull request #474 from mininet/devel/ovsbatch
Batch startup support for OVS

Currently, every ovs-vsctl command requires reading the entire OVS
configuration database. This means that its performance gets linearly
slower as more switches and ports are added. To mitigate this, we
batch multiple configuration operations into individual, long,
ovs-vsctl commands.

This patch set makes a couple of other notable changes, including
setting printPid=False by default (avoids using mnexec unnecessarily)
and running certain commands using errRun rather than quietRun.
Additionally we no longer look for leftover links in the root
namespace, so code relying on that functionality may have to change
slightly (as in controlnet.py and sshd.py for example.) It also adds
cluster support to mn -c.

The performance result is that mn --topo linear,200 --test none now
completes in 60 seconds rather than 95 seconds (on my laptop) without
the patch (vs. 101 seconds in 2.2.0).

This is still slower than I would like - we should be able to make
some additional improvements.
2015-02-03 19:24:03 -08:00
Bob Lantz 2e4dd13482 Turn off printPid by default to avoid mnexec fork/exec 2015-02-03 17:40:20 -08:00
Bob Lantz 19331ca287 use net.addLink() so that link is cleaned up 2015-02-03 16:02:07 -08:00
Bob Lantz 9483f6378f Make sure DataController's interfaces are deleted 2015-02-03 15:30:16 -08:00
Bob Lantz a4e933688a Set batch=False in OVSSwitch for low-level API
If you try to use the low-level API, you are probably
not going to call batchStartup()! So, we set batch=False
by default. This means that buildFromTopo() needs to set
it to True, so we add a bit of irritatingly complex machinery
to allow this to happen. The good fallout of this is that
now customConstructor() returns a real subclass, not simply
a constructor function! We also detect errors where people
are incorrectly attempting to give parameters to a lambda
function - since none of our lambdas accept parameters!!

Note that this is a bit like functools.partial for classes -
it would be nice if functools had a true subclassing function.
2015-01-29 00:26:15 -08:00
Bob Lantz c11e9f3316 Fix OVS user switch (remove unnecessary % parameter) 2015-01-28 17:04:58 -08:00
Bob Lantz acdcf9b6ae cluster: add batchStartup/Shutdown, cleanup 2015-01-27 15:27:26 -08:00
Bob Lantz c702840a0a Remove debug print lines 2015-01-27 15:24:29 -08:00
Bob Lantz 254fae2dc9 Clarify which intf pair failed and raise exception 2015-01-27 15:23:48 -08:00
Bob Lantz bdad3e8c8e Merge OVSBatch into OVSSwitch
Note that we are changing the interface of batchStartup/Shutdown
slightly so that the method can choose not to start some of the
switches. We might wish to refine this a bit...
2015-01-26 18:01:20 -08:00
Bob Lantz 574d634fc2 Don't clean up links that may have been dumped into root NS.
This should rarely happen - in the usual case, either the
links will be shut down by Mininet.stop(), or the interfaces
will be deleted by node.stop( deleteIntfs=True ), or the
links or interfaces will be explicitly deleted or stopped
using the low-level API.

Cases that are relying on links being automatically deleted
in cleanup() will potentially find that they are now no longer
deleted, but these cases should be rare.
2015-01-26 14:06:23 -08:00
Bob Lantz eafbd2a597 Change to OVSSwitch 2015-01-26 14:06:23 -08:00
Bob Lantz 7485b035af make 'ovs-vsctl' string symmetric 2015-01-26 14:06:23 -08:00
Bob Lantz 8014a7023c Fix super() typo 2015-01-26 14:06:23 -08:00
Bob Lantz bec34e7227 Clean up - TCReapply still broken! 2015-01-26 14:06:23 -08:00
Bob Lantz 9ca6322603 Remove shared reconnectms, improve self.started
We still need to set it in batchShutdown()
2015-01-26 14:06:23 -08:00
Bob Lantz 957fe1db93 Refactor for compatibility with isOldOVS() == True 2015-01-26 14:06:23 -08:00
Bob Lantz 3b4738c2ca First crack at setting controller backoff in single command 2015-01-26 14:06:23 -08:00
Bob Lantz 30ebb852a3 errRun: add debug( results ) 2015-01-26 14:06:22 -08:00
Bob Lantz 959586bc8f Add debug(cmd) to errRun() 2015-01-26 14:06:22 -08:00
Bob Lantz 9bda98486d Add OVSBatch class (experimental)
This implements batch startup for OVS switches.
2015-01-26 14:06:22 -08:00
Bob Lantz c68e4e76f4 Clarify bandwidth limit for TCIntfs
In the future, we would like to support higher bandwidth
limits for TCIntfs, but we'll probably need to adjust some
of the parameters dynamically.
2015-01-26 13:55:38 -08:00
Bob Lantz 98a8231cef Exit poll loop on POLLHUP or anything unexpected
In my opinion, we really shouldn't even get POLLHUP, but
we do. In case we get anything else odd, quite polling on
that fd.
2015-01-23 16:43:49 -08:00
Bob Lantz 28ce13d18e Fix polling in errRun
It's tricky to get this right, but basically we want to read
if there is something to read; if not, we want to check for
EOF.
2015-01-23 16:41:29 -08:00
Bob Lantz ef59cd88dc Return correct success condition in cgroupDel
Without this, we end up retrying until we fail, instead
of returning immediately on success!
2015-01-23 16:39:50 -08:00
Bob Lantz 9db6cdc261 Call delete() in link.stop() ; warn on exited node.cmd()
We should think a bit about the semantics that we want here.
The comments say "stop and clean up link" so perhaps that's
what we want. However, we could also imagine stop stopping
forwarding on the link (and possibly allowing restarts).

We warn on exited node.cmd() because we terminate the controller
before stopping/deleting the links. This makes sense to avoid a
storm of link/port down events, but since the controller's
shell has exited we cannot call link.stop() on any of its
links. We may want to simply stop the controller and not
terminate it, but at least it doesn't hang for now.
2015-01-22 03:22:43 -08:00
Bob Lantz f7b29333f5 2.2.0 -> 2.2.0+ 2015-01-18 23:35:54 -08:00
Bob Lantz 24520fc982 Allow + in version number 2015-01-18 23:35:29 -08:00