mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +01:00
auto-t: remove hwsim rules on __del__
This prevents previous tests rules from carrying over into future tests.
This commit is contained in:
parent
5df28473cb
commit
5b94c9d243
@ -240,6 +240,9 @@ class RadioList(collections.Mapping):
|
|||||||
def __delitem__(self, key):
|
def __delitem__(self, key):
|
||||||
self._dict.pop(key).remove()
|
self._dict.pop(key).remove()
|
||||||
|
|
||||||
|
def values(self):
|
||||||
|
return self._dict.values()
|
||||||
|
|
||||||
def _interfaces_added_handler(self, path, interfaces):
|
def _interfaces_added_handler(self, path, interfaces):
|
||||||
self._dict[path] = Radio(interfaces[HWSIM_RADIO_INTERFACE])
|
self._dict[path] = Radio(interfaces[HWSIM_RADIO_INTERFACE])
|
||||||
|
|
||||||
@ -271,6 +274,10 @@ class Hwsim(iwd.AsyncOpAbstract):
|
|||||||
self._rules = RuleSet(self, objects)
|
self._rules = RuleSet(self, objects)
|
||||||
self._radios = RadioList(self, objects)
|
self._radios = RadioList(self, objects)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
for rule in self._rules.values():
|
||||||
|
rule.remove()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def rules(self):
|
def rules(self):
|
||||||
return self._rules
|
return self._rules
|
||||||
|
Loading…
Reference in New Issue
Block a user