diff mbox

[v5] block: add sheepdog driver for distributed storage support

Message ID 20100617191508.GA1591@chb-desktop (mailing list archive)
State New, archived
Headers show

Commit Message

Christian Brunner June 17, 2010, 7:15 p.m. UTC
None
diff mbox

Patch

From 17031ac88d05b4796dc1f231317d843f26f1a331 Mon Sep 17 00:00:00 2001
From: Christian Brunner <chb@muc.de>
Date: Thu, 3 Jun 2010 21:05:24 +0200
Subject: [PATCH] a small hack to run tests aginst the rbd driver

---
 common    |    6 ++++++
 common.rc |   14 +++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/common b/common
index 988fd5e..df4e6c9 100644
--- a/common
+++ b/common
@@ -122,6 +122,7 @@  check options
     -vdi                test vdi
     -vpc                test vpc
     -vmdk               test vmdk
+    -rbd                test rbd
     -xdiff		graphical mode diff
     -nocache		use O_DIRECT on backing file
     -misalign		misalign memory allocations
@@ -173,6 +174,11 @@  testlist options
 	    xpand=false
 	    ;;
 
+	-rbd)
+	    IMGFMT=rbd
+	    xpand=false
+	    ;;
+
 	-nocache)
 	    QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache"
 	    xpand=false
diff --git a/common.rc b/common.rc
index da58f92..2bde819 100644
--- a/common.rc
+++ b/common.rc
@@ -47,6 +47,10 @@  fi
 # make sure we have a standard umask
 umask 022
 
+if [ "$IMGFMT" = "rbd" ]; then
+    TEST_DIR=rbd:rbd
+fi
+
 TEST_IMG=$TEST_DIR/t.$IMGFMT
 
 _make_test_img()
@@ -71,9 +75,13 @@  _make_test_img()
 
 _cleanup_test_img()
 {
-    rm -f $TEST_DIR/t.$IMGFMT
-    rm -f $TEST_DIR/t.$IMGFMT.orig
-    rm -f $TEST_DIR/t.$IMGFMT.base
+    if [ "$IMGFMT" = "rbd" ]; then
+        rbdtool --delete t.$IMGFMT
+    else
+        rm -f $TEST_DIR/t.$IMGFMT
+        rm -f $TEST_DIR/t.$IMGFMT.orig
+        rm -f $TEST_DIR/t.$IMGFMT.base
+    fi
 }
 
 _check_test_img()
-- 
1.7.0.4