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