tests/qtest: netdev: test stream and dgram backends
PATCH v7 1/1 tests/qtest: netdev: test stream and dgram backends
---
Notes:
v7:
- disable test_dgram_mcast() on windows
- disable test_dgram_unix() on windows as it also fails (we test for unix support dynamically but the test is done with SOCK_STREAM, and it fails here with SOCK_DGRAM)
- Tested with cirrus-ci (Thank you Thomas)
v6:
- call socket_init() otherwise socket_check_protocol_support() fails
- if socket_check_protocol_support() fails then calls g_abort() to report a problem.
v5:
- disable test_stream_fd and test_dgram_fd on windows as socketpair() is not defined.
- enable test_stream_unix_abstract only on linux as "abstract" unix socket parameter is only defined on linux.
v4:
- rework EXPECT_STATE()
- use g_dir_make_tmp()
v3:
- Add "-M none" to avoid error:
"No machine specified, and there is no default"
v2:
- Fix ipv6 free port allocation
- Check for IPv4, IPv6, AF_UNIX
- Use g_mkdtemp() rather than g_file_open_tmp()
- Use socketpair() in test_stream_fd()
v1: compared to v14 of "qapi: net: add unix socket type support to netdev backend":
- use IP addresses 127.0.0.1 and ::1 rather than localhost
tests/qtest/meson.build | 2 + tests/qtest/netdev-socket.c | 448 ++++++++++++++++++++++++++++++++++++ 2 files changed, 450 insertions(+) create mode 100644 tests/qtest/netdev-socket.c
tests/qtest/meson.build +2 -0
@@ -21,6 +21,7 @@ qtests_generic = [ 'test-hmp', 'qos-test', 'readconfig-test', + 'netdev-socket', ] if config_host.has_key('CONFIG_MODULES') qtests_generic += [ 'modules-test' ]
@@ -298,6 +299,7 @@ qtests = { 'tpm-tis-device-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'], 'tpm-tis-device-test': [io, tpmemu_files, 'tpm-tis-util.c'], 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'), + 'netdev-socket': files('netdev-socket.c', '../unit/socket-helpers.c'), } gvnc = dependency('gvnc-1.0', required: false)
tests/qtest/netdev-socket.c new file +448 -0
448 lines not on this page · raw message
Signature · 1 line
2.39.0
Quoted 5 lines · Laurent Vivier
Signed-off-by Laurent Vivier <[email protected]>Acked-by Thomas Huth <[email protected]>---
Quoted 7 lines
Notes:
v7:
- disabletest_dgram_mcast()on windows
- disabletest_dgram_unix()on windows as it also fails (we test for unix support dynamically but the test is done withSOCK_STREAM, and it fails here withSOCK_DGRAM)
- Tested with cirrus-ci (Thank you Thomas)
Thanks, added to my staging branch:
https://gitlab.com/thuth/qemu/-/commits/staging
Thomas
Quoted 15 lines · Thomas Huth
Quoted 5 lines · Laurent Vivier
Signed-off-by Laurent Vivier <[email protected]>Acked-by Thomas Huth <[email protected]>---
Quoted 7 lines
Notes:
v7:
- disabletest_dgram_mcast()on windows
- disabletest_dgram_unix()on windows as it also fails (we test for unix support dynamically but the test is done withSOCK_STREAM, and it fails here withSOCK_DGRAM)
- Tested with cirrus-ci (Thank you Thomas)
Quoted 5 lines
Thanks, added to my staging branch:
https://gitlab.com/thuth/qemu/-/commits/staging
Thomas
I've also queued this since it is required for the patch:
[PATCH v4] net: stream: add a new option to automatically reconnect
Thanks