Skip to content

steps: modified and expanded the functionality of "noted-value" & "command output" steps

Matej Berezny requested to merge mb/dhcp_otherconf into main

This MR addresses two issues from our issue log:

  • issue#48 (Renaming "interface" to "device" in steps)
  • issue#39 (Creating alternative to 'wc -l' command from 'Execute' pipes)

Plus few other enhancements around expanding and improving commands.py steps.

I've added:

  • 4 variations (similar to "*" is visible with command...) that check if line count outputted from the command is same as expected number.
* "Exactly" "9" lines are visible with command "ip a" in "10" seconds
* "Different than" "4" lines with pattern "inet6" are visible with command "ip a" in "10" seconds
* "At least" "5" and "at most" "7" lines are visible with command "ip a" in "10" seconds
* "More than" "5" and "less than" "7" lines with pattern "inet6" are visible with command "ip a" in "10" seconds

List of keywords representing different comparison methods:

'at least' = operator.ge  # >=
'at most' = operator.le   # <=
'exactly' = operator.eq   # ==
'more than' = operator.gt # >
'less than' = operator.lt # <
'different than' = operator.ne # !=
  • 4 extra steps (similar to note the output of comand... step) that note the line count outputted from command.
* Note the number of lines of "ip a"
* Note the number of lines of "ip a" as value "noted"
* Note the number of lines with pattern "inet6" of "ip a"
* Note the number of lines with pattern "inet6" of "ip a" as value "noted"
  • exapnded the steps comparing noted values (including alternatives where implicit "noted-value" is used)
* Check noted value "i2" difference from "i1" is "$OPERATOR_KEYWORD" "$NUM"
* Check noted value "i2" is within "$MIN" to "$MAX" range
* Noted number of lines "saved_value" with pattern "ipv6" is visible with command "nmcli" in "5" seconds
* Noted value "saved_value" is visible with command "ip r" for full "50" seconds
  • steps for reproducers
* Execute reproducer "420"
* Execute reproducer "420" for "4" times
* Execute reproducer "420" with options "bond0"
* Execute reproducer "420" with options "bond0" for "4" times
* "success" is visible with reproducer "420" in "4" seconds
* "success" is visible with reproducer "420" with options "bond0" in "4" seconds
Edited by Filip Pokryvka

Merge request reports