tstVDShareable.vd revision c299849be8ae3544715e8806e1433cae67d93e2e
/* $Id$ */
/**
* Storage: Testcase for shareable disks.
*/
/*
* Copyright (C) 2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
void main()
{
/* Init I/O RNG for generating random data for writes. */
/* Create disk containers. */
createdisk("shared1", false);
createdisk("shared2", false);
/* Create the disk and close it. */
/* Open the disk with sharing enabled. */
open("shared1", "tstShared.vdi", "VDI", true /* fAsync */, true /* fShareable */, false, false, false, false);
open("shared2", "tstShared.vdi", "VDI", true /* fAsync */, true /* fShareable */, false, false, false, false);
/* Write to one disk and verify that the other disk can see the content. */
/* Write to the second disk and verify that the first can see the content. */
/* Close but don't delete yet. */
/* Open and delete. */
open("shared1", "tstShared.vdi", "VDI", false /* fAsync */, false /* fShareable */, false, false, false, false);
/* Cleanup */
destroydisk("shared1");
destroydisk("shared2");
iorngdestroy();
}