From 4f6e6574dbbe1bc78911c48f580950dae351ca8c Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Sat, 17 Dec 2022 23:27:11 +0000
Subject: [PATCH] Tool - load-gen:

- updated default config
- fixed issue with compatible dst endpoint selection
---
 src/tests/tools/load_gen/ServiceGenerator.py | 3 ++-
 src/tests/tools/load_gen/__main__.py         | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/tests/tools/load_gen/ServiceGenerator.py b/src/tests/tools/load_gen/ServiceGenerator.py
index 632225171..86a70d9c5 100644
--- a/src/tests/tools/load_gen/ServiceGenerator.py
+++ b/src/tests/tools/load_gen/ServiceGenerator.py
@@ -160,13 +160,14 @@ class ServiceGenerator:
         # identify compatible destination endpoint types
         src_endpoint_type = self._endpoint_ids_to_types.get((src_device_uuid,src_endpoint_uuid))
         dst_endpoint_type = ENDPOINT_COMPATIBILITY.get(src_endpoint_type)
+        dst_endpoint_types = {dst_endpoint_type} if service_type in {SERVICE_TYPE_TAPI} else None
 
         # identify expluded destination devices
         exclude_device_uuids = {} if service_type in {SERVICE_TYPE_TAPI} else {src_device_uuid}
 
         # choose feasible destination endpoint
         dst = self._use_device_endpoint(
-            service_uuid, endpoint_types={dst_endpoint_type}, exclude_device_uuids=exclude_device_uuids)
+            service_uuid, endpoint_types=dst_endpoint_types, exclude_device_uuids=exclude_device_uuids)
         
         # if destination endpoint not found, release source, and terminate current service generation
         if dst is None:
diff --git a/src/tests/tools/load_gen/__main__.py b/src/tests/tools/load_gen/__main__.py
index 28ffb2a9a..c1a995ebb 100644
--- a/src/tests/tools/load_gen/__main__.py
+++ b/src/tests/tools/load_gen/__main__.py
@@ -26,9 +26,9 @@ def main():
     parameters = Parameters(
         num_services  = 100,
         service_types = [
-            #SERVICE_TYPE_L2NM,
-            #SERVICE_TYPE_L3NM,
-            SERVICE_TYPE_TAPI,
+            SERVICE_TYPE_L2NM,
+            SERVICE_TYPE_L3NM,
+            #SERVICE_TYPE_TAPI,
         ],
         offered_load  = 50,
         holding_time  = 10,
-- 
GitLab