crosvm/tests
Matt Delco ce03437d56 tests: avoid internal error in pause test
When running plugin tests it's not uncommon to see:

vcpu 0 has internal error

Though the tests don't actually fail on this problem. This seems
to occur as a side effect of the plugin_vcpu_pause.c calling
crosvm_destory_memory() before the test VM has actually finished
running.

The main thread will call read() on the 'kill' eventfd 5 times for:
init, pause, unpause, unpause, kill

The vcpu thread will call write() on the eventfd up to 8 times:

init, pause #1, unpause #1, pause #2, unpause #2, pause #3,
unpause #3, kill

The main thread's third pause request might occur before the second
pause request has been processed, in which case the vcpu thread will
only be paused twice (thus there will only be 6 calls to write()).
Given the unpredictable # of events I've opted to split the
init/pause/unpause events to a separate eventfd and keep the 'kill'
eventfd solely for its intended purpose.

BUG=None
TEST=ran ./build_test several times and observed no failures in the
pause plugin test.

Change-Id: Ie0817a4419ae6199fcc5c53496360b2bd81556e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2012788
Reviewed-by: Matt Delco <delco@chromium.org>
Commit-Queue: Matt Delco <delco@chromium.org>
Tested-by: Matt Delco <delco@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-02-19 23:05:34 +00:00
..
boot.rs tests: test to see if crosvm can boot a kernel 2019-10-31 06:01:58 +00:00
mini_plugin_template.c add support for accessing debug registers in the plugin process 2018-02-12 22:42:35 -08:00
plugin.policy crosvm: pre-cache answers to plugin get calls 2019-10-31 06:18:09 +00:00
plugin_adder.c allow non-dirty log memory regions from the plugin process 2018-02-12 22:42:37 -08:00
plugin_async_write.c crosvm: add plugin API for async writes 2019-11-06 23:01:15 +00:00
plugin_dirty_log.c allow non-dirty log memory regions from the plugin process 2018-02-12 22:42:37 -08:00
plugin_extensions.c allow plugin to query for KVM extensions 2018-02-12 22:42:40 -08:00
plugin_hint.c crosvm: pre-cache answers to plugin get calls 2019-10-31 06:18:09 +00:00
plugin_ioevent.c allow non-dirty log memory regions from the plugin process 2018-02-12 22:42:37 -08:00
plugin_irqfd.c allow non-dirty log memory regions from the plugin process 2018-02-12 22:42:37 -08:00
plugin_msr_index_list.c plugin: allow retrieving list of supported MSRs 2018-07-31 16:37:06 -07:00
plugin_net_config.c plugin: add missing #include <string.h> in test 2019-10-22 00:09:26 +00:00
plugin_supported_cpuid.c allow plugin to query KVM for supported/emulated CPUIDs 2018-02-28 21:30:20 -08:00
plugin_vcpu_pause.c tests: avoid internal error in pause test 2020-02-19 23:05:34 +00:00
plugin_vm_state.c plugin: allow retrieving and setting VM clock 2019-01-22 21:05:18 -08:00
plugins.rs crosvm: add plugin API for async writes 2019-11-06 23:01:15 +00:00
vfs_crypto.c devices: fs: Support fs crypto ioctls 2019-12-10 03:10:57 +00:00