mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
lf_ftp_test.py: indication of ending upload/download test - not just time
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
@@ -68,7 +68,7 @@ class ftp_test(LFCliBase):
|
|||||||
elif self.file_size == "1000MB":
|
elif self.file_size == "1000MB":
|
||||||
self.duration = self.convert_min_in_time(1) # 50
|
self.duration = self.convert_min_in_time(1) # 50
|
||||||
else:
|
else:
|
||||||
self.duration = self.convert_min_in_time(1) # 10
|
self.duration = self.convert_min_in_time(10) # 10
|
||||||
elif self.band == "2.4G":
|
elif self.band == "2.4G":
|
||||||
self.radio = ["wiphy0"] # need to pass in the radios
|
self.radio = ["wiphy0"] # need to pass in the radios
|
||||||
if self.file_size == "2MB":
|
if self.file_size == "2MB":
|
||||||
@@ -78,7 +78,7 @@ class ftp_test(LFCliBase):
|
|||||||
elif self.file_size == "1000MB":
|
elif self.file_size == "1000MB":
|
||||||
self.duration = self.convert_min_in_time(1) # 80
|
self.duration = self.convert_min_in_time(1) # 80
|
||||||
else:
|
else:
|
||||||
self.duration = self.convert_min_in_time(1) # 10
|
self.duration = self.convert_min_in_time(10) # 10
|
||||||
elif self.band == "Both":
|
elif self.band == "Both":
|
||||||
self.radio = ["wiphy2", "wiphy0"] # need to pass in the radios
|
self.radio = ["wiphy2", "wiphy0"] # need to pass in the radios
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ class ftp_test(LFCliBase):
|
|||||||
elif self.file_size == "1000MB":
|
elif self.file_size == "1000MB":
|
||||||
self.duration = self.convert_min_in_time(1) # 80
|
self.duration = self.convert_min_in_time(1) # 80
|
||||||
else:
|
else:
|
||||||
self.duration = self.convert_min_in_time(1) # 10
|
self.duration = self.convert_min_in_time(10) # 10
|
||||||
|
|
||||||
self.file_size_bytes=int(self.convert_file_size_in_Bytes(self.file_size))
|
self.file_size_bytes=int(self.convert_file_size_in_Bytes(self.file_size))
|
||||||
|
|
||||||
@@ -216,11 +216,12 @@ class ftp_test(LFCliBase):
|
|||||||
|
|
||||||
#create layer for connection for upload
|
#create layer for connection for upload
|
||||||
for client_num in range(len(self.station_list)):
|
for client_num in range(len(self.station_list)):
|
||||||
self.cx_profile.create(ports=eth_list, ftp_ip=ip[client_num] + "/ftp_test.txt", sleep_time=.5,
|
self.cx_profile.create(ports=eth_list, ftp_ip=ip[client_num] + "/ftp_test_upload.txt", sleep_time=.5,
|
||||||
debug_=self.debug, suppress_related_commands_=True, ftp=True,
|
debug_=self.debug, suppress_related_commands_=True, ftp=True,
|
||||||
user="lanforge", passwd="lanforge",
|
user="lanforge", passwd="lanforge",
|
||||||
source="", upload_name=client_list[client_num])
|
source="", upload_name=client_list[client_num])
|
||||||
|
|
||||||
|
|
||||||
#check Both band present then build stations with another station list
|
#check Both band present then build stations with another station list
|
||||||
if self.count == 2:
|
if self.count == 2:
|
||||||
self.station_list = self.station_list1
|
self.station_list = self.station_list1
|
||||||
@@ -298,6 +299,10 @@ class ftp_test(LFCliBase):
|
|||||||
|
|
||||||
for i in range(self.num_sta):
|
for i in range(self.num_sta):
|
||||||
list_of_time.append(0)
|
list_of_time.append(0)
|
||||||
|
|
||||||
|
print("list_of_time: {}".format(list_of_time))
|
||||||
|
|
||||||
|
num_sta_finished = 0
|
||||||
while list_of_time.count(0) != 0:
|
while list_of_time.count(0) != 0:
|
||||||
|
|
||||||
#run script upto given time
|
#run script upto given time
|
||||||
@@ -308,6 +313,7 @@ class ftp_test(LFCliBase):
|
|||||||
data = self.json_get("layer4/list?fields=bytes-rd")
|
data = self.json_get("layer4/list?fields=bytes-rd")
|
||||||
#print("data from bytes-rd: {}".format(data))
|
#print("data from bytes-rd: {}".format(data))
|
||||||
|
|
||||||
|
|
||||||
if self.num_sta == 1:
|
if self.num_sta == 1:
|
||||||
#reading uc-avg data in json format
|
#reading uc-avg data in json format
|
||||||
uc_avg= self.json_get("layer4/list?fields=uc-avg")
|
uc_avg= self.json_get("layer4/list?fields=uc-avg")
|
||||||
@@ -316,9 +322,11 @@ class ftp_test(LFCliBase):
|
|||||||
data = self.json_get("layer4/list?fields=bytes-rd")
|
data = self.json_get("layer4/list?fields=bytes-rd")
|
||||||
if data['endpoint']['bytes-rd'] >= self.file_size_bytes:
|
if data['endpoint']['bytes-rd'] >= self.file_size_bytes:
|
||||||
list1.append(i)
|
list1.append(i)
|
||||||
|
print("list1: {} list2: {}".format(list1,list2))
|
||||||
if list1.count(i) == 1:
|
if list1.count(i) == 1:
|
||||||
list2.append(i)
|
list2.append(i)
|
||||||
list1 = list2
|
list1 = list2
|
||||||
|
print("CX_{} list1: {} list2: {}".format(data2[0],list1,list2))
|
||||||
|
|
||||||
#stop station after download or upload file with particular size
|
#stop station after download or upload file with particular size
|
||||||
self.json_post("/cli-json/set_cx_state", {
|
self.json_post("/cli-json/set_cx_state", {
|
||||||
@@ -326,8 +334,10 @@ class ftp_test(LFCliBase):
|
|||||||
"cx_name": "CX_" + data2[0],
|
"cx_name": "CX_" + data2[0],
|
||||||
"cx_state": "STOPPED"
|
"cx_state": "STOPPED"
|
||||||
}, debug_=self.debug)
|
}, debug_=self.debug)
|
||||||
|
|
||||||
list_of_time[i] = round(int(uc_avg['endpoint']['uc-avg'])/1000,1)
|
list_of_time[i] = round(int(uc_avg['endpoint']['uc-avg'])/1000,1)
|
||||||
|
num_sta_finished += 1
|
||||||
|
if num_sta_finished >= self.num_sta:
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
#reading uc-avg data in json format
|
#reading uc-avg data in json format
|
||||||
uc_avg= self.json_get("layer4/list?fields=uc-avg")
|
uc_avg= self.json_get("layer4/list?fields=uc-avg")
|
||||||
@@ -335,9 +345,12 @@ class ftp_test(LFCliBase):
|
|||||||
data = self.json_get("layer4/list?fields=bytes-rd")
|
data = self.json_get("layer4/list?fields=bytes-rd")
|
||||||
if data['endpoint'][i][data2[i]]['bytes-rd'] >= self.file_size_bytes:
|
if data['endpoint'][i][data2[i]]['bytes-rd'] >= self.file_size_bytes:
|
||||||
list1.append(i)
|
list1.append(i)
|
||||||
|
print("list1: {} list2: {}".format(list1,list2))
|
||||||
|
|
||||||
if list1.count(i) == 1:
|
if list1.count(i) == 1:
|
||||||
list2.append(i)
|
list2.append(i)
|
||||||
list1 = list2
|
list1 = list2
|
||||||
|
print("CX_{} list1: {} list2: {}".format(data2[i],list1,list2))
|
||||||
|
|
||||||
#stop station after download or upload file with particular size
|
#stop station after download or upload file with particular size
|
||||||
self.json_post("/cli-json/set_cx_state", {
|
self.json_post("/cli-json/set_cx_state", {
|
||||||
@@ -348,6 +361,8 @@ class ftp_test(LFCliBase):
|
|||||||
|
|
||||||
list_of_time[i] = round(int(uc_avg['endpoint'][i][data2[i]]['uc-avg'])/1000,1)
|
list_of_time[i] = round(int(uc_avg['endpoint'][i][data2[i]]['uc-avg'])/1000,1)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
# print(".", end='')
|
||||||
|
|
||||||
|
|
||||||
#return list of download/upload time in seconds
|
#return list of download/upload time in seconds
|
||||||
return list_of_time
|
return list_of_time
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class IPV4L4(LFCliBase):
|
|||||||
self.cx_profile = self.local_realm.new_l4_cx_profile()
|
self.cx_profile = self.local_realm.new_l4_cx_profile()
|
||||||
|
|
||||||
self.station_profile.lfclient_url = self.lfclient_url
|
self.station_profile.lfclient_url = self.lfclient_url
|
||||||
|
print("##### station_profile.lfclient_url: {}".format(self.station_profile.lfclient_url))
|
||||||
self.station_profile.ssid = self.ssid
|
self.station_profile.ssid = self.ssid
|
||||||
self.station_profile.ssid_pass = self.password,
|
self.station_profile.ssid_pass = self.password,
|
||||||
self.station_profile.security = self.security
|
self.station_profile.security = self.security
|
||||||
|
|||||||
Reference in New Issue
Block a user