diff options
| author | Peter Maydell | 2017-06-29 18:37:11 +0200 |
|---|---|---|
| committer | Peter Maydell | 2017-06-29 18:37:11 +0200 |
| commit | c5eb5846d2d207bbde7f4b665d9ff90b92c8adff (patch) | |
| tree | 0c6c05f44eae0cca3dae76962669e524a3d5125f /tests | |
| parent | Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging (diff) | |
| parent | Add chardev-send-break monitor command (diff) | |
| download | qemu-c5eb5846d2d207bbde7f4b665d9ff90b92c8adff.tar.gz qemu-c5eb5846d2d207bbde7f4b665d9ff90b92c8adff.tar.xz qemu-c5eb5846d2d207bbde7f4b665d9ff90b92c8adff.zip | |
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20170629' into staging
HMP pull 2017-06-29
# gpg: Signature made Thu 29 Jun 2017 17:27:55 BST
# gpg: using RSA key 0x0516331EBC5BFDE7
# gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7
* remotes/dgilbert/tags/pull-hmp-20170629:
Add chardev-send-break monitor command
monitor: Add -a (all) option to info registers
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-char.c | 12 | ||||
| -rw-r--r-- | tests/test-hmp.c | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/tests/test-char.c b/tests/test-char.c index 9e361c8d09..87c724c5c2 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -53,7 +53,9 @@ static void fe_event(void *opaque, int event) FeHandler *h = opaque; h->last_event = event; - quit = true; + if (event != CHR_EVENT_BREAK) { + quit = true; + } } #ifdef CONFIG_HAS_GLIB_SUBPROCESS_TESTS @@ -517,7 +519,7 @@ static void char_file_test(void) file.in = fifo; file.has_in = true; - chr = qemu_chardev_new(NULL, TYPE_CHARDEV_FILE, &backend, + chr = qemu_chardev_new("label-file", TYPE_CHARDEV_FILE, &backend, &error_abort); qemu_chr_fe_init(&be, chr, &error_abort); @@ -527,6 +529,12 @@ static void char_file_test(void) fe_event, &fe, NULL, true); + g_assert_cmpint(fe.last_event, !=, CHR_EVENT_BREAK); + qmp_chardev_send_break("label-foo", NULL); + g_assert_cmpint(fe.last_event, !=, CHR_EVENT_BREAK); + qmp_chardev_send_break("label-file", NULL); + g_assert_cmpint(fe.last_event, ==, CHR_EVENT_BREAK); + main_loop(); close(fd); diff --git a/tests/test-hmp.c b/tests/test-hmp.c index 99e35ec15a..6dfa0c36e2 100644 --- a/tests/test-hmp.c +++ b/tests/test-hmp.c @@ -22,6 +22,7 @@ static int verbose; static const char *hmp_cmds[] = { "boot_set ndc", "chardev-add null,id=testchardev1", + "chardev-send-break testchardev2", "chardev-remove testchardev1", "commit all", "cpu-add 1", |
