Commit graph

9 commits

Author SHA1 Message Date
Peter Hutterer
1b34bc6f7c test: distinguish better between stderr/stdout of the subprocess 2023-03-03 11:27:01 +10:00
Peter Hutterer
1a64b4963d Check incoming ids for validity
In libei we just check the range is correct.
In libeis we also check that the client is monotonically increasing the
id.
2023-03-03 11:27:01 +10:00
Peter Hutterer
c832ce3ddc protocol: split the handshake version negotiation from the other interfaces
Previously, we'd send one interface_version event for "ei_handshake"
immediately but all others after the client requests handshake.finish.
This was too confusing to document and not clear how it would work, so
let's make this simpler by splitting it up.

There is now a handshake_version event from the server, sent immediately
on connection that denotes the maximum version number for the interface.
And a handshake_version request from the client which must be the first
one by the client.
2023-03-03 11:27:01 +10:00
Peter Hutterer
35f5fa102c proto: rename ei_connection_setup to ei_handshake
This is a better name for the initial handshake and easier to
distinguish from the ei_connection this way too.

Suggested by Jonas Ådahl.
2023-03-03 11:27:01 +10:00
Peter Hutterer
2aaf7acdfc test: fix a ruff warning - f-string without placeholder 2023-03-03 11:27:01 +10:00
Peter Hutterer
705c5d79ac test: remove unused python import 2023-03-03 11:27:01 +10:00
Peter Hutterer
47467bfe0e proto: rename connection_setup.done to .finish
Avoids ambiguity with the .done events from e.g. the seat or the device.
2023-03-03 11:27:01 +10:00
Peter Hutterer
0897722493 proto: drop the seat caps and cross-reference device caps instead 2023-03-03 11:27:01 +10:00
Peter Hutterer
3fa396c012 test: add a framework for doing protocol tests directly
This tests the protocol layer which is hard to test using libei/libeis.
Similar to the generated C bindings we compile a eiproto.py file that is
then used in the test to talk protocol directly to the eis-demo-server
that we start up.

By sending the specific messages and checking things happen as we expect
on the socket we can verify that the EIS implementation is correct (and
robust enough).

In theory this could also be used to test some other binary with an EIS
implementation and the scaffolding is there to set LIBEI_TEST_SERVER to
that binary. Wether this works is untested though...
2023-03-03 11:27:01 +10:00