Commit Graph

1099 Commits

Author SHA1 Message Date
Ben Greear
d697963cec create-cx: Add return code checking for cx and endp creation.
Check for false value in create_l3_stations and return error code
upon failure.

Add configurable timeout to waiting for cx/endp logic.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:45 +05:30
Ben Greear
4bb9cb4b82 l3-stations: error checking for station creation.
In station_profile create method, pay attention to result of
wait_until_ports_appear.  If it returns False, we know creation
has failed somehow, so we do not need to do the extra checking
that was in the create() method.

create_l3_stations adds logic to check return code of station
create logic, and exit with error code if it could not
create them as expected.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:45 +05:30
Chuck SmileyRekiere
12add4503a py-json/realm.py : moved back to using lists (original code from a couple
of days ago)

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:45:45 +05:30
Chuck SmileyRekiere
4acd3beb29 realm.py : removed the len(endpoint) > 1
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:45:45 +05:30
Matthew Stidham
676bcab1d7 lfcli_base.check_connect: Replace while loop with for loop for additional security.
Add timeout argument

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:45 +05:30
Matthew Stidham
a9e0189e8d Revert "realm.wait_until_ports_disappear: endp_list needs a length greater than 0, not 1"
This reverts commit 68fcf480818432a0926e8c7d1ccc621f52cfbb06.
2022-07-12 15:45:45 +05:30
Matthew Stidham
a9c6ab4f12 realm.wait_until_ports_disappear: endp_list needs a length greater than 0, not 1
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:45 +05:30
Matthew Stidham
629069cfad realm.wait_until_endps_appear: check to make sure there is a port in the endpoints list
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:45 +05:30
Matthew Stidham
d131abe916 realm.wait_until_endps_appear: Replace try: except: loop with if condition, so we don't potentially hide bugs
remove unnecessary variables

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:45 +05:30
Matthew Stidham
282667b861 LFUtils: Use pythonic name for get_as_json
Replace all while loops with for loops, for security

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:45 +05:30
Matthew Stidham
e128a6aa5f LFUtils.wait_until_ports_appear: alert the user if a port is phantom
Use a for loop for increased stability
remove deprecated variables

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:45 +05:30
Chuck SmileyRekiere
7ad7f003c7 lfcli_base.py added --lf_logger_config_json to base args
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:45:45 +05:30
Matthew Stidham
944021855a station_profile: Timestamp printing needed an additional parentheses
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:45 +05:30
Matthew Stidham
0a0bd5e25b LFUtils.wait_until_ports_appear: Improve docstring for port_list
if port_list is not a list, make it a list

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:45 +05:30
Matthew Stidham
a16072f062 station_profile.create: print timestamp in milliseconds when removing ports when debug is on
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
693adadf30 realm.rm_port: Don't spout an error if the port exists, just return False.
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
8a502c918c station_profile: Do not try to run set() on a dictionary, that does not work.
port_list needs to be a list of the keys in the 'interfaces' output of lanforge json

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
d135d1ee6e StationProfile.create: LFRequest needs to be fed the url to make the request to
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
f0694033dd StationProfile.create: Pretty print out current ports as soon as function starts when debug is on.
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
4e4276002f LFUtils: Replace nc_show_ports with show_ports in wait_until_ports_appear to enable caching
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
e709fd711c station_profile: Remove unused import
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
d6db3d0a2d station_profile: Remove unused arguments and make station_mode_to_number static
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
f4ddf7010b station_profile: Fix whitespace
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
d824dc0116 station_profile: Massively improve debug information so we have a better idea when scripts fail
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
c950789af6 l3_cxprofile: Declare the beginning of l3_cxprofile.create when it starts when debug is turned on
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
642aab2dd4 LFUtils.wait_until_ports_disappear: remove ports if they still exist.
LFUtils.wait_until_ports_appear: Improve debug by printing existing stations and adding more information to debug string

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
d6060dbe5c station_profile: Improve debug output when creating stations to make it more legible
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Scott Wedge
a13f8260d2 http_profile.py: update ftp feature for hard-code resource and upstream-port
Signed-off-by: Scott Wedge <wedges@candelatech.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
b54e12e623 create_wanlink: Improve logic, if X is not None is non-pythonic and can create major problems. if X is safer
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
476b019f0a create_wanlink: Dead code removal
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
3a24c0f00d gen_cxprofile: using if not None can open traps which will spring at us randomly. Improve logic
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
89a1656e4a Revert "Revert "realm.Realm: Move get_events and find_new_events methods from scenario.py to realm""
This reverts commit 67fe51cebd5403e8240d3490b7539b1e41dd212a.
2022-07-12 15:45:33 +05:30
Matthew Stidham
b6cd3113b0 realm: Update wait_until_ports_appear method to pass timeout
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
1593da85a5 LFUtils: add sec_elapsed and timeout to wait_until_ports_appear
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:33 +05:30
Matthew Stidham
44684df155 Revert "realm.Realm: Move get_events and find_new_events methods from scenario.py to realm"
Breaks things
This reverts commit 3cd8db24e2692ecdf11f61991b7975f0cc270713.
2022-07-12 15:45:32 +05:30
Matthew Stidham
4de51da60c station_profile.create: rename my_sta_names to my_sta_eids
Add in better debug for when stations do not appear properly
Explicit PortNameSeries arguments

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:32 +05:30
Matthew Stidham
e29a86d7f4 realm.Realm: Move get_events and find_new_events methods from scenario.py to realm
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:32 +05:30
Matthew Stidham
e639ecf48f Revert "realm.wait_for_ip: Simple is better than complex. Return True inside the while loop when the passing condition is met so we can remove three redundant variables"
This reverts commit 915292ca6238a258f969f3b2c037f12f06143324.
2022-07-12 15:45:32 +05:30
Matthew Stidham
d4c335c357 Revert "Realm.wait_for_ip: We only need to checik that stas_without_ips and stas_without_ip6s are equal to zero once, simplify code further"
This reverts commit ec74b97bae4dce3eaf1b856d1e9bd7d7d271c42d.
2022-07-12 15:45:32 +05:30
Matthew Stidham
ec7fcf1ec4 Realm.wait_for_ip: We only need to checik that stas_without_ips and stas_without_ip6s are equal to zero once, simplify code further
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:32 +05:30
Matthew Stidham
f149a3d461 LFUtils.wait_until_ports_admin_up: return True or false depending on if the
test is successful or not

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:32 +05:30
Matthew Stidham
63a9074f76 realm.wait_for_ip: Simple is better than complex. Return True inside the while loop when the passing condition is met so we can remove three redundant variables
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:32 +05:30
Ben Greear
8446d8fc1b realm:wait_for_ip: re-write logic for correctness and debugging.
Check ipv6 and ipv4 independently of each other.

Auto-timeout check is moved to top of the method.

Improve debugging output.

Fix logic that attempted to print out all ports when
there is failure to find IPs for at least one of the ports.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:32 +05:30
Matthew Stidham
a8bd985119 LFUtils.wait_until_ports_disappear: Add timeout with default set to 360 seconds
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:32 +05:30
Matthew Stidham
62ff764e13 LFUtils.wait_until_ports_admin_down: add timeout, defaulted to 360 seconds
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:32 +05:30
Matthew Stidham
25ef58262b realm.Realm.wait_for_ip: Improve debug output so that when a port is missing IP it will print out the name of the port
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:32 +05:30
Matthew Stidham
037210c049 LFUtils: remove unused variables
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:32 +05:30
Matthew Stidham
2d8e5411a2 LFUtils: Fix docstrings so they have all arguments
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:32 +05:30
Matthew Stidham
5250be3c84 LFUtils.wait_until_ports_disappear: check for port statuses once per second
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:24 +05:30
Matthew Stidham
0f54243be8 LFUtils: Cleanup whitespace
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:24 +05:30