VirtualBox

source: vbox/trunk/src/VBox/Storage/testcase/tstVDDiscard.vd@ 44901

Last change on this file since 44901 was 39520, checked in by vboxsync, 13 years ago

VD: Testcase for the discard API

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1# $Id: tstVDDiscard.vd 39520 2011-12-02 21:17:42Z vboxsync $
2#
3# Storage: Testcase for discarding data in a disk.
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
21print msg=Testing_VDI
22# Create disk containers, read verification is on.
23createdisk name=disk verify=yes
24# Create the disk.
25create disk=disk mode=base name=tstCompact.vdi type=dynamic backend=VDI size=2G
26# Fill the disk with random data
27io disk=disk async=no mode=seq blocksize=64k off=0-2G size=2G writes=100
28# Read the data to verify it once.
29io disk=disk async=no mode=seq blocksize=64k off=0-2G size=2G writes=0
30close disk=disk mode=single delete=no
31
32open disk=disk name=tstCompact.vdi backend=VDI async=yes discard=yes
33printfilesize disk=disk image=0
34discard async=yes disk=disk ranges=6,0M,512k,1M,512k,2M,512k,3M,512k,4M,512k,5M,512k
35discard async=yes disk=disk ranges=6,6M,512k,7M,512k,8M,512k,9M,512k,10M,512k,11M,512k
36discard async=yes disk=disk ranges=1,512k,512k
37printfilesize disk=disk image=0
38
39print msg=Discard_whole_block
40discard async=yes disk=disk ranges=1,20M,1M
41printfilesize disk=disk image=0
42
43print msg=Split_Discard
44discard async=yes disk=disk ranges=1,21M,512k
45printfilesize disk=disk image=0
46discard async=yes disk=disk ranges=1,22016k,512k
47printfilesize disk=disk image=0
48
49# Cleanup
50close disk=disk mode=single delete=yes
51destroydisk name=disk
52
53# Destroy RNG and pattern
54iorngdestroy
55
Note: See TracBrowser for help on using the repository browser.

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