From: Vratko Polak Date: Wed, 20 Apr 2022 12:27:18 +0000 (+0200) Subject: fix(tgtest): filter by TG NIC model X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=commitdiff_plain;h=76def9e0a3404b38c9e7fbd58260700207b17639 fix(tgtest): filter by TG NIC model The previous path computation code was only correct for tests with DUT (and TG). There, we only want to filter by DUT NICs, but not TG NICs (e.g. to allow testing E810 DUT with MLX TG). But for tests without DUT (still with TG), we do indeed want to filter by NICs on TG, so this patch does that. Change-Id: Ia482c6327af7bca26353ad6e503ae224d90cb3a4 Signed-off-by: Vratko Polak --- diff --git a/resources/libraries/python/NodePath.py b/resources/libraries/python/NodePath.py index b9b4fc94e6..dd68506914 100644 --- a/resources/libraries/python/NodePath.py +++ b/resources/libraries/python/NodePath.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2022 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -251,12 +251,18 @@ class NodePath: for _ in range(0, nic_pfs // 2): if topo_has_tg: - self.append_node(nodes[u"TG"]) + if topo_has_dut: + self.append_node(nodes[u"TG"]) + else: + self.append_node(nodes[u"TG"], filter_list=filter_list) if topo_has_dut: for dut in duts: self.append_node(nodes[dut], filter_list=filter_list) if topo_has_tg: - self.append_node(nodes[u"TG"]) + if topo_has_dut: + self.append_node(nodes[u"TG"]) + else: + self.append_node(nodes[u"TG"], filter_list=filter_list) self.compute_path(always_same_link, topo_has_dut) n_idx = 0 # node index