|
|
c401cc |
From 9045e6beec5341e8bff8333106a27fefc5621f78 Mon Sep 17 00:00:00 2001
|
|
|
c401cc |
Message-Id: <9045e6beec5341e8bff8333106a27fefc5621f78@dist-git>
|
|
|
c401cc |
From: Osier Yang <jyang@redhat.com>
|
|
|
c401cc |
Date: Sun, 2 Feb 2014 23:09:44 +0800
|
|
|
c401cc |
Subject: [PATCH] tests: Modify the scsi util tests
|
|
|
c401cc |
|
|
|
c401cc |
https://bugzilla.redhat.com/show_bug.cgi?id=957292
|
|
|
c401cc |
|
|
|
c401cc |
Add tests/virscsidata/sg0 and tests/virscsidata/sg8 as the test
|
|
|
c401cc |
input for constructing scsi->sg_path. And change the scsi generic
|
|
|
c401cc |
number of "1:0:0:0", because it's easy to hide the problem (assuming
|
|
|
c401cc |
most machines have a CDROM drive).
|
|
|
c401cc |
|
|
|
c401cc |
Signed-off-by: Osier Yang <jyang@redhat.com>
|
|
|
c401cc |
(cherry picked from commit 14177ebc2424a0f7d734d9974c557fb75cb6185c)
|
|
|
c401cc |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
c401cc |
---
|
|
|
c401cc |
tests/virscsidata/1:0:0:0/block/sdh/dev | 1 +
|
|
|
c401cc |
tests/virscsidata/1:0:0:0/block/sr0/dev | 1 -
|
|
|
c401cc |
tests/virscsidata/1:0:0:0/scsi_generic/sg1/dev | 1 -
|
|
|
c401cc |
tests/virscsidata/1:0:0:0/scsi_generic/sg8/dev | 1 +
|
|
|
c401cc |
tests/virscsidata/sg0 | 0
|
|
|
c401cc |
tests/virscsidata/sg8 | 0
|
|
|
c401cc |
tests/virscsitest.c | 4 ++--
|
|
|
c401cc |
7 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
c401cc |
create mode 100644 tests/virscsidata/1:0:0:0/block/sdh/dev
|
|
|
c401cc |
delete mode 100644 tests/virscsidata/1:0:0:0/block/sr0/dev
|
|
|
c401cc |
delete mode 100644 tests/virscsidata/1:0:0:0/scsi_generic/sg1/dev
|
|
|
c401cc |
create mode 100644 tests/virscsidata/1:0:0:0/scsi_generic/sg8/dev
|
|
|
c401cc |
create mode 100644 tests/virscsidata/sg0
|
|
|
c401cc |
create mode 100644 tests/virscsidata/sg8
|
|
|
c401cc |
|
|
|
c401cc |
diff --git a/tests/virscsidata/1:0:0:0/block/sdh/dev b/tests/virscsidata/1:0:0:0/block/sdh/dev
|
|
|
c401cc |
new file mode 100644
|
|
|
c401cc |
index 0000000..3d33f0f
|
|
|
c401cc |
--- /dev/null
|
|
|
c401cc |
+++ b/tests/virscsidata/1:0:0:0/block/sdh/dev
|
|
|
c401cc |
@@ -0,0 +1 @@
|
|
|
c401cc |
+11:0
|
|
|
c401cc |
diff --git a/tests/virscsidata/1:0:0:0/block/sr0/dev b/tests/virscsidata/1:0:0:0/block/sr0/dev
|
|
|
c401cc |
deleted file mode 100644
|
|
|
c401cc |
index 3d33f0f..0000000
|
|
|
c401cc |
--- a/tests/virscsidata/1:0:0:0/block/sr0/dev
|
|
|
c401cc |
+++ /dev/null
|
|
|
c401cc |
@@ -1 +0,0 @@
|
|
|
c401cc |
-11:0
|
|
|
c401cc |
diff --git a/tests/virscsidata/1:0:0:0/scsi_generic/sg1/dev b/tests/virscsidata/1:0:0:0/scsi_generic/sg1/dev
|
|
|
c401cc |
deleted file mode 100644
|
|
|
c401cc |
index bd84814..0000000
|
|
|
c401cc |
--- a/tests/virscsidata/1:0:0:0/scsi_generic/sg1/dev
|
|
|
c401cc |
+++ /dev/null
|
|
|
c401cc |
@@ -1 +0,0 @@
|
|
|
c401cc |
-21:1
|
|
|
c401cc |
diff --git a/tests/virscsidata/1:0:0:0/scsi_generic/sg8/dev b/tests/virscsidata/1:0:0:0/scsi_generic/sg8/dev
|
|
|
c401cc |
new file mode 100644
|
|
|
c401cc |
index 0000000..bd84814
|
|
|
c401cc |
--- /dev/null
|
|
|
c401cc |
+++ b/tests/virscsidata/1:0:0:0/scsi_generic/sg8/dev
|
|
|
c401cc |
@@ -0,0 +1 @@
|
|
|
c401cc |
+21:1
|
|
|
c401cc |
diff --git a/tests/virscsidata/sg0 b/tests/virscsidata/sg0
|
|
|
c401cc |
new file mode 100644
|
|
|
c401cc |
index 0000000..e69de29
|
|
|
c401cc |
diff --git a/tests/virscsidata/sg8 b/tests/virscsidata/sg8
|
|
|
c401cc |
new file mode 100644
|
|
|
c401cc |
index 0000000..e69de29
|
|
|
c401cc |
diff --git a/tests/virscsitest.c b/tests/virscsitest.c
|
|
|
c401cc |
index f95898b..612040c 100644
|
|
|
c401cc |
--- a/tests/virscsitest.c
|
|
|
c401cc |
+++ b/tests/virscsitest.c
|
|
|
c401cc |
@@ -43,7 +43,7 @@ test1(const void *data ATTRIBUTE_UNUSED)
|
|
|
c401cc |
"scsi_host1", 0, 0, 0)))
|
|
|
c401cc |
return -1;
|
|
|
c401cc |
|
|
|
c401cc |
- if (STRNEQ(name, "sr0"))
|
|
|
c401cc |
+ if (STRNEQ(name, "sdh"))
|
|
|
c401cc |
goto cleanup;
|
|
|
c401cc |
|
|
|
c401cc |
ret = 0;
|
|
|
c401cc |
@@ -72,7 +72,7 @@ test2(const void *data ATTRIBUTE_UNUSED)
|
|
|
c401cc |
sgname = virSCSIDeviceGetSgName(virscsi_prefix,
|
|
|
c401cc |
"scsi_host1", 0, 0, 0);
|
|
|
c401cc |
|
|
|
c401cc |
- if (!sgname || STRNEQ(sgname, "sg1"))
|
|
|
c401cc |
+ if (!sgname || STRNEQ(sgname, "sg8"))
|
|
|
c401cc |
goto cleanup;
|
|
|
c401cc |
|
|
|
c401cc |
if (!(dev = virSCSIDeviceNew(virscsi_prefix, "scsi_host1",
|
|
|
c401cc |
--
|
|
|
c401cc |
1.8.5.4
|
|
|
c401cc |
|