diff mbox

[ndctl,2/3] test, device-dax: fix 'skip' reporting when test device not found

Message ID 147347169770.15190.17079545331805636573.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Williams Sept. 10, 2016, 1:41 a.m. UTC
If we are unable to find a test device, then the test should report
skipped.  However if any ndctl_test_attempt() succeeds prior to this
discovery ndctl_test_result() will return success (0) instead of skip
(77).  Re-arrange the 4.7 kernel version check to be after the device
availability check.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 test/device-dax.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/test/device-dax.c b/test/device-dax.c
index 04d53da544cd..c1409ac8b8b8 100644
--- a/test/device-dax.c
+++ b/test/device-dax.c
@@ -76,9 +76,6 @@  static int test_device_dax(int loglevel, struct ndctl_test *test,
 		return 1;
 	}
 
-	if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 7, 0)))
-		return 77;
-
 	ndctl_set_log_priority(ctx, loglevel);
 
 	ndns = ndctl_get_test_dev(ctx);
@@ -88,6 +85,9 @@  static int test_device_dax(int loglevel, struct ndctl_test *test,
 		return 77;
 	}
 
+	if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 7, 0)))
+		return 77;
+
 	rc = setup_device_dax(ndns);
 	if (rc < 0) {
 		fprintf(stderr, "%s: failed device-dax setup\n",