summaryrefslogtreecommitdiffstats
path: root/src/VBox/Storage/testcase/tstVDMultBackends.vd
blob: 51625193e07c2c941d602ef9d9ad418c54290fa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* $Id: tstVDMultBackends.vd $ */
/**
 * Storage: Simple I/O test with different backends in one chain.
 */

/*
 * Copyright (C) 2011-2023 Oracle and/or its affiliates.
 *
 * This file is part of VirtualBox base platform packages, as
 * available from https://www.virtualbox.org.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation, in version 3 of the
 * License.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <https://www.gnu.org/licenses>.
 *
 * SPDX-License-Identifier: GPL-3.0-only
 */

void tstIo(string strMessage, string strBackend)
{
    print(strMessage);
    createdisk("test", true /* fVerify */);
    create("test", "base", "tst.disk", "dynamic", strBackend, 2G, false /* fIgnoreFlush */, false);
    io("test", true, 32, "seq", 64K, 0, 2G, 200M, 100, "none");
    io("test", false, 1, "seq", 64K, 0, 2G, 200M, 100, "none");
    io("test", true, 32, "seq", 64K, 0, 2G, 200M,   0, "none");
    io("test", false, 1, "seq", 64K, 0, 2G, 200M,   0, "none");
    create("test", "diff", "tst2.disk", "dynamic", "VMDK", 2G, false /* fIgnoreFlush */, false);
    io("test", true, 32, "rnd", 64K, 0, 2G, 200M,  50, "none");
    io("test", false, 1, "rnd", 64K, 0, 2G, 200M,  50, "none");
    create("test", "diff", "tst3.disk", "dynamic", "VMDK", 2G, false /* fIgnoreFlush */, false);
    io("test", true, 32, "rnd", 64K, 0, 2G, 200M,  50, "none");
    io("test", false, 1, "rnd", 64K, 0, 2G, 200M,  50, "none");
    create("test", "diff", "tst4.disk", "dynamic", "VMDK", 2G, false /* fIgnoreFlush */, false);
    io("test", true, 32, "rnd", 64K, 0, 2G, 200M,  50, "none");
    io("test", true, 32, "rnd", 64K, 0, 2G, 200M,   0, "none");

    create("test", "diff", "tst5.disk", "dynamic", "VMDK", 2G, false /* fIgnoreFlush */, false);
    io("test", true, 32, "rnd", 64K, 0, 2G, 200M,  50, "none");
    io("test", true, 32, "rnd", 64K, 0, 2G, 200M,   0, "none");

    create("test", "diff", "tst6.disk", "dynamic", "VMDK", 2G, false /* fIgnoreFlush */, false);
    io("test", true, 32, "rnd", 64K, 0, 2G, 200M,  50, "none");
    io("test", true, 32, "rnd", 64K, 0, 2G, 200M,   0, "none");

    close("test", "single", true /* fDelete */);
    close("test", "single", true /* fDelete */);
    close("test", "single", true /* fDelete */);
    destroydisk("test");
}

void main()
{
    /* Init I/O RNG for generating random data for writes */
    iorngcreate(10M, "manual", 1234567890);

    tstIo("Testing VDI", "VDI");

    iorngdestroy();
}