Commit Graph

342 Commits

Author SHA1 Message Date
Chuck SmileyRekiere
722e24593a lfcli_base.py : Chamberview tests will snow 0 results which is not an error
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:46:32 +05:30
Chuck SmileyRekiere
9a5bf473c3 LFRequest.py : allow for debug to be enable at enstanciation o the LFRequest.py and passed in
vap_profile.py updated to allow the mac address to be used and pass in
debug state on enstanciation of LFRequest
modify_vap.py : added logging, pass debug flag to base classes

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:46:32 +05:30
Jed Reynolds
b73395646a lfcli_base.py: moves comments from sandbox about LF_USE_AUTOGEN to here
this is the appropriate file to have that comment in

Signed-off-by: Jed Reynolds <jed@bitratchet.com>
2022-07-12 15:46:31 +05:30
Chuck SmileyRekiere
3007815cb1 LFRequest.py : modified the http.client._MAXHEADERS from 100 -> 300 in
LFRequest.py

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:46:25 +05:30
Jed Reynolds
ccb0025639 add_sta.py: whitespace
Signed-off-by: Jed Reynolds <jed@bitratchet.com>
2022-07-12 15:46:16 +05:30
Chuck SmileyRekiere
0dc1fe4a83 logger.debug , changed passing two strings to passing a single string.
-                logger.debug("jsonGet asked for " + _req_url)
+                logger.debug("jsonGet asked for {_req_url} ".format(_req_url=_req_url))

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:46:16 +05:30
Chuck SmileyRekiere
7618d9d139 lfcli_base.py : updated logger.debug to print out the license block.
logger.debug takes a single string removed the string addition.

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:46:16 +05:30
Chuck SmileyRekiere
61ed43c258 lfcli_base.py : added back in --port
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:46:16 +05:30
Chuck SmileyRekiere
f7fae8f381 lfcli_base.py: changed --port in lfcli_base to --lf_port , this addition of
--port created a conflict with lf_attend_mod_test.py The --port was introduced
a month ago. Will look for other conflicts in the regressions.
Changed lf_attend_mod_test.py to add back in --port

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:46:16 +05:30
Chuck SmileyRekiere
19117b2ece refactored scripts to use --no_cleanup
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:46:15 +05:30
Chuck SmileyRekiere
4ffb8c3935 lfcli_base.py base args parser supports --lfmgr and --port
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:46:02 +05:30
Ben Greear
fb48980ee1 vap-profile: Improve logging and use some base class code.
More changes all around regression test logic related to the
vap profile.  Move some open-coded admin_up/admin_down calls
to base class.

regression test takes the .rc file as primary input,
and cmd-line args will override that.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:46:02 +05:30
Ben Greear
4129f01860 lf_multipsk: Improve logging and add some TODOs
Add some more notes about external dependencies for this
script.  It is meant to run with already-created vlans,
for instance.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:53 +05:30
Jed Reynolds
0004047dc6 lfcli_base.py: adds debugging around what pass results are
Signed-off-by: Jed Reynolds <jed@bitratchet.com>
2022-07-12 15:45:49 +05:30
Jed Reynolds
2b13166a4a LFUtils.py: comments out debug on object that only provides memory address as output
Signed-off-by: Jed Reynolds <jed@bitratchet.com>
2022-07-12 15:45:49 +05:30
Jed Reynolds
0ca2007d62 LFRequest.py: re-formats debug output so that it is less likely to wrap
On a narrow terminal it is difficult to follow the output. This merges a
series of message lines into one debug output call to help legibility

Signed-off-by: Jed Reynolds <jed@bitratchet.com>
2022-07-12 15:45:49 +05:30
Jed Reynolds
ea9fda9c60 LFUtils.py: formats debug output json for pull port listing
Signed-off-by: Jed Reynolds <jed@bitratchet.com>
2022-07-12 15:45:49 +05:30
Ben Greear
b7d42bce04 lfcli-base: consider test passed if there are no failures.
Previous code also insisted that there was at least one success,
but that means that code doing not pass/fail tests would
fail.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:49 +05:30
Jed Reynolds
d07c61ebc3 lfcli_base.py: updates check_connect() method to provide bold warning when detecting expired licenses.
Also generates warning about licences expiring within 30 days.

