Hello everyone,
first working draft implementation is completed. Please, read this cover
letter, check the patches and let me know what you like, what you don't like,
etc. Please, note, that this is not final implementation.
NOTE - patches are not rebased to current HEAD, if you want to try it,
please, reset your branch to commit 2398f93.
What doesn't work
=================
multi_match - didn't have time and resources to check physical machines,
on virt setup it works, but ends with exception due to no res value returned
loopbacks - can't be created
netem support - not implemented yet
Description of new mechanics
============================
Since we need to run TaskAPI methods to get machine requirements from PyRecipe,
methods like provision_machines, prepare_network are run after the python recipe
is executed. Methods add_host and add_interface create machine requirements dict
in ControllerAPI object. When lnst.match() is called, it runs match algorithm
with mreq dict and if match is found, it prepares network and binds Machine
and Interface objects with their HostAPI and InterfaceAPI counterparts.
When everyting is prepared, execution returns to PyRecipe, where task phase
of PyRecipe is executed. Task phase is the same like before, only new method
is breakpoint() which will be useful for debugging, as it allows user to pause
the execution in whatever part of test.
TaskAPI is now used right from lnst module, all callable methods are exported
via __init__.py file from lnst/ dir.
Folder pyrecipes/ contains few working examples you can try.
TODO
====
* multimatch support
* config_only mode should be renamed and polished
* TaskAPI create_ovs() method
* support for loopbacks
* NetEm support
* polishing of the code
Jiri Prochazka (5):
__init__.py: draft for PyRecipes
lnst-ctl: draft for PyRecipes
NetTestController: draft for PyRecipes
Task: draft for PyRecipes
PyRecipes: add example PyRecipes
lnst-ctl | 16 +-
lnst/Controller/NetTestController.py | 396 ++++++++++-------------------------
lnst/Controller/Task.py | 240 +++++++++++----------
lnst/__init__.py | 1 +
pyrecipes/3_vlans.py | 34 +++
pyrecipes/example.py | 33 +++
pyrecipes/ping_flood.py | 48 +++++
7 files changed, 362 insertions(+), 406 deletions(-)
create mode 100644 pyrecipes/3_vlans.py
create mode 100644 pyrecipes/example.py
create mode 100644 pyrecipes/ping_flood.py
--
2.4.11