summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/client_utils
diff options
context:
space:
mode:
authorDan Klein <danklei@cisco.com>2015-10-28 07:28:37 +0200
committerDan Klein <danklei@cisco.com>2015-10-28 07:28:37 +0200
commit0c2b3c83f9cc0c25277c39660dce132aad55c3d7 (patch)
treeeaf8dc249b49aae9ca70d4ff927a7be9a889380f /scripts/automation/trex_control_plane/client_utils
parentfe6e03366eae72376f1201ed68744cb1206773de (diff)
updated more HLTAPI functionality and fixed found bugs.
Working: Start/stop traffic, traffic config (semi), connect, clean Missing: stats Next: boost console
Diffstat (limited to 'scripts/automation/trex_control_plane/client_utils')
-rwxr-xr-xscripts/automation/trex_control_plane/client_utils/general_utils.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/client_utils/general_utils.py b/scripts/automation/trex_control_plane/client_utils/general_utils.py
index 5488b9dd..3c025608 100755
--- a/scripts/automation/trex_control_plane/client_utils/general_utils.py
+++ b/scripts/automation/trex_control_plane/client_utils/general_utils.py
@@ -75,6 +75,22 @@ def random_id_gen(length=8):
return_id += random.choice(id_chars)
yield return_id
+def id_count_gen():
+ """
+ A generator for creating an increasing id for objects, starting from 0
+
+ :parameters:
+ None
+
+ :return:
+ an id (unsigned int) with each next() request.
+ """
+ return_id = 0
+ while True:
+ yield return_id
+ return_id += 1
+
+
if __name__ == "__main__":
pass