Signed-off-by: Jed Reynolds <jed@bitratchet.com>
2022-07-12 15:45:49 +05:30
Jed Reynolds
1d67c30d1a LFRequest.py: raise ValueError when provided a highly improbable URL/PATH combination.
This was triggered by a call to admin_up() that was passing self.lfclient_url as an un-named parameter, creating
unanswerable requests formatted like http://localhost:8080/http:/localhost:8080/. There should really only be
one http[s]*:// pattern in a URL, and further instances of colons should be URL encoded to %3A.

Signed-off-by: Jed Reynolds <jed@bitratchet.com>
2022-07-12 15:45:49 +05:30
Chuck SmileyRekiere
37db2052fb lfcli_base.py prints changed to logger
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:45:46 +05:30
Ben Greear
6a964ef215 lfutils: fix wait-for-ports-admin-up
Logic was broken trying to compare json_response['down'] to "true",
when instead that object is a Boolean variable.  So this method
always returned immediately instead of actually waiting until port
was admin up.  This was seen testing VAP profile.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:46 +05:30
Ben Greear
531cf440af qvlans: Fix creating qvlans
Make it look more like macvlans, including logic to set IP addresses,
and to verify qvlans were created properly.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:46 +05:30
Ben Greear
0bddc504de clibase: Print out pass and failure messages on exit.
This is nice info to have printed.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:46 +05:30
Ben Greear
f8d8e5849c lfutils: Print out some wait-for-port messages at info level.
Instead of just at debug level...

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:46 +05:30
Matthew Stidham
509d091b66 lfcli_base.LFCLIBase.create_basic_argparse: Add noclean argument
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2022-07-12 15:45:45 +05:30
Ben Greear
bbfc9a1077 lfutils: wait_until_ports_admin_up treat 404 ports as down.
If port cannot be found, then it is down.  This fixes race with
creating port and then immediately trying to way for it to go
admin up.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:45 +05:30
Ben Greear
998f25cb95 generic-endp: Fix multitude of errors.
The generic endpoint profile, especially the monitoring code,
was wrong in lots of ways.

Fix this, improve pass/fail and error reporting, and other
improvements for the gen_profile test.

Probably not backwards compat, but I assume due to breakage
no one was using this code anyway.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:45 +05:30
Ben Greear
2f3eb58c41 Add --log_level option to lfcli base class.
Let user specify the level of logging desired.
Test implementaiton in example_security_connection.py

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:45 +05:30
Ben Greear
41f587e424 lfutils: wait_until_ports_disappear will return True or False
In all return paths.
And remove redundant check for being done removing ports or not.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:45 +05:30
Chuck SmileyRekiere
40bc34f04d LFUtils.py : changes prints to logger
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
2022-07-12 15:45:45 +05:30
Matthew Stidham
ec3a09b60f LFUtils: When debug is on, clearly state all stations have appeared in success case
Signed-off-by: Matthew Stidham <stidmatt@gmail.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
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
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
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
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
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
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
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
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
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
Ben Greear
cd6e6b18b2 lfutils: let wait_until_ports_admin_up handle multiple resources.
Default to treat station list as list of EIDS, and use it's
shelf/resource info instead of using resource 1 by default.
Caller may still use resource_id=X if they wish too, and it
will work as it did previously.

Add loop timeout (default is 300 tries with 1-sec sleep, so 5+
minutes).  This keeps the method from spinning forever if port
cannot come up.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2022-07-12 15:45:17 +05:30
Matthew Stidham
5fdadbda64 LFUtils: Remove unused init, the second one was the one which was actually used
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
2021-12-06 17:26:36 -08:00