VirtualBox

Changeset 44943 in vbox for trunk/src/VBox/Storage/testcase


Ignore:
Timestamp:
Mar 6, 2013 11:07:00 PM (12 years ago)
Author:
vboxsync
Message:

Storage/testcase: Convert to new scripting language

Location:
trunk/src/VBox/Storage/testcase
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/testcase/tstVDCompact.vd

    r36637 r44943  
    1 # $Id$
    2 #
    3 # Storage: Testcase for compacting disks.
    4 #
     1/* $Id$ */
     2/**
     3 * Storage: Testcase for compacting disks.
     4 */
    55
    6 #
    7 # Copyright (C) 2011 Oracle Corporation
    8 #
    9 # This file is part of VirtualBox Open Source Edition (OSE), as
    10 # available from http://www.virtualbox.org. This file is free software;
    11 # you can redistribute it and/or modify it under the terms of the GNU
    12 # General Public License (GPL) as published by the Free Software
    13 # Foundation, in version 2 as it comes in the "COPYING" file of the
    14 # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    15 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    16 #
     6/*
     7 * Copyright (C) 2011 Oracle Corporation
     8 *
     9 * This file is part of VirtualBox Open Source Edition (OSE), as
     10 * available from http://www.virtualbox.org. This file is free software;
     11 * you can redistribute it and/or modify it under the terms of the GNU
     12 * General Public License (GPL) as published by the Free Software
     13 * Foundation, in version 2 as it comes in the "COPYING" file of the
     14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     16 */
    1717
    18 # Init I/O RNG for generating random data for writes
    19 iorngcreate size=10M mode=manual seed=1234567890
     18void tstCompact(string strMsg, string strBackend)
     19{
     20    print(strMsg);
    2021
    21 # Create zero pattern
    22 iopatterncreatefromnumber name=zero size=1M pattern=0
     22    /* Create disk containers, read verification is on. */
     23    createdisk("disk", true);
     24    create("disk", "base", "tstCompact.disk", "dynamic", strBackend, 200M, false);
    2325
    24 print msg=Testing_VDI
    25 # Create disk containers, read verification is on.
    26 createdisk name=disk verify=yes
    27 # Create the disk.
    28 create disk=disk mode=base name=tstCompact.vdi type=dynamic backend=VDI size=200M
    29 # Fill the disk with random data
    30 io disk=disk async=no mode=seq blocksize=64k off=0-200M size=200M writes=100
    31 # Read the data to verify it once.
    32 io disk=disk async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    33 # Fill a part with 0's
    34 io disk=disk async=no mode=seq blocksize=64k off=100M-150M size=50M writes=100 pattern=zero
    35 # Now compact
    36 compact disk=disk image=0
    37 # Read again to verify that the content hasn't changed
    38 io disk=disk async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    39 # Fill everything with 0
    40 io disk=disk async=no mode=seq blocksize=64k off=0M-200M size=200M writes=100 pattern=zero
    41 # Now compact
    42 compact disk=disk image=0
    43 # Read again to verify that the content hasn't changed
    44 io disk=disk async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    45 # Cleanup
    46 close disk=disk mode=single delete=yes
    47 destroydisk name=disk
     26    /* Fill the disk with random data. */
     27    io("disk", false, 1, "seq", 64K, 0, 200M, 200M, 100, "none");
     28    /* Read the data to verify it once. */
     29    io("disk", false, 1, "seq", 64K, 0, 200M, 200M,   0, "none");
     30    /* Fill a part with 0's. */
     31    io("disk", false, 1, "seq", 64K, 100M, 150M, 50M, 100, "zero");
    4832
    49 print msg=Testing_VHD
    50 # Create disk containers, read verification is on.
    51 createdisk name=disk verify=yes
    52 # Create the disk.
    53 create disk=disk mode=base name=tstCompact.vhd type=dynamic backend=VHD size=200M
    54 # Fill the disk with random data
    55 io disk=disk async=no mode=seq blocksize=64k off=0-200M size=200M writes=100
    56 # Read the data to verify it once.
    57 io disk=disk async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    58 # Fill a part with 0's
    59 io disk=disk async=no mode=seq blocksize=64k off=100M-150M size=50M writes=100 pattern=zero
    60 # Now compact
    61 compact disk=disk image=0
    62 # Read again to verify that the content hasn't changed
    63 io disk=disk async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    64 # Fill everything with 0
    65 io disk=disk async=no mode=seq blocksize=64k off=0M-200M size=200M writes=100 pattern=zero
    66 # Now compact
    67 compact disk=disk image=0
    68 # Read again to verify that the content hasn't changed
    69 io disk=disk async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    70 # Cleanup
    71 close disk=disk mode=single delete=yes
    72 destroydisk name=disk
     33    /* Now compact. */
     34    compact("disk", 0);
     35    /* Read again to verify that the content hasn't changed. */
     36    io("disk", false, 1, "seq", 64K, 0, 200M, 200M,   0, "none");
     37    /* Fill everything with 0. */
     38    io("disk", false, 1, "seq", 64K, 0, 200M, 200M, 100, "zero");
     39    /* Now compact again. */
     40    compact("disk", 0);
     41    /* Read again to verify that the content hasn't changed. */
     42    io("disk", false, 1, "seq", 64K, 0, 200M, 200M,   0, "none");
    7343
    74 # Destroy RNG and pattern
    75 iopatterndestroy name=zero
    76 iorngdestroy
     44    close("disk", "single", true);
     45    destroydisk("disk");
     46}
    7747
     48void main()
     49{
     50    /* Init I/O RNG for generating random data for writes. */
     51    iorngcreate(10M, "manual", 1234567890);
     52
     53    /* Create zero pattern */
     54    iopatterncreatefromnumber("zero", 1M, 0);
     55
     56    tstCompact("Testing VDI", "VDI");
     57    tstCompact("Testing VHD", "VHD");
     58
     59    /* Destroy RNG and pattern */
     60    iopatterndestroy("zero");
     61    iorngdestroy();
     62}
  • trunk/src/VBox/Storage/testcase/tstVDCopy.vd

    r38469 r44943  
    1 # $Id$
    2 #
    3 # Storage: Testcase for VDCopy with snapshots and optimizations.
    4 #
     1/* $Id$ */
     2/**
     3 * Storage: Testcase for VDCopy with snapshots and optimizations.
     4 */
    55
    6 #
    7 # Copyright (C) 2011 Oracle Corporation
    8 #
    9 # This file is part of VirtualBox Open Source Edition (OSE), as
    10 # available from http://www.virtualbox.org. This file is free software;
    11 # you can redistribute it and/or modify it under the terms of the GNU
    12 # General Public License (GPL) as published by the Free Software
    13 # Foundation, in version 2 as it comes in the "COPYING" file of the
    14 # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    15 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    16 #
     6/*
     7 * Copyright (C) 2011 Oracle Corporation
     8 *
     9 * This file is part of VirtualBox Open Source Edition (OSE), as
     10 * available from http://www.virtualbox.org. This file is free software;
     11 * you can redistribute it and/or modify it under the terms of the GNU
     12 * General Public License (GPL) as published by the Free Software
     13 * Foundation, in version 2 as it comes in the "COPYING" file of the
     14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     16 */
    1717
    18 # Init I/O RNG for generating random data for writes
    19 iorngcreate size=10M mode=manual seed=1234567890
     18void main()
     19{
     20    /* Init I/O RNG for generating random data for writes. */
     21    iorngcreate(10M, "manual", 1234567890);
    2022
    21 # Create source disk and fill data
    22 print msg=Creating_Source_Disk
    23     createdisk name=source verify=no
    24     create disk=source mode=base name=source_base.vdi type=dynamic backend=VDI size=1G
    25     io disk=source async=no mode=rnd blocksize=64k off=0-512M size=256M writes=100
     23    /* Create source disk and fill data. */
     24    print("Creating Source Disk");
     25    createdisk("source", false);
     26    create("source", "base", "source_base.vdi", "dynamic", "VDI", 1G, false);
     27    io("source", false, 1, "rnd", 64K, 0, 512M, 256M, 100, "none");
    2628
    27 # Create 1st snapshot
    28 print msg=Creating_First_Diff
    29     create disk=source mode=diff name=source_diff1.vdi type=dynamic backend=VDI size=1G
    30     io disk=source async=no mode=rnd blocksize=64k off=512M-1G size=256M writes=50
     29    print("Creating first diff");
     30    create("source", "diff", "source_diff1.vdi", "dynamic", "VDI", 1G, false);
     31    io("source", false, 1, "rnd", 64K, 512M, 1G, 256M, 50, "none");
    3132
    32 # Create 2nd snapshot
    33 print msg=Creating_Second_Diff
    34     create disk=source mode=diff name=source_diff2.vdi type=dynamic backend=VDI size=1G
    35     io disk=source async=no mode=rnd blocksize=1M off=0M-1G size=45M writes=100
     33    print("Creating second diff");
     34    create("source", "diff", "source_diff2.vdi", "dynamic", "VDI", 1G, false);
     35    io("source", false, 1, "rnd", 1M, 0, 1G, 45M, 100, "none");
    3636
    37 print msg=Creating_Third_Diff
    38     create disk=source mode=diff name=source_diff3.vdi type=dynamic backend=VDI size=1G
    39     io disk=source async=no mode=rnd blocksize=1M off=0M-1G size=45M writes=100
     37    print("Creating third diff");
     38    create("source", "diff", "source_diff3.vdi", "dynamic", "VDI", 1G, false);
     39    io("source", false, 1, "rnd", 1M, 0, 1G, 45M, 100, "none");
    4040
    41 print msg=Creating_Fourth_Diff
    42     create disk=source mode=diff name=source_diff4.vdi type=dynamic backend=VDI size=1G
    43     io disk=source async=no mode=rnd blocksize=1M off=0M-1G size=45M writes=100
     41    print("Creating fourth diff");
     42    create("source", "diff", "source_diff4.vdi", "dynamic", "VDI", 1G, false);
     43    io("source", false, 1, "rnd", 1M, 0, 1G, 45M, 100, "none");
    4444
    45 # Create destination disk
    46 print msg=Creating_Destination_Disk
    47     createdisk name=dest verify=no
     45    print("Creating destination disk");
     46    createdisk("dest", false);
    4847
    49 # Copy base image
    50 print msg=Copying_Base_Image
    51     copy diskfrom=source diskto=dest imagefrom=0 backend=VDI filename=dest_base.vdi
     48    print("Copying base image");
     49    copy("source", "dest", 0, "VDI", "dest_base.vdi", false, 0, 0xffffffff, 0xffffffff); /* Image content unknown */
    5250
    53 print msg=Copying_First_Diff_optimized
    54     copy diskfrom=source diskto=dest imagefrom=1 backend=VDI filename=dest_diff1.vdi fromsame=0 tosame=0
     51    print("Copying first diff optimized");
     52    copy("source", "dest", 1, "VDI", "dest_diff1.vdi", false, 0, 0, 0);
    5553
    56 print msg=Copying_Second_Diff_optimized
    57     copy diskfrom=source diskto=dest imagefrom=2 backend=VDI filename=dest_diff2.vdi fromsame=1 tosame=1
    58     copy diskfrom=source diskto=dest imagefrom=3 backend=VDI filename=dest_diff3.vdi fromsame=2 tosame=2
    59     copy diskfrom=source diskto=dest imagefrom=4 backend=VDI filename=dest_diff4.vdi fromsame=3 tosame=3
     54    print("Copying other diffs optimized");
     55    copy("source", "dest", 2, "VDI", "dest_diff1.vdi", false, 0, 1, 1);
     56    copy("source", "dest", 3, "VDI", "dest_diff1.vdi", false, 0, 2, 2);
     57    copy("source", "dest", 4, "VDI", "dest_diff1.vdi", false, 0, 3, 3);
    6058
    61 print msg=Comparing_Disks
    62     comparedisks disk1=source disk2=dest
     59    print("Comparing_Disks");
     60    comparedisks("source", "dest");
    6361
    64 printfilesize disk=source image=0
    65 printfilesize disk=source image=1
    66 printfilesize disk=source image=2
    67 printfilesize disk=source image=3
    68 printfilesize disk=source image=4
     62    printfilesize("source", 0);
     63    printfilesize("source", 1);
     64    printfilesize("source", 2);
     65    printfilesize("source", 3);
     66    printfilesize("source", 4);
    6967
    70 printfilesize disk=dest image=0
    71 printfilesize disk=dest image=1
    72 printfilesize disk=dest image=2
    73 printfilesize disk=dest image=3
    74 printfilesize disk=dest image=4
     68    printfilesize("dest", 0);
     69    printfilesize("dest", 1);
     70    printfilesize("dest", 2);
     71    printfilesize("dest", 3);
     72    printfilesize("dest", 4);
    7573
    76 # Cleanup
    77 print msg=Cleaning_up
    78     close disk=dest mode=single delete=yes
    79     close disk=dest mode=single delete=yes
    80     close disk=dest mode=single delete=yes
     74    print("Cleaning up");
     75    close("dest", "single", true);
     76    close("dest", "single", true);
     77    close("dest", "single", true);
    8178
    82     close disk=source mode=single delete=yes
    83     close disk=source mode=single delete=yes
    84     close disk=source mode=single delete=yes
    85     destroydisk name=source
    86     destroydisk name=dest
     79    close("source", "single", true);
     80    close("source", "single", true);
     81    close("source", "single", true);
     82    destroydisk("source");
     83    destroydisk("dest");
    8784
    88 iorngdestroy
    89 
     85    iorngdestroy();
     86}
  • trunk/src/VBox/Storage/testcase/tstVDDiscard.vd

    r39520 r44943  
    1 # $Id$
    2 #
    3 # Storage: Testcase for discarding data in a disk.
    4 #
     1/* $Id$ */
     2/**
     3 * Storage: Testcase for discarding data in a disk.
     4 */
    55
    6 #
    7 # Copyright (C) 2011 Oracle Corporation
    8 #
    9 # This file is part of VirtualBox Open Source Edition (OSE), as
    10 # available from http://www.virtualbox.org. This file is free software;
    11 # you can redistribute it and/or modify it under the terms of the GNU
    12 # General Public License (GPL) as published by the Free Software
    13 # Foundation, in version 2 as it comes in the "COPYING" file of the
    14 # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    15 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    16 #
     6/*
     7 * Copyright (C) 2011 Oracle Corporation
     8 *
     9 * This file is part of VirtualBox Open Source Edition (OSE), as
     10 * available from http://www.virtualbox.org. This file is free software;
     11 * you can redistribute it and/or modify it under the terms of the GNU
     12 * General Public License (GPL) as published by the Free Software
     13 * Foundation, in version 2 as it comes in the "COPYING" file of the
     14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     16 */
    1717
    18 # Init I/O RNG for generating random data for writes
    19 iorngcreate size=10M mode=manual seed=1234567890
     18void main()
     19{
     20    /* Init I/O RNG for generating random data for writes. */
     21    iorngcreate(10M, "manual", 1234567890);
    2022
    21 print msg=Testing_VDI
    22 # Create disk containers, read verification is on.
    23 createdisk name=disk verify=yes
    24 # Create the disk.
    25 create disk=disk mode=base name=tstCompact.vdi type=dynamic backend=VDI size=2G
    26 # Fill the disk with random data
    27 io disk=disk async=no mode=seq blocksize=64k off=0-2G size=2G writes=100
    28 # Read the data to verify it once.
    29 io disk=disk async=no mode=seq blocksize=64k off=0-2G size=2G writes=0
    30 close disk=disk mode=single delete=no
     23    print("Testing VDI");
    3124
    32 open disk=disk name=tstCompact.vdi backend=VDI async=yes discard=yes
    33 printfilesize disk=disk image=0
    34 discard async=yes disk=disk ranges=6,0M,512k,1M,512k,2M,512k,3M,512k,4M,512k,5M,512k
    35 discard async=yes disk=disk ranges=6,6M,512k,7M,512k,8M,512k,9M,512k,10M,512k,11M,512k
    36 discard async=yes disk=disk ranges=1,512k,512k
    37 printfilesize disk=disk image=0
     25    /* Create disk containers, read verification is on. */
     26    createdisk("disk", true /* fVerify */);
     27    /* Create the disk. */
     28    create("disk", "base", "tstCompact.vdi", "dynamic", "VDI", 2G, false /* fIgnoreFlush */);
     29    /* Fill the disk with random data */
     30    io("disk", false, 1, "seq", 64K, 0, 2G, 2G, 100, "none");
     31    /* Read the data to verify it once. */
     32    io("disk", false, 1, "seq", 64K, 0, 2G, 2G,   0, "none");
     33    close("disk", "single", false);
    3834
    39 print msg=Discard_whole_block
    40 discard async=yes disk=disk ranges=1,20M,1M
    41 printfilesize disk=disk image=0
     35    open("disk", "tstCompact.vdi", "VDI", true, false, false, true, false);
     36    printfilesize("disk", 0);
     37    discard("disk", true, "6,0M,512K,1M,512K,2M,512K,3M,512K,4M,512K,5M,512K");
     38    discard("disk", true, "6,6M,512K,7M,512K,8M,512K,9M,512K,10M,512K,11M,512K");
     39    discard("disk", true, "1,512K,512K");
     40    discard("disk", false, "1,1024K,64K");
     41    printfilesize("disk", 0);
    4242
    43 print msg=Split_Discard
    44 discard async=yes disk=disk ranges=1,21M,512k
    45 printfilesize disk=disk image=0
    46 discard async=yes disk=disk ranges=1,22016k,512k
    47 printfilesize disk=disk image=0
     43    print("Discard whole block");
     44    discard("disk", true, "1,20M,1M");
     45    printfilesize("disk", 0);
    4846
    49 # Cleanup
    50 close disk=disk mode=single delete=yes
    51 destroydisk name=disk
     47    print("Split Discard");
     48    discard("disk", true, "1,21M,512K");
     49    printfilesize("disk", 0);
     50    discard("disk", true, "1,22016K,512K");
     51    printfilesize("disk", 0);
    5252
    53 # Destroy RNG and pattern
    54 iorngdestroy
     53    /* Cleanup */
     54    close("disk", "single", true);
     55    destroydisk("disk");
    5556
     57    /* Destroy RNG and pattern */
     58    iorngdestroy();
     59}
  • trunk/src/VBox/Storage/testcase/tstVDIo.vd

    r44529 r44943  
    1 # $Id$
    2 #
    3 # Storage: Simple I/O testing for most backends.
    4 #
     1/* $Id$ */
     2/**
     3 * Storage: Simple I/O testing for most backends.
     4 */
    55
    6 #
    7 # Copyright (C) 2011-2013 Oracle Corporation
    8 #
    9 # This file is part of VirtualBox Open Source Edition (OSE), as
    10 # available from http://www.virtualbox.org. This file is free software;
    11 # you can redistribute it and/or modify it under the terms of the GNU
    12 # General Public License (GPL) as published by the Free Software
    13 # Foundation, in version 2 as it comes in the "COPYING" file of the
    14 # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    15 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    16 #
     6/*
     7 * Copyright (C) 2011-2013 Oracle Corporation
     8 *
     9 * This file is part of VirtualBox Open Source Edition (OSE), as
     10 * available from http://www.virtualbox.org. This file is free software;
     11 * you can redistribute it and/or modify it under the terms of the GNU
     12 * General Public License (GPL) as published by the Free Software
     13 * Foundation, in version 2 as it comes in the "COPYING" file of the
     14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     16 */
    1717
    18 # Init I/O RNG for generating random data for writes
    19 iorngcreate size=10M mode=manual seed=1234567890
     18void tstIo(string strMessage, string strBackend)
     19{
     20    print(strMessage);
     21    createdisk("test", true /* fVerify */);
     22    create("test", "base", "tst.disk", "dynamic", strBackend, 200M, false /* fIgnoreFlush */);
     23    io("test", true, 32, "seq", 64K, 0, 200M, 200M, 100, "none");
     24    io("test", false, 1, "seq", 64K, 0, 200M, 200M, 100, "none");
     25    io("test", true, 32, "seq", 64K, 0, 200M, 200M,   0, "none");
     26    io("test", false, 1, "seq", 64K, 0, 200M, 200M,   0, "none");
     27    create("test", "diff", "tst2.disk", "dynamic", strBackend, 200M, false /* fIgnoreFlush */);
     28    io("test", true, 32, "rnd", 64K, 0, 200M, 200M,  50, "none");
     29    io("test", false, 1, "rnd", 64K, 0, 200M, 200M,  50, "none");
     30    create("test", "diff", "tst3.disk", "dynamic", strBackend, 200M, false /* fIgnoreFlush */);
     31    io("test", true, 32, "rnd", 64K, 0, 200M, 200M,  50, "none");
     32    io("test", false, 1, "rnd", 64K, 0, 200M, 200M,  50, "none");
     33    close("test", "single", true /* fDelete */);
     34    close("test", "single", true /* fDelete */);
     35    close("test", "single", true /* fDelete */);
     36    destroydisk("test");
     37}
    2038
    21 # VMDK disk
    22 print msg=Testing_VMDK
    23 createdisk name=test verify=yes
    24 create disk=test mode=base name=tstShared.vmdk type=dynamic backend=VMDK size=200M
    25 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=100
    26 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=100
    27 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=0
    28 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    29 create disk=test mode=diff name=tstShared2.vmdk type=dynamic backend=VMDK size=200M
    30 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50
    31 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50
    32 create disk=test mode=diff name=tstShared3.vmdk type=dynamic backend=VMDK size=200M
    33 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50
    34 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50
    35 close disk=test mode=single delete=yes
    36 close disk=test mode=single delete=yes
    37 close disk=test mode=single delete=yes
    38 destroydisk name=test
     39void main()
     40{
     41    /* Init I/O RNG for generating random data for writes */
     42    iorngcreate(10M, "manual", 1234567890);
    3943
    40 # VDI disk
    41 print msg=Testing_VDI
    42 createdisk name=test verify=yes
    43 create disk=test mode=base name=tstShared.vdi type=dynamic backend=VDI size=200M
    44 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=100
    45 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=100
    46 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=0
    47 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    48 create disk=test mode=diff name=tstShared2.vdi type=dynamic backend=VDI size=200M
    49 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50
    50 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50
    51 create disk=test mode=diff name=tstShared3.vdi type=dynamic backend=VDI size=200M
    52 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50
    53 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50
    54 close disk=test mode=single delete=yes
    55 close disk=test mode=single delete=yes
    56 close disk=test mode=single delete=yes
    57 destroydisk name=test
     44    tstIo("Testing VDI", "VDI");
     45    tstIo("Testing VMDK", "VMDK");
     46    tstIo("Testing VHD", "VHD");
     47    tstIo("Testing Parallels", "Parallels");
     48    tstIo("Testing QED", "QED");
     49    tstIo("Testing QCOW", "QCOW");
    5850
    59 # VHD disk
    60 print msg=Testing_VHD
    61 createdisk name=test verify=yes
    62 create disk=test mode=base name=tstShared.vhd type=dynamic backend=VHD size=200M
    63 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=100
    64 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=100
    65 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=0
    66 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    67 create disk=test mode=diff name=tstShared2.vhd type=dynamic backend=VHD size=200M
    68 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50
    69 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50
    70 create disk=test mode=diff name=tstShared3.vhd type=dynamic backend=VHD size=200M
    71 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50
    72 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50
    73 close disk=test mode=single delete=yes
    74 close disk=test mode=single delete=yes
    75 close disk=test mode=single delete=yes
    76 destroydisk name=test
     51    iorngdestroy();
     52}
    7753
    78 # Parallels disk
    79 print msg=Testing_Parallels
    80 createdisk name=test verify=yes
    81 create disk=test mode=base name=tstShared.hdd type=dynamic backend=Parallels size=200M
    82 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=100
    83 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=100
    84 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=0
    85 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    86 create disk=test mode=diff name=tstShared2.hdd type=dynamic backend=Parallels size=200M
    87 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50
    88 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50
    89 create disk=test mode=diff name=tstShared3.hdd type=dynamic backend=Parallels size=200M
    90 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50
    91 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50
    92 close disk=test mode=single delete=yes
    93 close disk=test mode=single delete=yes
    94 close disk=test mode=single delete=yes
    95 destroydisk name=test
    96 
    97 # QED disk
    98 print msg=Testing_QED
    99 createdisk name=test verify=yes
    100 create disk=test mode=base name=tstShared.qed type=dynamic backend=QED size=200M
    101 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=100
    102 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=100
    103 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=0
    104 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    105 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50
    106 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50
    107 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=0
    108 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50
    109 close disk=test mode=single delete=no
    110 open disk=test name=tstShared.qed backend=QED async=yes
    111 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=0
    112 destroydisk name=test
    113 
    114 # QCOW disk
    115 print msg=Testing_QCOW
    116 createdisk name=test verify=yes
    117 create disk=test mode=base name=tstShared.qcow type=dynamic backend=QCOW size=200M
    118 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=100
    119 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=100
    120 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=0
    121 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=0
    122 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50
    123 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50
    124 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=0
    125 close disk=test mode=single delete=no
    126 open disk=test name=tstShared.qcow backend=QCOW async=yes
    127 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=0
    128 destroydisk name=test
    129 
    130 iorngdestroy
    131 
  • trunk/src/VBox/Storage/testcase/tstVDResize.vd

    r44227 r44943  
    1 # $Id$
    2 #
    3 # Storage: Resize testing for VDI.
    4 #
     1/* $Id$ */
     2/**
     3 * Storage: Resize testing for VDI.
     4 */
    55
    6 #
    7 # Copyright (C) 2013 Oracle Corporation
    8 #
    9 # This file is part of VirtualBox Open Source Edition (OSE), as
    10 # available from http://www.virtualbox.org. This file is free software;
    11 # you can redistribute it and/or modify it under the terms of the GNU
    12 # General Public License (GPL) as published by the Free Software
    13 # Foundation, in version 2 as it comes in the "COPYING" file of the
    14 # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    15 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    16 #
     6/*
     7 * Copyright (C) 2013 Oracle Corporation
     8 *
     9 * This file is part of VirtualBox Open Source Edition (OSE), as
     10 * available from http://www.virtualbox.org. This file is free software;
     11 * you can redistribute it and/or modify it under the terms of the GNU
     12 * General Public License (GPL) as published by the Free Software
     13 * Foundation, in version 2 as it comes in the "COPYING" file of the
     14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     16 */
    1717
    18 # Init I/O RNG for generating random data for writes
    19 iorngcreate size=10M mode=manual seed=1234567890
     18void main()
     19{
     20        /* Init I/O RNG for generating random data for writes. */
     21        iorngcreate(10M, "manual", 1234567890);
    2022
    21 # VDI disk
    22 print msg=Testing_VDI
    23 createdisk name=test verify=yes
    24 create disk=test mode=base name=tst.vdi type=dynamic backend=VDI size=1T
    25 io disk=test async=no mode=seq blocksize=64k off=255g-257g size=2g writes=100
    26 resize disk=test size=1331200M
    27 io disk=test async=no mode=seq blocksize=64k off=255g-257g size=2g writes=0
    28 destroydisk name=test
     23        print("Testing VDI");
     24        createdisk("test", true);
     25        create("test", "base", "tst.vdi", "dynamic", "VDI", 1T, false);
     26        io("test", false, 1, "seq", 64K, 255G, 257G, 2G, 100, "none");
     27        resize("test", 1331200M);
     28        io("test", false, 1, "seq", 64K, 255G, 257G, 2G,   0, "none");
     29        destroydisk("test");
    2930
    30 iorngdestroy
    31 
     31        iorngdestroy();
     32}
  • trunk/src/VBox/Storage/testcase/tstVDShareable.vd

    r36131 r44943  
    1 # $Id$
    2 #
    3 # Storage: Testcase for shareable disks.
    4 #
     1/* $Id$ */
     2/**
     3 * Storage: Testcase for shareable disks.
     4 */
    55
    6 #
    7 # Copyright (C) 2011 Oracle Corporation
    8 #
    9 # This file is part of VirtualBox Open Source Edition (OSE), as
    10 # available from http://www.virtualbox.org. This file is free software;
    11 # you can redistribute it and/or modify it under the terms of the GNU
    12 # General Public License (GPL) as published by the Free Software
    13 # Foundation, in version 2 as it comes in the "COPYING" file of the
    14 # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    15 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    16 #
     6/*
     7 * Copyright (C) 2011 Oracle Corporation
     8 *
     9 * This file is part of VirtualBox Open Source Edition (OSE), as
     10 * available from http://www.virtualbox.org. This file is free software;
     11 * you can redistribute it and/or modify it under the terms of the GNU
     12 * General Public License (GPL) as published by the Free Software
     13 * Foundation, in version 2 as it comes in the "COPYING" file of the
     14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
     15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
     16 */
    1717
    18 # Init I/O RNG for generating random data for writes
    19 iorngcreate size=10M mode=manual seed=1234567890
     18void main()
     19{
     20    /* Init I/O RNG for generating random data for writes. */
     21    iorngcreate(10M, "manual", 1234567890);
    2022
    21 # Create disk containers.
    22 createdisk name=shared1
    23 createdisk name=shared2
     23    /* Create disk containers. */
     24    createdisk("shared1", false);
     25    createdisk("shared2", false);
    2426
    25 # Create the disk and close it.
    26 create disk=shared1 mode=base name=tstShared.vdi type=fixed backend=VDI size=20M
    27 close disk=shared1 mode=all delete=no
     27    /* Create the disk and close it. */
     28    create("shared1", "base", "tstShared.vdi", "fixed", "VDI", 20M, false);
     29    close("shared1", "all", false);
    2830
    29 # Open the disk with sharing enabled.
    30 open disk=shared1 name=tstShared.vdi backend=VDI shareable=yes
    31 open disk=shared2 name=tstShared.vdi backend=VDI shareable=yes
     31    /* Open the disk with sharing enabled. */
     32    open("shared1", "tstShared.vdi", "VDI", true /* fAsync */, true /* fShareable */, false, false, false);
     33    open("shared2", "tstShared.vdi", "VDI", true /* fAsync */, true /* fShareable */, false, false, false);
    3234
    33 # Write to one disk and verify that the other disk can see the content.
    34 io disk=shared1 async=yes max-reqs=32 mode=seq blocksize=64k off=0-20M size=20M writes=100
    35 comparedisks disk1=shared1 disk2=shared2
     35    /* Write to one disk and verify that the other disk can see the content. */
     36    io("shared1", true, 32, "seq", 64K, 0, 20M, 20M, 100, "none");
     37    comparedisks("shared1", "shared2");
    3638
    37 # Write to the second disk and verify that the first can see the content.
    38 io disk=shared2 async=yes max-reqs=64 mode=seq blocksize=8k off=0-20M size=20M writes=50
    39 comparedisks disk1=shared1 disk2=shared2
     39    /* Write to the second disk and verify that the first can see the content. */
     40    io("shared2", true, 64, "seq", 8K, 0, 20M, 20M, 50, "none");
     41    comparedisks("shared1", "shared2");
    4042
    41 # Close but don't delete yet.
    42 close disk=shared1 mode=all delete=no
    43 close disk=shared2 mode=all delete=no
     43    /* Close but don't delete yet. */
     44    close("shared1", "all", false);
     45    close("shared2", "all", false);
    4446
    45 # Open and delete
    46 open disk=shared1 name=tstShared.vdi backend=VDI shareable=no
    47 close disk=shared1 mode=single delete=yes
     47    /* Open and delete. */
     48    open("shared1", "tstShared.vdi", "VDI", false /* fAsync */, false /* fShareable */, false, false, false);
     49    close("shared1", "single", true);
    4850
    49 # Cleanup
    50 destroydisk name=shared1
    51 destroydisk name=shared2
    52 iorngdestroy
    53 
     51    /* Cleanup */
     52    destroydisk("shared1");
     53    destroydisk("shared2");
     54    iorngdestroy();
     55}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette