[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 2/6] java: Remove old test file if one was left around.



-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
>From 80aad709954cc4a3a294200e242876599047cef8 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones redhat com>
Date: Wed, 2 Mar 2011 05:10:31 +0000
Subject: [PATCH 2/6] java: Remove old test file if one was left around.

If a test.img file was left over from a previous run, then it
would cause the subsequent test to fail.  Therefore remove any
old test.img file.
---
 java/t/GuestFS010Basic.java |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/java/t/GuestFS010Basic.java b/java/t/GuestFS010Basic.java
index f4778dc..137fad3 100644
--- a/java/t/GuestFS010Basic.java
+++ b/java/t/GuestFS010Basic.java
@@ -24,6 +24,10 @@ public class GuestFS010Basic
     public static void main (String[] argv)
     {
         try {
+            // Delete any previous test file if one was left around.
+            File old = new File ("test.img");
+            old.delete ();
+
             RandomAccessFile f = new RandomAccessFile ("test.img", "rw");
             f.setLength (500 * 1024 * 1024);
             f.close ();
-- 
1.7.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]