VirtualBox

source: vbox/trunk/src/VBox/Storage/testcase/tstVDCompact.vd@ 36635

Last change on this file since 36635 was 36635, checked in by vboxsync, 14 years ago

tstVDIo: Introduce I/O patterns to fill images with certain data. Added a simple testcase for compacting which uses patterns to fill certain areas of the image with 0

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
1# $Id: tstVDCompact.vd 36635 2011-04-08 23:25:37Z vboxsync $
2#
3# Storage: Testcase for compacting disks.
4#
5
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
18# Init I/O RNG for generating random data for writes
19iorngcreate size=10M mode=manual seed=1234567890
20
21# Create zero pattern
22iopatterncreatefromnumber name=zero size=1M pattern=0
23
24# Create disk containers, read verification is on.
25createdisk name=disk verify=yes
26
27# Create the disk and close it.
28create disk=disk mode=base name=tstCompact.vdi type=dynamic backend=VDI size=200M
29
30# Fill the disk with random data
31io disk=disk async=no max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=100
32
33# Read the data to verify it once.
34io disk=disk async=no max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=0
35
36# Fill a part with 0's
37io disk=disk async=no max-reqs=32 mode=seq blocksize=64k off=100M-150M size=50M writes=100 pattern=zero
38
39# Now compact
40compact disk=disk image=0
41
42# Read again to verify that the content hasn't changed
43io disk=disk async=no max-reqs=32 mode=seq blocksize=64k off=0-200M size=200M writes=0
44
45# Cleanup
46close disk=disk mode=single delete=yes
47destroydisk name=disk
48iopatterndestroy name=zero
49iorngdestroy
50
Note: See TracBrowser for help on using the repository browser.

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