Skip to content

Commit

Permalink
qtest/ide: Test flush / retry for ISA and PCI
Browse files Browse the repository at this point in the history
This patch adds tests for werror and rerror functionality
for the PCI and ISA ide buses.

Tests for the AHCI device are to be included at a later
date after requisite patches have been merged upstream
to support needed functionality by the tests.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1424708286-16483-18-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
jnsnow authored and kevmw committed Mar 10, 2015
1 parent c27c73a commit baca2b9
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tests/ide-test.c
Expand Up @@ -118,7 +118,6 @@ static void ide_test_start(const char *cmdline_fmt, ...)
va_end(ap);

qtest_start(cmdline);
qtest_irq_intercept_in(global_qtest, "ioapic");
guest_malloc = pc_alloc_init();

g_free(cmdline);
Expand Down Expand Up @@ -388,6 +387,7 @@ static void test_bmdma_setup(void)
"-drive file=%s,if=ide,serial=%s,cache=writeback,format=raw "
"-global ide-hd.ver=%s",
tmp_path, "testdisk", "version");
qtest_irq_intercept_in(global_qtest, "ioapic");
}

static void test_bmdma_teardown(void)
Expand Down Expand Up @@ -516,7 +516,7 @@ static void prepare_blkdebug_script(const char *debug_fn, const char *event)
g_assert(ret == 0);
}

static void test_retry_flush(void)
static void test_retry_flush(const char *machine)
{
uint8_t data;
const char *s;
Expand Down Expand Up @@ -580,6 +580,16 @@ static void test_flush_nodev(void)
ide_test_quit();
}

static void test_pci_retry_flush(const char *machine)
{
test_retry_flush("pc");
}

static void test_isa_retry_flush(const char *machine)
{
test_retry_flush("isapc");
}

int main(int argc, char **argv)
{
const char *arch = qtest_get_arch();
Expand Down Expand Up @@ -617,9 +627,9 @@ int main(int argc, char **argv)
qtest_add_func("/ide/bmdma/teardown", test_bmdma_teardown);

qtest_add_func("/ide/flush", test_flush);
qtest_add_func("/ide/flush_nodev", test_flush_nodev);

qtest_add_func("/ide/retry/flush", test_retry_flush);
qtest_add_func("/ide/flush/nodev", test_flush_nodev);
qtest_add_func("/ide/flush/retry_pci", test_pci_retry_flush);
qtest_add_func("/ide/flush/retry_isa", test_isa_retry_flush);

ret = g_test_run();

Expand Down

0 comments on commit baca2b9

Please sign in to comment.