NFVBENCH-122 Allow config to have more dest MACs than chains requested 99/67099/1
authorahothan <ahothan@cisco.com>
Sun, 24 Feb 2019 19:53:00 +0000 (11:53 -0800)
committerahothan <ahothan@cisco.com>
Sun, 24 Feb 2019 19:53:00 +0000 (11:53 -0800)
Change-Id: I887cf14e76ae59abfec6fea5bd2181d8b3238d4c
Signed-off-by: ahothan <ahothan@cisco.com>
nfvbench/traffic_client.py

index 13ebfb7..58ae345 100755 (executable)
@@ -391,10 +391,11 @@ class GeneratorConfig(object):
         port_index: the port for which dest macs must be set
         dest_macs: a list of dest MACs indexed by chain id
         """
-        if len(dest_macs) != self.config.service_chain_count:
+        if len(dest_macs) < self.config.service_chain_count:
             raise TrafficClientException('Dest MAC list %s must have %d entries' %
                                          (dest_macs, self.config.service_chain_count))
-        self.devices[port_index].set_dest_macs(dest_macs)
+        # only pass the first scc dest MACs
+        self.devices[port_index].set_dest_macs(dest_macs[:self.config.service_chain_count])
         LOG.info('Port %d: dst MAC %s', port_index, [str(mac) for mac in dest_macs])
 
     def set_vtep_dest_macs(self, port_index, dest_macs):