commit 8e5a68f4074f6acf4d029cfc6f4188b3dcfa978e
parent 1e0553250b95540ee6983978241945b867c01e1b
Author: James Prestwood <prestwoj@gmail.com>
Date: Wed, 18 Aug 2021 14:50:26 -0700
hwsim: add Rule.remove_all()
There are really no cases where a test wants to remove a single
rule. Most loop through and remove rules individually so this
is being added as a convenience.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/autotests/util/hwsim.py b/autotests/util/hwsim.py
@@ -202,6 +202,10 @@ class RuleSet(collections.Mapping):
self._dict[path] = obj
return obj
+ def remove_all(self):
+ for rule in self._dict.values():
+ rule.remove()
+
class Radio(HwsimDBusAbstract):
_iface_name = HWSIM_RADIO_INTERFACE