Changeset 44943 in vbox for trunk/src/VBox/Storage/testcase
- Timestamp:
- Mar 6, 2013 11:07:00 PM (12 years ago)
- 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 */ 5 5 6 # 7 #Copyright (C) 2011 Oracle Corporation8 # 9 #This file is part of VirtualBox Open Source Edition (OSE), as10 #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 GNU12 #General Public License (GPL) as published by the Free Software13 #Foundation, in version 2 as it comes in the "COPYING" file of the14 #VirtualBox OSE distribution. VirtualBox OSE is distributed in the15 #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 */ 17 17 18 # Init I/O RNG for generating random data for writes 19 iorngcreate size=10M mode=manual seed=1234567890 18 void tstCompact(string strMsg, string strBackend) 19 { 20 print(strMsg); 20 21 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); 23 25 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"); 48 32 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"); 73 43 74 # Destroy RNG and pattern 75 iopatterndestroy name=zero 76 iorngdestroy 44 close("disk", "single", true); 45 destroydisk("disk"); 46 } 77 47 48 void 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 */ 5 5 6 # 7 #Copyright (C) 2011 Oracle Corporation8 # 9 #This file is part of VirtualBox Open Source Edition (OSE), as10 #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 GNU12 #General Public License (GPL) as published by the Free Software13 #Foundation, in version 2 as it comes in the "COPYING" file of the14 #VirtualBox OSE distribution. VirtualBox OSE is distributed in the15 #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 */ 17 17 18 # Init I/O RNG for generating random data for writes 19 iorngcreate size=10M mode=manual seed=1234567890 18 void main() 19 { 20 /* Init I/O RNG for generating random data for writes. */ 21 iorngcreate(10M, "manual", 1234567890); 20 22 21 # Create source disk and fill data 22 print msg=Creating_Source_Disk 23 createdisk name=source verify=no24 create disk=source mode=base name=source_base.vdi type=dynamic backend=VDI size=1G25 io disk=source async=no mode=rnd blocksize=64k off=0-512M size=256M writes=10023 /* 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"); 26 28 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"); 31 32 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"); 36 36 37 print msg=Creating_Third_Diff 38 create disk=source mode=diff name=source_diff3.vdi type=dynamic backend=VDI size=1G39 io disk=source async=no mode=rnd blocksize=1M off=0M-1G size=45M writes=10037 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"); 40 40 41 print msg=Creating_Fourth_Diff 42 create disk=source mode=diff name=source_diff4.vdi type=dynamic backend=VDI size=1G43 io disk=source async=no mode=rnd blocksize=1M off=0M-1G size=45M writes=10041 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"); 44 44 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); 48 47 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 */ 52 50 53 print msg=Copying_First_Diff_optimized 54 copy diskfrom=source diskto=dest imagefrom=1 backend=VDI filename=dest_diff1.vdi fromsame=0 tosame=051 print("Copying first diff optimized"); 52 copy("source", "dest", 1, "VDI", "dest_diff1.vdi", false, 0, 0, 0); 55 53 56 print msg=Copying_Second_Diff_optimized 57 copy diskfrom=source diskto=dest imagefrom=2 backend=VDI filename=dest_diff2.vdi fromsame=1 tosame=158 copy diskfrom=source diskto=dest imagefrom=3 backend=VDI filename=dest_diff3.vdi fromsame=2 tosame=259 copy diskfrom=source diskto=dest imagefrom=4 backend=VDI filename=dest_diff4.vdi fromsame=3 tosame=354 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); 60 58 61 print msg=Comparing_Disks 62 comparedisks disk1=source disk2=dest59 print("Comparing_Disks"); 60 comparedisks("source", "dest"); 63 61 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); 69 67 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); 75 73 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); 81 78 82 close disk=source mode=single delete=yes83 close disk=source mode=single delete=yes84 close disk=source mode=single delete=yes85 destroydisk name=source86 destroydisk name=dest79 close("source", "single", true); 80 close("source", "single", true); 81 close("source", "single", true); 82 destroydisk("source"); 83 destroydisk("dest"); 87 84 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 */ 5 5 6 # 7 #Copyright (C) 2011 Oracle Corporation8 # 9 #This file is part of VirtualBox Open Source Edition (OSE), as10 #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 GNU12 #General Public License (GPL) as published by the Free Software13 #Foundation, in version 2 as it comes in the "COPYING" file of the14 #VirtualBox OSE distribution. VirtualBox OSE is distributed in the15 #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 */ 17 17 18 # Init I/O RNG for generating random data for writes 19 iorngcreate size=10M mode=manual seed=1234567890 18 void main() 19 { 20 /* Init I/O RNG for generating random data for writes. */ 21 iorngcreate(10M, "manual", 1234567890); 20 22 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"); 31 24 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); 38 34 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); 42 42 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); 48 46 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); 52 52 53 # Destroy RNG and pattern 54 iorngdestroy 53 /* Cleanup */ 54 close("disk", "single", true); 55 destroydisk("disk"); 55 56 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 */ 5 5 6 # 7 #Copyright (C) 2011-2013 Oracle Corporation8 # 9 #This file is part of VirtualBox Open Source Edition (OSE), as10 #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 GNU12 #General Public License (GPL) as published by the Free Software13 #Foundation, in version 2 as it comes in the "COPYING" file of the14 #VirtualBox OSE distribution. VirtualBox OSE is distributed in the15 #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 */ 17 17 18 # Init I/O RNG for generating random data for writes 19 iorngcreate size=10M mode=manual seed=1234567890 18 void 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 } 20 38 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 39 void main() 40 { 41 /* Init I/O RNG for generating random data for writes */ 42 iorngcreate(10M, "manual", 1234567890); 39 43 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"); 58 50 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 } 77 53 78 # Parallels disk79 print msg=Testing_Parallels80 createdisk name=test verify=yes81 create disk=test mode=base name=tstShared.hdd type=dynamic backend=Parallels size=200M82 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=10083 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=10084 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=085 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=086 create disk=test mode=diff name=tstShared2.hdd type=dynamic backend=Parallels size=200M87 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=5088 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=5089 create disk=test mode=diff name=tstShared3.hdd type=dynamic backend=Parallels size=200M90 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=5091 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=5092 close disk=test mode=single delete=yes93 close disk=test mode=single delete=yes94 close disk=test mode=single delete=yes95 destroydisk name=test96 97 # QED disk98 print msg=Testing_QED99 createdisk name=test verify=yes100 create disk=test mode=base name=tstShared.qed type=dynamic backend=QED size=200M101 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=100102 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=100103 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=0104 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=0105 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50106 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50107 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=0108 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50109 close disk=test mode=single delete=no110 open disk=test name=tstShared.qed backend=QED async=yes111 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=0112 destroydisk name=test113 114 # QCOW disk115 print msg=Testing_QCOW116 createdisk name=test verify=yes117 create disk=test mode=base name=tstShared.qcow type=dynamic backend=QCOW size=200M118 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=100119 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=100120 io disk=test async=yes max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=0121 io disk=test async=no mode=seq blocksize=64k off=0-200M size=200M writes=0122 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=50123 io disk=test async=no mode=rnd blocksize=64k off=0-200M size=200M writes=50124 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=0125 close disk=test mode=single delete=no126 open disk=test name=tstShared.qcow backend=QCOW async=yes127 io disk=test async=yes max-reqs=32 mode=rnd blocksize=64k off=0-200M size=200M writes=0128 destroydisk name=test129 130 iorngdestroy131 -
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 */ 5 5 6 # 7 #Copyright (C) 2013 Oracle Corporation8 # 9 #This file is part of VirtualBox Open Source Edition (OSE), as10 #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 GNU12 #General Public License (GPL) as published by the Free Software13 #Foundation, in version 2 as it comes in the "COPYING" file of the14 #VirtualBox OSE distribution. VirtualBox OSE is distributed in the15 #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 */ 17 17 18 # Init I/O RNG for generating random data for writes 19 iorngcreate size=10M mode=manual seed=1234567890 18 void main() 19 { 20 /* Init I/O RNG for generating random data for writes. */ 21 iorngcreate(10M, "manual", 1234567890); 20 22 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"); 29 30 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 */ 5 5 6 # 7 #Copyright (C) 2011 Oracle Corporation8 # 9 #This file is part of VirtualBox Open Source Edition (OSE), as10 #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 GNU12 #General Public License (GPL) as published by the Free Software13 #Foundation, in version 2 as it comes in the "COPYING" file of the14 #VirtualBox OSE distribution. VirtualBox OSE is distributed in the15 #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 */ 17 17 18 # Init I/O RNG for generating random data for writes 19 iorngcreate size=10M mode=manual seed=1234567890 18 void main() 19 { 20 /* Init I/O RNG for generating random data for writes. */ 21 iorngcreate(10M, "manual", 1234567890); 20 22 21 # Create disk containers. 22 createdisk name=shared1 23 createdisk name=shared2 23 /* Create disk containers. */ 24 createdisk("shared1", false); 25 createdisk("shared2", false); 24 26 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); 28 30 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); 32 34 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"); 36 38 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"); 40 42 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); 44 46 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); 48 50 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.