]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Modify the scsi util tests
authorOsier Yang <jyang@redhat.com>
Thu, 30 Jan 2014 11:48:23 +0000 (19:48 +0800)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 30 Jan 2014 15:34:43 +0000 (16:34 +0100)
Add tests/virscsidata/sg0 and tests/virscsidata/sg8 as the test
input for constructing scsi->sg_path. And change the scsi generic
number of "1:0:0:0", because it's easy to hide the problem (assuming
most machines have a CDROM drive).

Signed-off-by: Osier Yang <jyang@redhat.com>
tests/virscsidata/1:0:0:0/block/sdh/dev [moved from tests/virscsidata/1:0:0:0/block/sr0/dev with 100% similarity]
tests/virscsidata/1:0:0:0/scsi_generic/sg8/dev [moved from tests/virscsidata/1:0:0:0/scsi_generic/sg1/dev with 100% similarity]
tests/virscsidata/sg0 [new file with mode: 0644]
tests/virscsidata/sg8 [new file with mode: 0644]
tests/virscsitest.c

diff --git a/tests/virscsidata/sg0 b/tests/virscsidata/sg0
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/virscsidata/sg8 b/tests/virscsidata/sg8
new file mode 100644 (file)
index 0000000..e69de29
index d256a0e1c1f5f131b50f3b02a17a55edd41afc02..d4b3e4a1593e07747de44fff47a021b4fd4102e2 100644 (file)
@@ -43,7 +43,7 @@ test1(const void *data ATTRIBUTE_UNUSED)
                                          "scsi_host1", 0, 0, 0)))
         return -1;
 
-    if (STRNEQ(name, "sr0"))
+    if (STRNEQ(name, "sdh"))
         goto cleanup;
 
     ret = 0;
@@ -72,7 +72,7 @@ test2(const void *data ATTRIBUTE_UNUSED)
     sgname = virSCSIDeviceGetSgName(virscsi_prefix,
                                     "scsi_host1", 0, 0, 0);
 
-    if (!sgname || STRNEQ(sgname, "sg1"))
+    if (!sgname || STRNEQ(sgname, "sg8"))
         goto cleanup;
 
     if (!(dev = virSCSIDeviceNew(virscsi_prefix, "scsi_host1",