On 25/8/26 21:09, Marc-André Lureau wrote:
Replace the HMP "info network" text parsing with the structured
x-query-network QMP command. This makes the test assertions more robust
by matching individual fields (info-str) instead of parsing the full HMP
line format.
The EXPECT_STATE macro now takes an explicit netdev id argument to look
up the client by name in the QMP response. The strrchr truncation is
made NULL-safe: if the truncation character is not found, the full
string is compared (and the final g_assert_cmpstr will catch
mismatches).
While at it, fix the pre-existing duplicate "qemu/sockets.h" include,
and reorder includes.
Signed-off-by: Marc-André Lureau <[email protected]>
---
tests/qtest/netdev-socket.c | 143 +++++++++++++++++++++++++-------------------
1 file changed, 82 insertions(+), 61 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>