[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/10] qtest/ahci: Add simple flush test
From: |
John Snow |
Subject: |
[Qemu-devel] [PULL 04/10] qtest/ahci: Add simple flush test |
Date: |
Tue, 28 Apr 2015 19:25:31 -0400 |
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden
---
tests/ahci-test.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/tests/ahci-test.c b/tests/ahci-test.c
index 6686242..4a5c788 100644
--- a/tests/ahci-test.c
+++ b/tests/ahci-test.c
@@ -797,6 +797,29 @@ static void ahci_test_io_rw_simple(AHCIQState *ahci,
unsigned bufsize,
g_free(rx);
}
+static void ahci_test_nondata(AHCIQState *ahci, uint8_t ide_cmd)
+{
+ uint8_t px;
+ AHCICommand *cmd;
+
+ /* Sanitize */
+ px = ahci_port_select(ahci);
+ ahci_port_clear(ahci, px);
+
+ /* Issue Command */
+ cmd = ahci_command_create(ide_cmd);
+ ahci_command_commit(ahci, cmd, px);
+ ahci_command_issue(ahci, cmd);
+ ahci_command_verify(ahci, cmd);
+ ahci_command_free(cmd);
+}
+
+static void ahci_test_flush(AHCIQState *ahci)
+{
+ ahci_test_nondata(ahci, CMD_FLUSH_CACHE);
+}
+
+
/******************************************************************************/
/* Test Interfaces
*/
/******************************************************************************/
@@ -931,6 +954,15 @@ static void test_dma_fragmented(void)
g_free(tx);
}
+static void test_flush(void)
+{
+ AHCIQState *ahci;
+
+ ahci = ahci_boot_and_enable();
+ ahci_test_flush(ahci);
+ ahci_shutdown(ahci);
+}
+
/******************************************************************************/
/* AHCI I/O Test Matrix Definitions
*/
@@ -1171,6 +1203,8 @@ int main(int argc, char **argv)
qtest_add_func("/ahci/io/dma/lba28/fragmented", test_dma_fragmented);
+ qtest_add_func("/ahci/flush/simple", test_flush);
+
ret = g_test_run();
/* Cleanup */
--
2.1.0
- [Qemu-devel] [PULL 00/10] Ide patches, John Snow, 2015/04/28
- [Qemu-devel] [PULL 01/10] fdc: remove sparc sun4m mutations, John Snow, 2015/04/28
- [Qemu-devel] [PULL 07/10] libqtest: add qmp_async, John Snow, 2015/04/28
- [Qemu-devel] [PULL 04/10] qtest/ahci: Add simple flush test,
John Snow <=
- [Qemu-devel] [PULL 02/10] qtest/ahci: add qcow2 support to ahci-test, John Snow, 2015/04/28
- [Qemu-devel] [PULL 06/10] libqtest: add qmp_eventwait, John Snow, 2015/04/28
- [Qemu-devel] [PULL 05/10] qtest/ahci: Allow override of default CLI options, John Snow, 2015/04/28
- [Qemu-devel] [PULL 03/10] qtest/ahci: test different disk sectors, John Snow, 2015/04/28
- [Qemu-devel] [PULL 08/10] libqos: add blkdebug_prepare_script, John Snow, 2015/04/28
- [Qemu-devel] [PULL 09/10] qtest/ahci: add flush retry test, John Snow, 2015/04/28
- [Qemu-devel] [PULL 10/10] qtest: Add assertion that required environment variable is set, John Snow, 2015/04/28
- Re: [Qemu-devel] [PULL 00/10] Ide patches, Peter Maydell, 2015/04/30