qemu-cr16/tests
Roman Penyaev c9c05ed525 tests/unit/test-char: add unit tests for hub chardev backend
This commit introduces a new test function `char_hub_test` to validate
the functionality and constraints of the "hub" chardev backend in QEMU.
The test includes multiple scenarios:

1. Invalid hub creation:
   - Creating a hub without defining `chardevs.N` (expects an error).
   - Creating a hub with an embedded multiplexer (`mux=on`) or a chardev
     already in use (expects errors).

2. Max backend limit:
   - Ensures the hub does not accept more backends than the maximum
     allowed, with appropriate error handling.

3. Valid hub creation and data aggregation:
   - Successfully creating a hub with two ring buffer backends.
   - Verifying data aggregation from backends to a frontend and vice versa.
   - Ensuring correct error handling for attempts to attach a hub multiple
     times or remove busy chardevs.

4. Extended EAGAIN simulation (non-Windows only):
   - Simulates a setup with three backends, including a pipe, to test
     EAGAIN handling and watcher behavior.
   - Verifies data flow and recovery in scenarios involving buffer
     overflows and drained pipes.

The test also ensures correct cleanup of chardevs in all cases, covering
both valid and invalid configurations.

Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
Reviewed-by: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org
Message-ID: <20250123085327.965501-4-r.peniaev@gmail.com>
2025-02-03 13:57:08 +04:00
..
avocado tests/functional/test_mips_malta: Convert the mips big endian replay tests 2025-01-30 10:51:24 +01:00
bench tests/bench: Rename test_akcipher_keys.inc -> test_akcipher_keys.c.inc 2024-09-20 10:08:24 +03:00
data target/riscv: add shgatpa 2025-01-19 09:44:34 +10:00
decode
docker dockerfiles: Remove 'MAINTAINER' entry in debian-tricore-cross.docker 2025-01-11 11:22:01 +00:00
fp tests/fp: Set default NaN pattern explicitly 2024-12-11 15:31:04 +00:00
functional trivial patches for 2025-01-30 2025-01-30 15:11:49 -05:00
guest-debug tests/tcg: Stop using exit() in the gdbstub testcases 2024-11-18 15:54:34 +00:00
image-fuzzer
include
keys
lcitool tests/lcitool: remove temp workaround for debian mips64el 2025-01-11 11:22:01 +00:00
migration-stress tests/migration: Disambiguate guestperf vs. a-b 2024-12-12 10:25:39 -03:00
multiboot
perf/block/qcow2
qapi-schema tests/qapi-schema: Drop temporary 'prefix' 2024-09-10 13:22:47 +02:00
qemu-iotests migration: Always set DEVICE state 2025-01-29 11:56:41 -03:00
qtest Misc HW patches 2025-02-02 11:09:03 -05:00
rocker
tcg tests/tcg/s390x: Test modifying code using the MVC instruction 2025-01-30 10:39:37 +01:00
tsan
uefi-test-tools tests/data/uefi-boot-images: Add RISC-V ISO image 2024-07-03 18:14:06 -04:00
unit tests/unit/test-char: add unit tests for hub chardev backend 2025-02-03 13:57:08 +04:00
vm tests/vm: allow interactive login as root 2025-01-11 11:22:01 +00:00
vmstate-static-checker-data
dbus-vmstate-daemon.sh
Makefile.include tests/functional: enable pre-emptive caching of assets 2024-09-04 10:52:29 +02:00
meson.build tests/migration: Disambiguate guestperf vs. a-b 2024-12-12 10:25:39 -03:00
test-qht-par.c
vhost-user-bridge.c