Commit Graph

44 Commits

Author SHA1 Message Date
ailchuk
4d5bffebeb fix tests for proxy 2025-04-11 14:04:39 +03:00
Oleksandr Mazur
093d32b2c4 CGW: Tests: fixup tests after redis cache W/A introduced
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>
2025-04-08 16:03:22 +03:00
Sviatoslav Boichuk
a823f85cb0 Added new NB API to report NB once CGW failed to parse NB request 2025-03-11 17:42:36 +02:00
Sviatoslav Boichuk
5fb6dea276 Validate infra gid for infra request (config, reboot etc...) 2025-02-17 09:33:07 +02:00
Sviatoslav Boichuk
910e513e7d Do not use capital letter in Kafka topocs name 2025-02-17 09:17:55 +02:00
Sviatoslav Boichuk
a058c572ad Fix spell issues. Update infra events tests 2025-02-17 09:17:55 +02:00
Sviatoslav Boichuk
50c26a3139 Do not send unassigned infras state/realtime events to NB! 2025-02-17 09:17:55 +02:00
Sviatoslav Boichuk
823baa1b13 Send infra join when device become assigned, and unassigned infra join when device become unassigned 2025-02-07 10:43:17 +02:00
Olexandr, Mazur
0edd6bdadd Merge pull request #118 from Telecominfraproject/dev-nb-apis-update
Change NB API infra_group_id type from string to integer
2025-02-01 21:00:04 +02:00
Sviatoslav Boichuk
80ec425329 Change NB API infra_group_id type from string to integer 2025-01-27 17:11:33 +02:00
Sviatoslav Boichuk
198cfc69d7 Addded test for foreign infra connection 2025-01-21 15:29:18 +02:00
Sviatoslav Boichuk
b1f840d3b7 Send unassigned_infra_join once infra becomes unassigned due to group delete or infra unassigned from group 2025-01-15 13:36:13 +02:00
Sviatoslav Boichuk
5f4d1ad28b Add tests for different events & expected topics to be received from 2025-01-14 16:38:07 +02:00
Sviatoslav Boichuk
7fc6d77fbb Send different NB APIs to different topics 2025-01-07 15:26:34 +02:00
Sviatoslav Boichuk
278d48de9d Updated [un]assinged infra join to NB
* 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
2025-01-06 12:55:16 +02:00
Sviatoslav Boichuk
dad9a9fa44 Fixed spell issues in pytests 2025-01-02 16:58:32 +02:00
Sviatoslav Boichuk
c7a5316629 Fixed spell issues in CGW codebase 2025-01-02 16:40:58 +02:00
Sviatoslav Boichuk
202a513759 Formatted pytests with autopep8 2025-01-02 10:04:32 +02:00
Oleksandr Mazur
e9d37d1b8c Initial formalization of API in form of YAML files
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>
2024-12-19 14:51:16 +02:00
Oleksandr Mazur
4ee92484e0 CGW: rework partial infra add/del returned infras list
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>
2024-12-19 14:51:16 +02:00
Oleksandr Mazur
3155b8da83 CGW: remove 'infra_name' from infra_group API
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>
2024-12-19 14:51:16 +02:00
Oleksandr Mazur
e79afca822 Tests: execute tests in tmpfs context (folder)
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>
2024-12-11 16:24:15 +02:00
Oleksandr Mazur
49555495e8 Tests: core: add timeout values for common clients
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>
2024-12-11 16:24:15 +02:00
Olexandr, Mazur
3f2b42272e Merge pull request #107 from Telecominfraproject/dev-enhance-nb-replys
Dev enhance nb replys
2024-12-11 16:23:11 +02:00
Oleksandr Mazur
8be06b7628 Tests: add missed test file
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-10 17:11:39 +02:00
Sviatoslav Boichuk
840b9a970b Fixed tests print messages 2024-12-10 15:40:27 +02:00
Sviatoslav Boichuk
09e92207e9 Added malformed packets basic tests 2024-12-10 15:23:36 +02:00
Olexandr, Mazur
cd35ca6e1e Merge pull request #105 from Telecominfraproject/dev-basic-msg-relay-test
Dev basic msg relay test
2024-12-10 13:57:48 +02:00
Sviatoslav Boichuk
2405379c50 Added infra assign message relay test 2024-12-10 11:23:37 +02:00
Sviatoslav Boichuk
932b211706 Merge pull request #103 from Telecominfraproject/feat/test_initial_infra_message_impl
Initial infra message impl
2024-12-06 13:03:03 +02:00
Sviatoslav Boichuk
8feb522d6d Updated CGW tests 2024-12-05 16:12:57 +02:00
Oleksandr Mazur
10fd2d765b Testing: initial message queue (infra msg) infrastructure
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>
2024-12-05 14:52:24 +02:00
Sviatoslav Boichuk
495d6bba73 Added partial infra add test case 2024-11-25 18:25:43 +02:00
Sviatoslav Boichuk
bb14546499 Rework kafka consumer polling mechanism 2024-11-25 17:40:50 +02:00
Sviatoslav Boichuk
c18c657255 Added cleanup for each test case 2024-11-25 17:06:27 +02:00
Sviatoslav Boichuk
d5b6de0047 Added PSQL Client & Redis Client - modified tests 2024-11-25 13:55:58 +02:00
Sviatoslav Boichuk
35ee4f0a25 Added multiple infras add/del tests and capacity overflow 2024-11-21 14:16:34 +02:00
Sviatoslav Boichuk
cac3c9ac81 Added group capacity overflow test case & fix metrics 2024-11-20 16:26:57 +02:00
Sviatoslav Boichuk
03f8ad6056 Infra add/del tests initial 2024-11-20 16:22:12 +02:00
Sviatoslav Boichuk
7d9fbc918b Added infra group test cases 2024-11-18 12:47:18 +02:00
Sviatoslav Boichuk
055e2fb41c Fix identations 2024-11-18 12:45:59 +02:00
Sviatoslav Boichuk
8e59cd1569 Added metrics checkers to basic tests 2024-11-18 09:59:41 +02:00
Sviatoslav Boichuk
130047bfc0 Added Python dependencies to tests 2024-11-18 09:59:17 +02:00
Oleksandr Mazur
768c41dd90 Testing: introduce initial automated testing _core_ changes
Implement initial core for automated tests:
 * mostly resuses/extends existing simulator, kafka producer etc;
 * helper scripts added for manual testing
   (single infra/group add/del etc)
 * Tests compose either of simple steps premade into fixtures,
   or combine usage of both fixtures + custom code inside
   test's funcion

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-11-12 14:20:08 +02:00