Tests can fail if run in multi cgw env.
The reason is that <metrics> are a bit more delayed
compare to the <redis> assigned num / counters.
Do a mini sleep on each check when necessary.
Some tests (like stress test - max num of groups assign)
can still fail. Fix / W/A - TODO.
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
* Added IP/Port to unassigned infra join message
* Renamed unassigned infra connection message to infra join
* Do not send infra join for unassigned infra connection
* Added CONNECT message payload to [un]assigned infra connection
* Added unassigned infra leave message
* Updated tests
* Updated YAML APIs
Add initial list of YAML files that formalize Kafka API:
- requests list that CGW can handle
- responses that CGW will generate
- unsolicited events that CGW might generate
Also a small cleanup of requests and responses was made,
to align it with a common format (renamed some of the fields,
added missing etc).
Tests are tweaked to accomodate for changed field names.
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Change CGW behavior to return only 'failed_infras' in both
infra add/del partial or completely failed responses.
This tweaks the previous redundant data that was returned in the
response - list of <all> macs in case of a successfull completion,
which is unnecessary - it's already clear that request succeeded,
and actions were made over supplied infra list.
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Remove unused 'infra_name' from NB API requests that
manage infra_group (add/del).
Also change tests / utils and helper scripts to no longer
form kafka msgs with 'infra_name' present.
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Whenever tests start, they might do some enviromental
changes to local FS. Handle this by moving
the 'context' of tests execution to a tmpfs folder, that
can be easily purged after tests are done / new test run
is being executed.
NOTE: further changes in regard to tests isolation should
potentially utilize a separate docker container that serves
as a fresh clean and isolated enviroment for tests run.
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Force redis, PSQL, kafka clients to have a strict
timeout value for any requests.
It's done to ensure our tests do not hang for an unknown
period of time in case if something goes wrong.
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Add initial infrastructure for sending / receiving messages
using websocket bindings for client sim.
Add initial handle-reboot-simulation test, that both
tests CGW's ability to sink down a request, as well as
test it's behavior whenever simulated device's been rebooted.
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>