mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 10:48:02 +00:00 
			
		
		
		
	realm_test.py: WIP:
re-ordered operations capturing and reporting more errors improving output
This commit is contained in:
		| @@ -1,26 +1,55 @@ | |||||||
| #!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||||
|  | import pprint | ||||||
|  | from pprint import pprint | ||||||
| import realm | import realm | ||||||
|  | from realm import Realm | ||||||
|  |  | ||||||
|  | localrealm = Realm("localhost", 8080, True) | ||||||
|  |  | ||||||
| test = realm.Realm("http://localhost:8080") | print("** Existing Stations **") | ||||||
|  | try: | ||||||
|  |     sta_list = localrealm.station_list() | ||||||
|  |     print(f"{len(sta_list)} Stations:") | ||||||
|  |     pprint(sta_list) | ||||||
|  |     print(localrealm.find_ports_like("sta+")) | ||||||
|  |     print(localrealm.find_ports_like("sta0*")) | ||||||
|  |     print(localrealm.find_ports_like("sta[0000..0002]")) | ||||||
|  | except Exception as x: | ||||||
|  |     pprint(x) | ||||||
|  |     exit(1) | ||||||
|  |  | ||||||
| sta_list = test.station_list() | print("** Existing vAPs **") | ||||||
| cx_list = test.cx_list() | try: | ||||||
| vap_list = test.vap_list() |     vap_list = localrealm.vap_list() | ||||||
|  |     print(f"{len(vap_list)} VAPs:") | ||||||
|  |     pprint(vap_list) | ||||||
|  | except Exception as x: | ||||||
|  |     pprint(x) | ||||||
|  |     exit(1) | ||||||
|  |  | ||||||
|  | print("** Existing CXs **") | ||||||
|  | try: | ||||||
|  |     cx_list = localrealm.cx_list() | ||||||
|  |     print(f"{len(cx_list)} CXs:") | ||||||
|  |     pprint(cx_list) | ||||||
|  | except Exception as x: | ||||||
|  |     pprint(x) | ||||||
|  |     exit(1) | ||||||
|  |  | ||||||
| print(f"CXs: {cx_list}\n") | print("** Removing previous stations **") | ||||||
| print(f"Stations: {sta_list}\n") |  | ||||||
| print(f"VAPs: {vap_list}\n") |  | ||||||
|  |  | ||||||
| cxTest = realm.CXProfile() | print("** Removing previous CXs **") | ||||||
|  |  | ||||||
| cxTest.add_ports("A", "lf_udp", test.find_ports_like("sta+")) | print("** Creating Stations **") | ||||||
| cxTest.create() |  | ||||||
|  |  | ||||||
| print(test.find_ports_like("sta+")) | print("** Creating CXs **") | ||||||
|  | try: | ||||||
|  |     cxProfile = localrealm.newCXProfile() | ||||||
|  |     # set attributes of cxProfile | ||||||
|  |     cxProfile.add_ports("A", "lf_udp", localrealm.find_ports_like("sta+")) | ||||||
|  |     cxProfile.create() | ||||||
|  | except Exception as x: | ||||||
|  |     pprint(x) | ||||||
|  |     exit(1) | ||||||
|  |  | ||||||
| print(test.find_ports_like("sta0*")) | # | ||||||
|  |  | ||||||
| print(test.find_ports_like("sta[0000..0002]")) |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jed Reynolds
					Jed Reynolds