This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Pau Espin Pedrol gerrit-no-reply at lists.osmocom.orgPau Espin Pedrol has submitted this change and it was merged. Change subject: resource: Fix list comparison in item_matches ...................................................................... resource: Fix list comparison in item_matches In following commits, cipher attribute containing a list of supported ciphers is introdued in osmo-gsm-tester. While developing the feature, it was found that resources containing lists are not being handled correctly. Previous implementation regarding lists in several ways: - In the list coe path, both item and wanted_item are expected to be lists. Python doesn't support to check for sublists using the "in" operand. - want_item basically contains the scenario dic, and item is each of the items available as resource of a given type. Thus, we want to check that item supports the subset of features requested by the scenario, ie. that the list in the scenario is a subset of the ones in the3 item and not the opposite. The following failing scenario is going to be checked during "make check" when the cipher attribute is added: BTS supporting cipher a50 and a51, and scenario requesting a50 succeeds. If this commit is remove, the test no longer passes, and it fails with: osmo_gsm_tester.resource.NoResourceExn: No matching resource available for bts = {'type': 'osmo-bts-sysmo', 'ciphers': ['a5 1']} Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d --- M src/osmo_gsm_tester/resource.py 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index c55140a..da543f7 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -441,9 +441,12 @@ return True if is_list(wanted_item): - # multiple possible values - if item not in wanted_item: + if not is_list(item): return False + # multiple possible values + for val in wanted_item: + if val not in item: + return False return True return item == wanted_item -- To view, visit https://gerrit.osmocom.org/3721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de> Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>