tstVDIo.vd revision bb484afafb695b91be903f715d49d8c01426da27
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync/* $Id$ */
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync/**
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync * Storage: Simple I/O testing for most backends.
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync */
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync/*
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync * Copyright (C) 2011-2013 Oracle Corporation
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync *
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync * available from http://www.virtualbox.org. This file is free software;
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync * you can redistribute it and/or modify it under the terms of the GNU
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync * General Public License (GPL) as published by the Free Software
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync */
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsyncvoid tstIo(string strMessage, string strBackend)
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync{
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync print(strMessage);
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync createdisk("test", true /* fVerify */);
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync create("test", "base", "tst.disk", "dynamic", strBackend, 200M, false /* fIgnoreFlush */);
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync io("test", true, 32, "seq", 64K, 0, 200M, 200M, 100, "none");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync io("test", false, 1, "seq", 64K, 0, 200M, 200M, 100, "none");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync io("test", true, 32, "seq", 64K, 0, 200M, 200M, 0, "none");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync io("test", false, 1, "seq", 64K, 0, 200M, 200M, 0, "none");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync create("test", "diff", "tst2.disk", "dynamic", strBackend, 200M, false /* fIgnoreFlush */);
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync io("test", true, 32, "rnd", 64K, 0, 200M, 200M, 50, "none");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync io("test", false, 1, "rnd", 64K, 0, 200M, 200M, 50, "none");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync create("test", "diff", "tst3.disk", "dynamic", strBackend, 200M, false /* fIgnoreFlush */);
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync io("test", true, 32, "rnd", 64K, 0, 200M, 200M, 50, "none");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync io("test", false, 1, "rnd", 64K, 0, 200M, 200M, 50, "none");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync close("test", "single", true /* fDelete */);
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync close("test", "single", true /* fDelete */);
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync close("test", "single", true /* fDelete */);
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync destroydisk("test");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync}
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync
bb484afafb695b91be903f715d49d8c01426da27vboxsyncvoid tstIoUnaligned(string strMessage, string strBackend)
bb484afafb695b91be903f715d49d8c01426da27vboxsync{
bb484afafb695b91be903f715d49d8c01426da27vboxsync print(strMessage);
bb484afafb695b91be903f715d49d8c01426da27vboxsync createdisk("test", true);
bb484afafb695b91be903f715d49d8c01426da27vboxsync create("test", "base", "tst.disk", "dynamic", strBackend, 2G, false);
bb484afafb695b91be903f715d49d8c01426da27vboxsync io("test", false, 1, "seq", 512, 3584, 4096, 512, 100, "none");
bb484afafb695b91be903f715d49d8c01426da27vboxsync io("test", false, 1, "seq", 512, 3584, 4096, 512, 0, "none");
bb484afafb695b91be903f715d49d8c01426da27vboxsync destroydisk("test");
bb484afafb695b91be903f715d49d8c01426da27vboxsync}
bb484afafb695b91be903f715d49d8c01426da27vboxsync
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsyncvoid main()
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync{
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync /* Init I/O RNG for generating random data for writes */
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync iorngcreate(10M, "manual", 1234567890);
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync tstIo("Testing VDI", "VDI");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync tstIo("Testing VMDK", "VMDK");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync tstIo("Testing VHD", "VHD");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync tstIo("Testing Parallels", "Parallels");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync tstIo("Testing QED", "QED");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync tstIo("Testing QCOW", "QCOW");
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync iorngdestroy();
1839eb6c2f3526b276ac2dcf3deae74f6ef8af44vboxsync}
6334484843d504beb16631b2a5fcd01e50b88b9bvboxsync