From 42e5e5b385861cdba809d0f59d01045a88e92c12 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 20 Apr 2021 06:48:41 -0600 Subject: [PATCH] endpoint id (eid) now supports greater than values. Signed-off-by: Chuck SmileyRekiere --- py-json/fio_endp_profile.py | 5 +++-- py-json/http_profile.py | 2 +- py-json/l4_cxprofile.py | 9 +++++---- py-scripts/lf_ftp_test.py | 15 ++++++++++----- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/py-json/fio_endp_profile.py b/py-json/fio_endp_profile.py index 9f5d3182..314296b0 100644 --- a/py-json/fio_endp_profile.py +++ b/py-json/fio_endp_profile.py @@ -121,7 +121,8 @@ class FIOEndpProfile(LFCliBase): cx_post_data = [] for port_name in ports: for num_connection in range(connections_per_port): - if len(self.local_realm.name_to_eid(port_name)) == 3: + # + if len(self.local_realm.name_to_eid(port_name)) >= 3: shelf = self.local_realm.name_to_eid(port_name)[0] resource = self.local_realm.name_to_eid(port_name)[1] name = self.local_realm.name_to_eid(port_name)[2] @@ -168,7 +169,7 @@ class FIOEndpProfile(LFCliBase): self.local_realm.json_post("/cli-json/nc_show_endpoints", {"endpoint": "all"}) for port_name in ports: for num_connection in range(connections_per_port): - if len(self.local_realm.name_to_eid(port_name)) == 3: + if len(self.local_realm.name_to_eid(port_name)) >= 3: shelf = self.local_realm.name_to_eid(port_name)[0] resource = self.local_realm.name_to_eid(port_name)[1] name = self.local_realm.name_to_eid(port_name)[2] diff --git a/py-json/http_profile.py b/py-json/http_profile.py index a9438f86..e0936f86 100644 --- a/py-json/http_profile.py +++ b/py-json/http_profile.py @@ -110,7 +110,7 @@ class HTTPProfile(LFCliBase): if (ip_addr is None) or (ip_addr == ""): raise ValueError("HTTPProfile::create encountered blank ip/hostname") - if len(self.local_realm.name_to_eid(port_name)) == 3: + if len(self.local_realm.name_to_eid(port_name)) >= 3: shelf = self.local_realm.name_to_eid(port_name)[0] resource = self.local_realm.name_to_eid(port_name)[1] name = self.local_realm.name_to_eid(port_name)[2] diff --git a/py-json/l4_cxprofile.py b/py-json/l4_cxprofile.py index a702d38e..a106588a 100644 --- a/py-json/l4_cxprofile.py +++ b/py-json/l4_cxprofile.py @@ -110,10 +110,11 @@ class L4CXProfile(LFCliBase): def create(self, ports=[], sleep_time=.5, debug_=False, suppress_related_commands_=None): cx_post_data = [] for port_name in ports: - if len(self.local_realm.name_to_eid(port_name)) == 3: - shelf = self.local_realm.name_to_eid(port_name)[0] - resource = self.local_realm.name_to_eid(port_name)[1] - name = self.local_realm.name_to_eid(port_name)[2] + print("port_name: {} len: {} self.local_realm.name_to_eid(port_name): {}".format(port_name,len(self.local_realm.name_to_eid(port_name)),self.local_realm.name_to_eid(port_name),)) + if len(self.local_realm.name_to_eid(port_name)) >= 3: + shelf = self.local_realm.name_to_eid(port_name)[0] + resource = self.local_realm.name_to_eid(port_name)[1] + name = self.local_realm.name_to_eid(port_name)[2] else: raise ValueError("Unexpected name for port_name %s" % port_name) endp_data = { diff --git a/py-scripts/lf_ftp_test.py b/py-scripts/lf_ftp_test.py index 3edb13b8..a64fe68b 100755 --- a/py-scripts/lf_ftp_test.py +++ b/py-scripts/lf_ftp_test.py @@ -9,8 +9,14 @@ PURPOSE: find out download/upload time of each client according to file size. This script will monitor the bytes-rd attribute of the endpoints. -USE: './ftp_test.py --ssid "jedway-wap2-x2048-5-3" --passwd "jedway-wpa2-x2048-5-3" --security wpa2 --bands "5G" --direction "Download" \ - --file_size "2MB" --num_stations +SETUP: + + Create a file to be downloaded linux: fallocate -l example fallocate -l 2M ftp_test.txt + + +EXAMPLE: + './ftp_test.py --ssid "jedway-wap2-x2048-5-3" --passwd "jedway-wpa2-x2048-5-3" --security wpa2 --bands "5G" --direction "Download" \ + --file_size "2MB" --num_stations 2 INCLUDE_IN_README @@ -19,7 +25,6 @@ INCLUDE_IN_README Copyright 2021 Candela Technologies Inc License: Free to distribute and modify. LANforge systems must be licensed. -SETUP: Create a file to be downloaded linux: fallocate -l example fallocate -l 2M ftp_test.txt """ import sys from ftp_html import * @@ -40,7 +45,7 @@ import time import os class ftp_test(LFCliBase): - def __init__(self, lfclient_host="localhost", lfclient_port=8080, sta_prefix="sta", start_id=0, num_sta= None, + def __init__(self, lfclient_host="localhost", lfclient_port=8080, radio = "wiphy0", sta_prefix="sta", start_id=0, num_sta= None, dut_ssid=None,dut_security=None, dut_passwd=None, file_size=None, band=None, upstream="eth1",_debug_on=False, _exit_on_error=False, _exit_on_fail=False, direction= None): super().__init__(lfclient_host, lfclient_port, _debug=_debug_on, _exit_on_fail=_exit_on_fail) @@ -447,7 +452,7 @@ def main(): parser.add_argument('--ssid',type=str, help='--ssid', default="TestAP-Jitendra") parser.add_argument('--passwd',type=str, help='--passwd', default="BLANK") parser.add_argument('--security', type=str, help='--security', default="open") - #parser.add_argument('--radios',nargs="+",help='--radio to use on LANforge for 5G and 2G', default=["wiphy0","wiphy1"]) + parser.add_argument('--radios',nargs="+",help='--radio to use on LANforge for 5G and 2G', default=["wiphy0"]) # Test variables parser.add_argument('--bands', nargs="+", help='--bands defaults ["5G","2.4G","Both"]', default=["5G","2.4G","Both"])