From 8e5a68f4074f6acf4d029cfc6f4188b3dcfa978e Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 18 Aug 2021 14:50:26 -0700 Subject: [PATCH] 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. --- autotests/util/hwsim.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autotests/util/hwsim.py b/autotests/util/hwsim.py index 320e9dfa..4e3b8ec2 100755 --- 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