diff --git a/README-mutest.org b/README-mutest.org index b264062..884db53 100644 --- a/README-mutest.org +++ b/README-mutest.org @@ -7,73 +7,4 @@ repeatedly) to a target and a matching regular expression for the command output to determine if the step passes. Variations of this common step exist for added functionality (e.g., negative match). -** tl;dr - -The most common step is specified with a call to ~match_step~ - -Here is a simple example test case: - -#+begin_src python - match_step("r1", 'vtysh -c "show ip fib 10.0.1.1"', "Routing entry for 10.0.1.0/24") - match_step("r1", 'vtysh -c "show ip fib 10.0.2.1"', "Routing entry for 10.0.2.0/24") -#+end_src - -Each ~match_step~ above can be specified succinctly because it is taking -advantage of default values. Here is the example ~match_step~ which specifies -all the parameters giving their default values. - -#+begin_src python - match_step("r1", 'vtysh -c "show ip fib 10.0.1.1"', "Routing entry for 10.0.1.0/24", "wait", "", 10, False, 2) - match_step("r1", 'vtysh -c "show ip fib 10.0.2.1"', "Routing entry for 10.0.2.0/24", "wait", "", 10, False, 2) -#+end_src - -One can also pass the parameters using their names. This allows one to specify -only the non-default values. Below the ~repeatFor~ value is modified, leaving -other values to their default. - -#+begin_src python - match_step( - target="r1", - command='vtysh -c "show ip fib 10.0.2.1"', - match="Routing entry for 10.0.2.0/24", - repeatFor=10) -#+end_src - -** match_step variants - -To allow for more clear and perhaps succinct test case definitions, step -variants exist mostly based on the "op" value. Step variants can have reduced -parameters and can have slightly different default values that suit that -particular variant (see each variants documentation for the specifics). - -The common variants are: - - - step :: Runs a command once on the target returning the output. - - match_step :: Passes if the command output matches (when defaults are used) - - wait_step :: Passes if the command output matches (when defaults are used) - - - step_json :: Runs a command once on the target returning the output. - - match_step_json :: Passes if the command output matches (when defaults are used) - - wait_step_json :: Passes if the command output matches (when defaults are used) - - -** Sections - -Steps can be groups in a test case by sections. The primary reason to do this -is for documentation. - -Below is an example of using sections. - -#+begin_src python - section("Routes") - match_step("r1", "show ip route 10.0.1.1", "10.0.1.0/24") - match_step("r1", "show ip route 10.0.1.129", "10.0.1.128/25") - - section("Policy") - match_step("r1", "show bgp route-map foo-map", "some-policy-regex") - match_step("r1", "show bgp route-map bar-map", "some-other-policy-regex") - -#+end_src - - -** Reference +For documentation see: https://munet.readthedocs.io/en/latest/mutest.html diff --git a/README.org b/README.org index 76cca81..c47ab7d 100644 --- a/README.org +++ b/README.org @@ -5,6 +5,8 @@ #+html: #+html:

+For better documentation see: https://munet.readthedocs.io/en/latest/ + A package for creating network topologies and running programs and containers within them using linux namepsaces, podman containers and qemu virtual machines.