/* $Id: tstVDResize.vd 96832 2022-09-22 19:02:09Z vboxsync $ */ /** * Storage: Resize testing for VDI. */ /* * Copyright (C) 2013-2022 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 . * * SPDX-License-Identifier: GPL-3.0-only */ void main() { /* Init I/O RNG for generating random data for writes. */ iorngcreate(10M, "manual", 1234567890); print("Testing VDI"); createdisk("test", true); create("test", "base", "tst.vdi", "dynamic", "VDI", 1T, false, false); io("test", false, 1, "seq", 64K, 255G, 257G, 2G, 100, "none"); resize("test", 1331200M); io("test", false, 1, "seq", 64K, 255G, 257G, 2G, 0, "none"); close("test", "single", true /* fDelete */); destroydisk("test"); print("Testing VMDK Flat"); createdisk("test-vmdk-flat", true); create("test-vmdk-flat", "base", "test-vmdk-flat.vmdk", "fixed", "VMDK", 10G, false, false); io("test-vmdk-flat", false, 1, "seq", 64K, 1G, 2G, 10G, 100, "none"); resize("test-vmdk-flat", 20000M); close("test-vmdk-flat", "single", true /* fDelete */); destroydisk("test-vmdk-flat"); iorngdestroy(); }