Skip to content

Commit

Permalink
doc: update README[s] to reference the better sphinx based docs
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Hopps <chopps@labn.net>
  • Loading branch information
choppsv1 committed May 25, 2023
1 parent d443935 commit 0869d8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 70 deletions.
71 changes: 1 addition & 70 deletions README-mutest.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#+html: <a href="https://munet.readthedocs.io/en/latest/"><img src="https://readthedocs.org/projects/munet/badge?version=latest"></a>
#+html: <p></p>

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.

Expand Down

0 comments on commit 0869d8f

Please sign in to comment.