Skip to content

cleanup: removed the need to have so many connection cleanup tags

Matej Berezny requested to merge mb/auto_conn_delete into master

Modified the step:

* Add a new connection of type "ethernet" and options "ifname eth3"

by allowing to additionally specify con-name and ifname separately, allowing their automatic deletion in after_scenario without need of extra con_{ipv4,ipv6,general...}_remove tags. Example of such step in:

* Add a new connection of type "ethernet" named "con_ipv4" and options "some options"

resulting in deletion of connection profile con_ipv4. And:

* Add a new connection of type "ethernet" named "con_ipv4" for device "eth420" and options "some options"

resulting in deletion of connection profile con_ipv4 and device eth420.

UPDATE 1.1 - I've added a few extra 'Add' steps:

* Add a new interace of type "veth" named "eth42"
* Add a new interace of type "veth" named "eth42" and options "some options"
* Add a new network namespace named "eth42_ns"
* Add a new network namespace named "eth42_ns" and options "some options"
* Add a new interface of type "veth" named "eth42" in namespace "eth42_ns"
* Add a new interface of type "veth" named "eth42" in namespace "eth42_ns" and options "some options"

which also add these interfaces/namespaces to cleanup process.

UPDATE 1.2

  • If you specify eth[0-99] device (not in options) in "* Add a connection..." step, its HW addr gets automatically reset instead of deleting the interface.
  • Removed the need to explicitly use @teardown_testveth tag, since its integrated in *Prepare simulated test... step and cleanup after scenario
  • Expanded the cleanup to nmtui tests as well, where ifaces will be added to cleanup in * Set "Device" field to... step and connections in * Set "Profile name" field to....

UPDATE 1.3 - Additional 2 Cleanup steps

* Cleanup interface "name"
* Cleanup connection "name"

Which add the specified iface/conn to the cleanup list after scenario (especially useful with leftover connection after reproducers and * Execute "nmcli con add..." commands).

Edited by Matej Berezny

Merge request reports