On 3/25/21 4:21 PM, Claudio Imbrenda wrote:
On Thu, 25 Mar 2021 10:39:02 +0100
Pierre Morel <pmorel@xxxxxxxxxxxxx> wrote:
We will lhave to test if a device is present for every tests
in the future.
Let's provide a macro to check if the device is present and
to skip the tests if it is not.
Signed-off-by: Pierre Morel <pmorel@xxxxxxxxxxxxx>
---
s390x/css.c | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/s390x/css.c b/s390x/css.c
index c340c53..16723f6 100644
--- a/s390x/css.c
+++ b/s390x/css.c
@@ -27,6 +27,13 @@ static int test_device_sid;
static struct senseid *senseid;
struct ccw1 *ccw;
+#define NODEV_SKIP(dev) do {
\
+ if (!(dev)) {
\
+ report_skip("No
device"); \
+ return;
\
+ }
\
+ } while (0)
I wonder if you can add for example which device is not present (might
help with debugging)
potentially any CSS device would be OK for most of the tests.
For simplicity we use virtio-net-ccw because it does not require any
argument for allowing us to sense it.
When we need a more specific device I will add information.
in any case:
Reviewed-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
Thanks,
Pierre
--
Pierre Morel
IBM Lab Boeblingen