73a1e969 | 22-Apr-2024 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
tests/unit: Remove debug statements in test-nested-aio-poll.c
We have been running this test for almost a year; it is safe to remove its debug statements, which clutter CI jobs output:
▶ 88/100
tests/unit: Remove debug statements in test-nested-aio-poll.c
We have been running this test for almost a year; it is safe to remove its debug statements, which clutter CI jobs output:
▶ 88/100 /nested-aio-poll OK io_read 0x16bb26158 io_poll_true 0x16bb26158 > io_poll_ready io_read 0x16bb26164 < io_poll_ready io_poll_true 0x16bb26158 io_poll_false 0x16bb26164 > io_poll_ready io_poll_false 0x16bb26164 io_poll_false 0x16bb26164 io_poll_false 0x16bb26164 io_poll_false 0x16bb26164 io_poll_false 0x16bb26164 io_poll_false 0x16bb26164 io_poll_false 0x16bb26164 io_poll_false 0x16bb26164 io_poll_false 0x16bb26164 io_read 0x16bb26164 < io_poll_ready 88/100 qemu:unit / test-nested-aio-poll OK
Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20240422112246.83812-1-philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
34dca3f5 | 08-Apr-2024 |
Paolo Bonzini <pbonzini@redhat.com> |
tests/unit: match some unit tests to corresponding feature switches
Try not to test code that is not used by user mode emulation, or by the block layer, unless they are being compiled; and fix test-
tests/unit: match some unit tests to corresponding feature switches
Try not to test code that is not used by user mode emulation, or by the block layer, unless they are being compiled; and fix test-timed-average which was not compiled with --disable-system --enable-tools.
This is by no means complete, it only touches the more blatantly wrong cases.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20240408155330.522792-5-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
43199b13 | 25-Mar-2024 |
Peter Maydell <peter.maydell@linaro.org> |
tests/unit/test-throttle: Avoid unintended integer division
In test_compute_wait() we do double units = bkt.max / 10; which does an integer division and then assigns it to a double variable, and si
tests/unit/test-throttle: Avoid unintended integer division
In test_compute_wait() we do double units = bkt.max / 10; which does an integer division and then assigns it to a double variable, and similarly later on in the expression for an assertion.
Use 10.0 so that we do a floating point division and calculate the exact value, rather than doing an integer division.
Spotted by Coverity.
Resolves: Coverity CID 1432564 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20240312183810.557768-7-peter.maydell@linaro.org
show more ...
|
e921e00d | 25-Mar-2024 |
Peter Maydell <peter.maydell@linaro.org> |
tests/unit/socket-helpers: Don't close(-1)
In socket_check_afunix_support() we call socket(PF_UNIX, SOCK_STREAM, 0) to see if it works, but we call close() on the result whether it worked or not. On
tests/unit/socket-helpers: Don't close(-1)
In socket_check_afunix_support() we call socket(PF_UNIX, SOCK_STREAM, 0) to see if it works, but we call close() on the result whether it worked or not. Only close the fd if the socket() call succeeded. Spotted by Coverity.
Resolves: Coverity CID 1497481
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20240312183810.557768-3-peter.maydell@linaro.org
show more ...
|
c3b1aa1c | 11-Mar-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: report which ciphers are being skipped during tests
Since the ciphers can be dynamically disabled at runtime, when running unit tests it is helpful to report which ciphers we can skipped for
crypto: report which ciphers are being skipped during tests
Since the ciphers can be dynamically disabled at runtime, when running unit tests it is helpful to report which ciphers we can skipped for testing.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
48ca1cab | 11-Mar-2024 |
Daniel P. Berrangé <berrange@redhat.com> |
crypto: use error_abort for unexpected failures
This improves the error diagnosis from the unit test when a cipher is unexpected not available from
ERROR:../tests/unit/test-crypto-cipher.c:683:test
crypto: use error_abort for unexpected failures
This improves the error diagnosis from the unit test when a cipher is unexpected not available from
ERROR:../tests/unit/test-crypto-cipher.c:683:test_cipher: assertion failed: (err == NULL) Bail out! ERROR:../tests/unit/test-crypto-cipher.c:683:test_cipher: assertion failed: (err == NULL) Aborted (core dumped)
to
Unexpected error in qcrypto_cipher_ctx_new() at ../crypto/cipher-gcrypt.c.inc:262: ./build//tests/unit/test-crypto-cipher: Cannot initialize cipher: Invalid cipher algorithm Aborted (core dumped)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
55f7c6a5 | 12-Mar-2024 |
Peter Maydell <peter.maydell@linaro.org> |
tests: Raise timeouts for bufferiszero and crypto-tlscredsx509
On our gcov CI job, the bufferiszero and crypto-tlscredsx509 tests time out occasionally, making the job flaky. Double the timeout on t
tests: Raise timeouts for bufferiszero and crypto-tlscredsx509
On our gcov CI job, the bufferiszero and crypto-tlscredsx509 tests time out occasionally, making the job flaky. Double the timeout on these two tests.
Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2221 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20240312110815.116992-1-peter.maydell@linaro.org
show more ...
|
f853fa07 | 11-Mar-2024 |
Steve Sistare <steven.sistare@oracle.com> |
migration: remove migration.h references
Remove migration.h from files that no longer need it due to previous commits.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Link: https://lore.ke
migration: remove migration.h references
Remove migration.h from files that no longer need it due to previous commits.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Link: https://lore.kernel.org/r/1710179338-294359-2-git-send-email-steven.sistare@oracle.com Signed-off-by: Peter Xu <peterx@redhat.com>
show more ...
|
bb829cde | 08-Mar-2024 |
Zhao Liu <zhao1.liu@intel.com> |
tests/unit/test-smp-parse: Test "parameter=0" SMP configurations
The support for "parameter=0" SMP configurations is removed, and QEMU returns error for those cases.
So add the related test cases t
tests/unit/test-smp-parse: Test "parameter=0" SMP configurations
The support for "parameter=0" SMP configurations is removed, and QEMU returns error for those cases.
So add the related test cases to ensure parameters can't accept 0.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240308160148.3130837-14-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
71e44ee0 | 08-Mar-2024 |
Zhao Liu <zhao1.liu@intel.com> |
tests/unit/test-smp-parse: Test smp_props.has_clusters
The smp_props.has_clusters in MachineClass is not a user configured field, and it indicates if user specifies "clusters" in -smp.
After -smp p
tests/unit/test-smp-parse: Test smp_props.has_clusters
The smp_props.has_clusters in MachineClass is not a user configured field, and it indicates if user specifies "clusters" in -smp.
After -smp parsing, other module could aware if the cluster level is configured by user. This is used when the machine has only 1 cluster since there's only 1 cluster by default.
Add the check to cover this field.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Tested-by: Xiaoling Song <xiaoling.song@intel.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240308160148.3130837-13-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
ef88e1e8 | 08-Mar-2024 |
Zhao Liu <zhao1.liu@intel.com> |
tests/unit/test-smp-parse: Test the full 7-levels topology hierarchy
Currently, -smp supports up to 7-levels topology hierarchy: -drawers/books/sockets/dies/clusters/cores/threads.
Though no mach
tests/unit/test-smp-parse: Test the full 7-levels topology hierarchy
Currently, -smp supports up to 7-levels topology hierarchy: -drawers/books/sockets/dies/clusters/cores/threads.
Though no machine supports all these 7 levels yet, these 7 levels have the strict containment relationship and together form the generic CPU topology representation of QEMU.
Also, note that the maxcpus is calculated by multiplying all 7 levels:
maxcpus = drawers * books * sockets * dies * clusters * cores * threads.
To cover this code path, it is necessary to test the full topology case (with all 7 levels). This also helps to avoid introducing new issues by further expanding the CPU topology in the future.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Tested-by: Xiaoling Song <xiaoling.song@intel.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240308160148.3130837-12-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
3f90fb08 | 08-Mar-2024 |
Zhao Liu <zhao1.liu@intel.com> |
tests/unit/test-smp-parse: Test "drawers" and "books" combination case
Since s390 machine supports both "drawers" and "books" in -smp, add the "drawers" and "books" combination test case to match th
tests/unit/test-smp-parse: Test "drawers" and "books" combination case
Since s390 machine supports both "drawers" and "books" in -smp, add the "drawers" and "books" combination test case to match the actual topology usage scenario.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Tested-by: Xiaoling Song <xiaoling.song@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240308160148.3130837-11-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
5a4c4148 | 08-Mar-2024 |
Zhao Liu <zhao1.liu@intel.com> |
tests/unit/test-smp-parse: Test "drawers" parameter in -smp
Although drawer was introduced to -smp along with book by s390 machine, as a general topology level in QEMU that may be reused by other ar
tests/unit/test-smp-parse: Test "drawers" parameter in -smp
Although drawer was introduced to -smp along with book by s390 machine, as a general topology level in QEMU that may be reused by other arches in the future, it is desirable to cover this parameter's parsing in a separate case.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Tested-by: Xiaoling Song <xiaoling.song@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240308160148.3130837-10-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
f0fe1cd8 | 08-Mar-2024 |
Zhao Liu <zhao1.liu@intel.com> |
tests/unit/test-smp-parse: Test "books" parameter in -smp
Although book was introduced to -smp along with drawer by s390 machine, as a general topology level in QEMU that may be reused by other arch
tests/unit/test-smp-parse: Test "books" parameter in -smp
Although book was introduced to -smp along with drawer by s390 machine, as a general topology level in QEMU that may be reused by other arches in the future, it is desirable to cover this parameter's parsing in a separate case.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Tested-by: Xiaoling Song <xiaoling.song@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240308160148.3130837-9-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
dc583442 | 08-Mar-2024 |
Zhao Liu <zhao1.liu@intel.com> |
tests/unit/test-smp-parse: Make test cases aware of the book/drawer
Currently, -smp supports 2 more new levels: book and drawer.
It is necessary to consider the effects of book and drawer in the te
tests/unit/test-smp-parse: Make test cases aware of the book/drawer
Currently, -smp supports 2 more new levels: book and drawer.
It is necessary to consider the effects of book and drawer in the test cases to ensure that the calculations are correct. This is also the preparation to add new book and drawer test cases.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Tested-by: Xiaoling Song <xiaoling.song@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240308160148.3130837-8-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
f4e65d64 | 08-Mar-2024 |
Zhao Liu <zhao1.liu@intel.com> |
tests/unit/test-smp-parse: Bump max_cpus to 4096
The q35 machine is trying to support up to 4096 vCPUs [1], so it's necessary to bump max_cpus in test-smp-parse to 4096 to cover the topological need
tests/unit/test-smp-parse: Bump max_cpus to 4096
The q35 machine is trying to support up to 4096 vCPUs [1], so it's necessary to bump max_cpus in test-smp-parse to 4096 to cover the topological needs of future machines.
[1]: https://lore.kernel.org/qemu-devel/20240228143351.3967-1-anisinha@redhat.com/
Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Tested-by: Xiaoling Song <xiaoling.song@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240308160148.3130837-7-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
803f9714 | 08-Mar-2024 |
Zhao Liu <zhao1.liu@intel.com> |
tests/unit/test-smp-parse: Use CPU number macros in invalid topology case
Use MAX_CPUS/MIN_CPUS macros in invalid topology case. This gives us the flexibility to change the maximum and minimum CPU l
tests/unit/test-smp-parse: Use CPU number macros in invalid topology case
Use MAX_CPUS/MIN_CPUS macros in invalid topology case. This gives us the flexibility to change the maximum and minimum CPU limits.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Tested-by: Xiaoling Song <xiaoling.song@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240308160148.3130837-6-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
a4f93860 | 08-Mar-2024 |
Zhao Liu <zhao1.liu@intel.com> |
tests/unit/test-smp-parse: Drop the unsupported "dies=1" case
Unsupported "parameter=1" SMP configurations is marked as deprecated, so drop the related test case.
Signed-off-by: Zhao Liu <zhao1.liu
tests/unit/test-smp-parse: Drop the unsupported "dies=1" case
Unsupported "parameter=1" SMP configurations is marked as deprecated, so drop the related test case.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240308160148.3130837-5-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
f0cb6828 | 26-Feb-2024 |
Thomas Huth <thuth@redhat.com> |
tests/unit/test-util-sockets: Remove temporary file after test
test-util-sockets leaves the temporary socket files around in the temporary files folder. Let's better remove them at the end of the te
tests/unit/test-util-sockets: Remove temporary file after test
test-util-sockets leaves the temporary socket files around in the temporary files folder. Let's better remove them at the end of the testing.
Fixes: 4d3a329af5 ("tests/util-sockets: add abstract unix socket cases") Message-ID: <20240226082728.249753-1-thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
f396da77 | 03-Feb-2024 |
Markus Armbruster <armbru@redhat.com> |
tests/unit/test-char: Fix qemu_socket(), make_udp_socket() check
qemu_socket() and make_udp_socket() return a file descriptor on success, -1 on failure. The check misinterprets 0 as failure. Fix t
tests/unit/test-char: Fix qemu_socket(), make_udp_socket() check
qemu_socket() and make_udp_socket() return a file descriptor on success, -1 on failure. The check misinterprets 0 as failure. Fix that.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20240203080228.2766159-3-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
show more ...
|
a58c439a | 03-Feb-2024 |
Markus Armbruster <armbru@redhat.com> |
chardev/parallel: Don't close stdin on inappropriate device
The __linux__ version of qemu_chr_open_pp_fd() tries to claim the parport device with a PPCLAIM ioctl(). On success, it stores the file d
chardev/parallel: Don't close stdin on inappropriate device
The __linux__ version of qemu_chr_open_pp_fd() tries to claim the parport device with a PPCLAIM ioctl(). On success, it stores the file descriptor in the chardev object, and returns success. On failure, it closes the file descriptor, and returns failure.
chardev_new() then passes the Chardev to object_unref(). This duly calls char_parallel_finalize(), which closes the file descriptor stored in the chardev object. Since qemu_chr_open_pp_fd() didn't store it, it's still zero, so this closes standard input. Ooopsie.
To demonstate, add a unit test. With the bug above unfixed, running this test closes standard input. char_hotswap_test() happens to run next. It opens a socket, duly gets file descriptor 0, and since it tests for success with > 0 instead of >= 0, it fails.
The new unit test needs to be conditional exactly like the chardev it tests. Since the condition is rather complicated, steal the solution from the serial chardev: define HAVE_CHARDEV_PARALLEL in qemu/osdep.h. This also permits simplifying chardev/meson.build a bit.
The bug fix is easy enough: store the file descriptor, and leave closing it to char_parallel_finalize().
The next commit will fix char_hotswap_test()'s test for success.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20240203080228.2766159-2-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Test fixed up for BSDs, indentation fixed up, commit message improved]
show more ...
|
d74523a3 | 30-Jan-2024 |
Hyman Huang <yong.huang@smartx.com> |
crypto: Modify the qcrypto_block_create to support creation flags
Expand the signature of qcrypto_block_create to enable the formation of LUKS volumes with detachable headers. To accomplish that, in
crypto: Modify the qcrypto_block_create to support creation flags
Expand the signature of qcrypto_block_create to enable the formation of LUKS volumes with detachable headers. To accomplish that, introduce QCryptoBlockCreateFlags to instruct the creation process to set the payload_offset_sector to 0.
Signed-off-by: Hyman Huang <yong.huang@smartx.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
52ed9f45 | 07-Dec-2023 |
Hyman Huang <yong.huang@smartx.com> |
crypto: Introduce SM4 symmetric cipher algorithm
Introduce the SM4 cipher algorithms (OSCCA GB/T 32907-2016).
SM4 (GBT.32907-2016) is a cryptographic standard issued by the Organization of State Co
crypto: Introduce SM4 symmetric cipher algorithm
Introduce the SM4 cipher algorithms (OSCCA GB/T 32907-2016).
SM4 (GBT.32907-2016) is a cryptographic standard issued by the Organization of State Commercial Administration of China (OSCCA) as an authorized cryptographic algorithms for the use within China.
Detect the SM4 cipher algorithms and enable the feature silently if it is available.
Signed-off-by: Hyman Huang <yong.huang@smartx.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
3faebbcd | 06-Feb-2024 |
Ilya Leoshkevich <iii@linux.ibm.com> |
test-util-filemonitor: Adapt to the FreeBSD inotify rename semantics
Unlike on Linux, on FreeBSD renaming a file when the destination already exists results in an IN_DELETE event for that existing f
test-util-filemonitor: Adapt to the FreeBSD inotify rename semantics
Unlike on Linux, on FreeBSD renaming a file when the destination already exists results in an IN_DELETE event for that existing file:
$ FILEMONITOR_DEBUG=1 build/tests/unit/test-util-filemonitor Rename /tmp/test-util-filemonitor-K13LI2/fish/one.txt -> /tmp/test-util-filemonitor-K13LI2/two.txt Event id=200000000 event=2 file=one.txt Queue event id 200000000 event 2 file one.txt Queue event id 100000000 event 2 file two.txt Queue event id 100000002 event 2 file two.txt Queue event id 100000000 event 0 file two.txt Queue event id 100000002 event 0 file two.txt Event id=100000000 event=0 file=two.txt Expected event 0 but got 2
This difference in behavior is not expected to break the real users, so teach the test to accept it.
Suggested-by: "Daniel P. Berrange" <berrange@redhat.com> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-ID: <20240206002344.12372-4-iii@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
8c72e19b | 03-Jan-2024 |
Samuel Tardieu <sam@rfc1149.net> |
tests/unit/test-qga: do not qualify executable paths
guest-exec invocation does not need the full path of the executable to execute. Using only the command names ensures correct execution of the tes
tests/unit/test-qga: do not qualify executable paths
guest-exec invocation does not need the full path of the executable to execute. Using only the command names ensures correct execution of the test on systems not adhering to the FHS.
Signed-off-by: Samuel Tardieu <sam@rfc1149.net> Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: "Daniel P. Berrangé" <berrange@redhat.com> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
show more ...
|