mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
Cleaned up Create L4
This commit is contained in:
committed by
Jed Reynolds
parent
545b619848
commit
be7e94916f
@@ -1,13 +1,11 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""
|
|
||||||
This script will create a variable number of stations each with their own set of cross-connects and endpoints.
|
|
||||||
It will then create layer 3 traffic over a specified amount of time, testing for increased traffic at regular intervals.
|
|
||||||
This test will pass if all stations increase traffic over the full test duration.
|
|
||||||
|
|
||||||
Use './test_ipv4_variable_time.py --help' to see command line usage and options
|
|
||||||
"""
|
"""
|
||||||
|
This script will create a variable number of layer4 stations each with their own set of cross-connects and endpoints.
|
||||||
|
|
||||||
|
Use './create_l4.py --help' to see command line usage and options
|
||||||
|
"""
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -75,38 +73,6 @@ class CreateL4(Realm):
|
|||||||
self.cx_profile.side_b_min_bps = side_b_min_rate
|
self.cx_profile.side_b_min_bps = side_b_min_rate
|
||||||
self.cx_profile.side_b_max_bps = side_b_max_rate
|
self.cx_profile.side_b_max_bps = side_b_max_rate
|
||||||
|
|
||||||
|
|
||||||
def __get_rx_values(self):
|
|
||||||
cx_list = self.json_get("endp?fields=name,rx+bytes", debug_=self.debug)
|
|
||||||
if self.debug:
|
|
||||||
print(self.cx_profile.created_cx.values())
|
|
||||||
print("==============\n", cx_list, "\n==============")
|
|
||||||
cx_rx_map = {}
|
|
||||||
for cx_name in cx_list['endpoint']:
|
|
||||||
if cx_name != 'uri' and cx_name != 'handler':
|
|
||||||
for item, value in cx_name.items():
|
|
||||||
for value_name, value_rx in value.items():
|
|
||||||
if value_name == 'rx bytes' and item in self.cx_profile.created_cx.values():
|
|
||||||
cx_rx_map[item] = value_rx
|
|
||||||
return cx_rx_map
|
|
||||||
|
|
||||||
def start(self, print_pass=False, print_fail=False):
|
|
||||||
self.station_profile.admin_up()
|
|
||||||
temp_stas = self.station_profile.station_names.copy()
|
|
||||||
|
|
||||||
if self.wait_for_ip(temp_stas):
|
|
||||||
self._pass("All stations got IPs")
|
|
||||||
else:
|
|
||||||
self._fail("Stations failed to get IPs")
|
|
||||||
self.exit_fail()
|
|
||||||
self.cx_profile.start_cx()
|
|
||||||
|
|
||||||
|
|
||||||
def stop(self):
|
|
||||||
self.cx_profile.stop_cx()
|
|
||||||
self.station_profile.admin_down()
|
|
||||||
|
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
self.cx_profile.cleanup()
|
self.cx_profile.cleanup()
|
||||||
self.station_profile.cleanup()
|
self.station_profile.cleanup()
|
||||||
@@ -136,11 +102,11 @@ def main():
|
|||||||
''',
|
''',
|
||||||
|
|
||||||
description='''\
|
description='''\
|
||||||
test_ipv4_variable_time.py:
|
layer4.py:
|
||||||
--------------------
|
--------------------
|
||||||
Generic command layout:
|
Generic command layout:
|
||||||
|
|
||||||
python3 ./test_ipv4_variable_time.py
|
python3 ./layer4.py
|
||||||
--upstream_port eth1
|
--upstream_port eth1
|
||||||
--radio wiphy0
|
--radio wiphy0
|
||||||
--num_stations 32
|
--num_stations 32
|
||||||
|
|||||||
Reference in New Issue
Block a user