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>
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>
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>
The predefined mac list in the txt file is used
internally by the client simulator. It was missed
in previous commits.
Future clientsim rework should eliminate use of <predefined>
mac lists, but it's used now.
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Remove unused shard id argument from cli parser in
<generic> (assign to <any>) infra group create request.
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Make client simulator use single cert/key pair with mac
being taken from predefind macs list. This makes it easier
to use simulator, as it doesn't depend upon a big list
of certificates that are expected to match simulated MAC
and so on.
Fixup some python imports to not use relative import,
but rather istruct makefile to pass python path var
that includes relative path.
This is a change required for following commits that
bring automated testing using this simulator.
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
This change makes it possibly to fire make all / make run
without any additional prerequisites required.
It instructs Makefile to launch docker compose for thirdparty
services, as well as instructs CGW container to communicate
with newly created containers.
Also generates self-signed certs, in case if these are missing.
- Tweak docker-compose files for thirdparty services to resign
in a cgw-dedicated network, and use hostnames where needed;
- Change CGW app default network to cgw-dedicated network;
- Tweak PGSQL scripts to create tables in CGW DB, as well
as change ownership to them.
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
- Timestamp for events is calculated upon socket read,
which is the most accurate TS we can have;
- topo map uses the TS in calculations to deduce the
'latest' most-actual event while constructing map;
- Origin of edges and nodes is preserved, which means
topomap would not delete any nodes missing from state
message, in case if this node is also a directly
connected uCentral device instance;
- Disconnected leaf-nodes are automatically removed,
in case if their origin's not uCentral direct connection
(info about node received from state/rt evts etc)
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>