From 08cbedfbfb2931955ad2489b4afdf054dbeb49b5 Mon Sep 17 00:00:00 2001
From: wu-leilei <wu18740459704@163.com>
Date: Fri, 28 Jan 2022 14:29:10 +0800
Subject: [PATCH] test

---
 test/tester.c | 1082 ++++++++++++++++++++++++++-----------------------
 1 file changed, 564 insertions(+), 518 deletions(-)

diff --git a/test/tester.c b/test/tester.c
index 3a5ef57..0b7a2c3 100644
--- a/test/tester.c
+++ b/test/tester.c
@@ -72,7 +72,7 @@ char *error(lsm_error_ptr e)
  */
 #define G(variable, func, ...)     \
 variable = func(__VA_ARGS__);               \
-fail_unless( LSM_ERR_OK == variable, "call:%s rc = %d %s (which %d)", #func, \
+ck_assert_msg( LSM_ERR_OK == variable, "call:%s rc = %d %s (which %d)", #func, \
                     variable, error(lsm_error_last_get(c)), is_simc_plugin);
 
 /**
@@ -83,9 +83,12 @@ fail_unless( LSM_ERR_OK == variable, "call:%s rc = %d %s (which %d)", #func, \
  */
 #define F(variable, func, ...)     \
 variable = func(__VA_ARGS__);               \
-fail_unless( LSM_ERR_OK != variable, "call:%s rc = %d %s (which %d)", #func, \
+ck_assert_msg( LSM_ERR_OK != variable, "call:%s rc = %d %s (which %d)", #func, \
                     variable, error(lsm_error_last_get(c)), is_simc_plugin);
 
+
+#define ASSERT_STR_MATCH(l, r) ck_assert_msg(strcmp(l,r) == 0, "%s != %s", l, r);
+
 /**
 * Generates a random string in the buffer with specified length.
 * Note: This function should not produce repeating sequences or duplicates
@@ -247,9 +250,9 @@ void wait_for_job(lsm_connect *c, char **job_id)
 
     G(rc, lsm_job_free, c, job_id, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless( LSM_JOB_COMPLETE == status);
-    fail_unless( 100 == pc);
-    fail_unless( job_id != NULL );
+    ck_assert_msg( LSM_JOB_COMPLETE == status, "status = %d", status);
+    ck_assert_msg( 100 == pc, "Percent complete %d", pc);
+    ck_assert_msg( job_id != NULL, "NULL");
 }
 
 lsm_volume *wait_for_job_vol(lsm_connect *c, char **job_id)
@@ -273,8 +276,8 @@ lsm_volume *wait_for_job_vol(lsm_connect *c, char **job_id)
 
     G(rc, lsm_job_free, c, job_id, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless( LSM_JOB_COMPLETE == status);
-    fail_unless( 100 == pc);
+    ck_assert_msg( LSM_JOB_COMPLETE == status, "status = %d", status);
+    ck_assert_msg( 100 == pc, "Percent complete %d", pc);
 
     return vol;
 }
@@ -297,8 +300,8 @@ lsm_pool *wait_for_job_pool(lsm_connect *c, char **job_id)
 
     G(rc, lsm_job_free, c, job_id, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless( LSM_JOB_COMPLETE == status);
-    fail_unless( 100 == pc);
+    ck_assert_msg( LSM_JOB_COMPLETE == status, "status = %d", status);
+    ck_assert_msg( 100 == pc, "Percent complete %d", pc);
 
     return pool;
 }
@@ -320,8 +323,8 @@ lsm_fs *wait_for_job_fs(lsm_connect *c, char **job_id)
     } while( status == LSM_JOB_INPROGRESS );
 
     G(rc, lsm_job_free, c, job_id, LSM_CLIENT_FLAG_RSVD);
-    fail_unless( LSM_JOB_COMPLETE == status);
-    fail_unless( 100 == pc);
+    ck_assert_msg( LSM_JOB_COMPLETE == status, "status = %d", status);
+    ck_assert_msg( 100 == pc, "Percent complete %d", pc);
 
     return fs;
 }
@@ -344,8 +347,8 @@ lsm_fs_ss *wait_for_job_ss(lsm_connect *c, char **job_id)
 
     G(rc, lsm_job_free, c, job_id, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless( LSM_JOB_COMPLETE == status);
-    fail_unless( 100 == pc);
+    ck_assert_msg( LSM_JOB_COMPLETE == status, "status = %d", status);
+    ck_assert_msg( 100 == pc, "Percent complete %d", pc);
 
     return ss;
 }
@@ -390,13 +393,13 @@ void create_volumes(lsm_connect *c, lsm_pool *p, int num)
         int vc = lsm_volume_create(c, p, name, 20000000,
                                     LSM_VOLUME_PROVISION_DEFAULT, &n, &job, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless( vc == LSM_ERR_OK || vc == LSM_ERR_JOB_STARTED,
+        ck_assert_msg( vc == LSM_ERR_OK || vc == LSM_ERR_JOB_STARTED,
                 "lsmVolumeCreate %d (%s)", vc, error(lsm_error_last_get(c)));
 
         if( LSM_ERR_JOB_STARTED == vc ) {
             n = wait_for_job_vol(c, &job);
         } else {
-            fail_unless(LSM_ERR_OK == vc);
+            ck_assert_msg(LSM_ERR_OK == vc, "vc = %d", vc);
         }
 
         G(vc, lsm_volume_record_free, n);
@@ -437,7 +440,7 @@ START_TEST(test_smoke_test)
     //Get time-out.
     G(rc, lsm_connect_timeout_get, c, &tmo, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless( set_tmo == tmo, " %u != %u", set_tmo, tmo );
+    ck_assert_msg( set_tmo == tmo, " %u != %u", set_tmo, tmo );
 
     lsm_pool **pools = NULL;
     uint32_t count = 0;
@@ -448,7 +451,7 @@ START_TEST(test_smoke_test)
 
     //Check pool count
     count = poolCount;
-    fail_unless(count == 4, "We are expecting 4 pools from simulator");
+    ck_assert_msg(count == 4, "We are expecting 4 pools from simulator");
 
     //Dump pools and select a pool to use for testing.
     for (i = 0; i < count; ++i) {
@@ -460,11 +463,11 @@ START_TEST(test_smoke_test)
             lsm_pool_free_space_get(pools[i]),
             lsm_pool_system_id_get(pools[i]));
 
-        fail_unless( strcmp(lsm_pool_system_id_get(pools[i]), SYSTEM_ID) == 0,
+        ck_assert_msg( strcmp(lsm_pool_system_id_get(pools[i]), SYSTEM_ID) == 0,
             "Expecting system id of %s, got %s",
             SYSTEM_ID, lsm_pool_system_id_get(pools[i]));
 
-        fail_unless(lsm_pool_status_get(pools[i]) == LSM_POOL_STATUS_OK,
+        ck_assert_msg(lsm_pool_status_get(pools[i]) == LSM_POOL_STATUS_OK,
             "%"PRIu64, lsm_pool_status_get(pools[i]));
 
         if (lsm_pool_free_space_get(pools[i]) > 20000000) {
@@ -481,32 +484,32 @@ START_TEST(test_smoke_test)
         int vc = lsm_volume_create(c, pools[poolToUse], "test", 20000000,
                                     LSM_VOLUME_PROVISION_DEFAULT, &n, &job, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless( vc == LSM_ERR_OK || vc == LSM_ERR_JOB_STARTED,
+        ck_assert_msg( vc == LSM_ERR_OK || vc == LSM_ERR_JOB_STARTED,
                     "lsmVolumeCreate %d (%s)", vc, error(lsm_error_last_get(c)));
 
         if( LSM_ERR_JOB_STARTED == vc ) {
             n = wait_for_job_vol(c, &job);
 
-            fail_unless( n != NULL);
+            ck_assert_msg( n != NULL, "Expected NULL");
         }
 
         uint8_t dependants = 10;
         int child_depends = 0;
         G(child_depends, lsm_volume_child_dependency, c, n, &dependants,
                 LSM_CLIENT_FLAG_RSVD);
-        fail_unless(dependants == 0);
+        ck_assert_msg(dependants == 0, "dependants = %d", dependants);
 
         child_depends = lsm_volume_child_dependency_delete(c, n, &job, LSM_CLIENT_FLAG_RSVD);
         if( LSM_ERR_JOB_STARTED == child_depends ) {
             wait_for_job(c, &job);
         } else if ( LSM_ERR_NO_STATE_CHANGE != child_depends) {
-            fail_unless(LSM_ERR_OK == child_depends, "rc = %d", child_depends);
-            fail_unless(NULL == job);
+            ck_assert_msg(LSM_ERR_OK == child_depends, "rc = %d", child_depends);
+            ck_assert_msg(NULL == job, "Expected job == NULL");
         }
 
 
         lsm_block_range **range = lsm_block_range_record_array_alloc(3);
-        fail_unless(NULL != range);
+        ck_assert_msg(NULL != range, "Expected range != NULL");
 
 
         uint32_t bs = 0;
@@ -515,7 +518,7 @@ START_TEST(test_smoke_test)
         int rep_bs = 0;
         G(rep_bs, lsm_volume_replicate_range_block_size, c, system, &bs,
                 LSM_CLIENT_FLAG_RSVD);
-        fail_unless(512 == bs);
+        ck_assert_msg(512 == bs, "block size = %d", bs);
 
         lsm_system_record_free(system);
 
@@ -527,14 +530,16 @@ START_TEST(test_smoke_test)
 
             lsm_block_range *copy = lsm_block_range_record_copy(range[rep_i]);
 
-            fail_unless( lsm_block_range_source_start_get(range[rep_i]) ==
-                lsm_block_range_source_start_get(copy));
+            ck_assert_msg( lsm_block_range_source_start_get(range[rep_i]) ==
+                lsm_block_range_source_start_get(copy), "miss-match copy");
 
-            fail_unless( lsm_block_range_dest_start_get(range[rep_i]) ==
-                            lsm_block_range_dest_start_get(copy));
+            ck_assert_msg( lsm_block_range_dest_start_get(range[rep_i]) ==
+                            lsm_block_range_dest_start_get(copy),
+		            "miss-match copy");
 
-            fail_unless ( lsm_block_range_block_count_get(range[rep_i]) ==
-                            lsm_block_range_block_count_get( copy ));
+            ck_assert_msg ( lsm_block_range_block_count_get(range[rep_i]) ==
+                            lsm_block_range_block_count_get( copy ),
+		            "miss-match copy");
 
             G(rc, lsm_block_range_record_free, copy);
             copy = NULL;
@@ -552,7 +557,7 @@ START_TEST(test_smoke_test)
                 dump_error(lsm_error_last_get(c));
             }
 
-            fail_unless(LSM_ERR_OK == rep_range);
+            ck_assert_msg(LSM_ERR_OK == rep_range, "rep_range = %d", rep_range);
         }
 
         G(rc, lsm_block_range_record_array_free, range, 3);
@@ -565,7 +570,7 @@ START_TEST(test_smoke_test)
         char *jobDel = NULL;
         int delRc = lsm_volume_delete(c, n, &jobDel, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless( delRc == LSM_ERR_OK || delRc == LSM_ERR_JOB_STARTED,
+        ck_assert_msg( delRc == LSM_ERR_OK || delRc == LSM_ERR_JOB_STARTED,
                     "lsm_volume_delete %d (%s)", rc, error(lsm_error_last_get(c)));
 
         if( LSM_ERR_JOB_STARTED == delRc ) {
@@ -606,7 +611,7 @@ START_TEST(test_smoke_test)
             ((lsm_volume_number_of_blocks_get(volumes[0]) *
             lsm_volume_block_size_get(volumes[0])) * 2), &resized, &resizeJob, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(resizeRc == LSM_ERR_OK || resizeRc == LSM_ERR_JOB_STARTED,
+        ck_assert_msg(resizeRc == LSM_ERR_OK || resizeRc == LSM_ERR_JOB_STARTED,
                         "lsmVolumeResize %d (%s)", resizeRc,
                         error(lsm_error_last_get(c)));
 
@@ -622,7 +627,7 @@ START_TEST(test_smoke_test)
             volumes[0], "CLONE1",
             &rep, &job, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(repRc == LSM_ERR_OK || repRc == LSM_ERR_JOB_STARTED,
+        ck_assert_msg(repRc == LSM_ERR_OK || repRc == LSM_ERR_JOB_STARTED,
                         "lsmVolumeReplicate %d (%s)", repRc,
                         error(lsm_error_last_get(c)));
 
@@ -653,14 +658,14 @@ START_TEST(test_access_groups)
     lsm_system *system = NULL;
     int rc = 0;
 
-    fail_unless(c!=NULL);
+    ck_assert_msg(c!=NULL, "Expecting c != NULL");
 
 
     system = get_system(c);
 
     G(rc, lsm_access_group_list, c, NULL, NULL, &groups, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(count == 0, "Expect 0 access groups, got %"PRIu32, count);
-    fail_unless(groups == NULL);
+    ck_assert_msg(count == 0, "Expect 0 access groups, got %"PRIu32, count);
+    ck_assert_msg(groups == NULL, "Expecting groups == NULL");
 
     G(rc, lsm_access_group_create, c, "test_access_groups",
             "iqn.1994-05.com.domain:01.89bd01",
@@ -671,7 +676,8 @@ START_TEST(test_access_groups)
         lsm_string_list *init_list = lsm_access_group_initiator_id_get(group);
         lsm_string_list *init_copy = NULL;
 
-        fail_unless(lsm_string_list_size(init_list) == 1);
+        ck_assert_msg(lsm_string_list_size(init_list) == 1, "list size = %d",
+                      lsm_string_list_size(init_list));
 
         init_copy = lsm_string_list_copy(init_list);
         lsm_access_group_initiator_id_set(group, init_copy);
@@ -680,17 +686,35 @@ START_TEST(test_access_groups)
                                     lsm_access_group_name_get(group),
                                     lsm_access_group_system_id_get(group));
 
-        fail_unless(NULL != lsm_access_group_id_get(group));
-        fail_unless(NULL != lsm_access_group_name_get(group));
-        fail_unless(NULL != lsm_access_group_system_id_get(group));
-        fail_unless(LSM_ACCESS_GROUP_INIT_TYPE_ISCSI_IQN == lsm_access_group_init_type_get(group));
+        ck_assert_msg(NULL != lsm_access_group_id_get(group), "NULL");
+        ck_assert_msg(NULL != lsm_access_group_name_get(group), "NULL");
+        ck_assert_msg(NULL != lsm_access_group_system_id_get(group), "NULL");
+        ck_assert_msg(LSM_ACCESS_GROUP_INIT_TYPE_ISCSI_IQN ==
+                      lsm_access_group_init_type_get(group), "type = %d",
+                      (int)lsm_access_group_init_type_get(group));
 
         lsm_access_group *copy = lsm_access_group_record_copy(group);
         if( copy ) {
-            fail_unless( strcmp(lsm_access_group_id_get(group), lsm_access_group_id_get(copy)) == 0);
-            fail_unless( strcmp(lsm_access_group_name_get(group), lsm_access_group_name_get(copy)) == 0) ;
-            fail_unless( strcmp(lsm_access_group_system_id_get(group), lsm_access_group_system_id_get(copy)) == 0);
-            fail_unless( lsm_access_group_init_type_get(group) == lsm_access_group_init_type_get(copy));
+            ck_assert_msg( strcmp(lsm_access_group_id_get(group),
+                           lsm_access_group_id_get(copy)) == 0,
+                           "%s != %s",
+                           lsm_access_group_id_get(group),
+                           lsm_access_group_id_get(copy));
+            ck_assert_msg( strcmp(lsm_access_group_name_get(group),
+                           lsm_access_group_name_get(copy)) == 0,
+                            "%s != %s",
+                            lsm_access_group_name_get(group),
+                            lsm_access_group_name_get(copy));
+            ck_assert_msg( strcmp(lsm_access_group_system_id_get(group),
+                            lsm_access_group_system_id_get(copy)) == 0,
+                            "%s != %s",
+                            lsm_access_group_system_id_get(group),
+                            lsm_access_group_system_id_get(copy));
+            ck_assert_msg( lsm_access_group_init_type_get(group) ==
+                           lsm_access_group_init_type_get(copy),
+                           "%d != %d",
+                           lsm_access_group_init_type_get(group),
+                           lsm_access_group_init_type_get(copy));
 
             G(rc, lsm_access_group_record_free, copy);
             copy = NULL;
@@ -701,7 +725,7 @@ START_TEST(test_access_groups)
     }
 
     G(rc, lsm_access_group_list, c, NULL, NULL, &groups, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless( 1 == count );
+    ck_assert_msg( 1 == count, "count = %d", count );
     G(rc, lsm_access_group_record_array_free, groups, count);
     groups = NULL;
     count = 0;
@@ -711,18 +735,18 @@ START_TEST(test_access_groups)
     rc = lsm_access_group_initiator_add(c, group, "iqn.1994-05.com.domain:01.89bd02",
                                         LSM_ACCESS_GROUP_INIT_TYPE_ISCSI_IQN,
                                         &updated, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_OK == rc, "Expected success on lsmAccessGroupInitiatorAdd %d %d", rc, is_simc_plugin);
+    ck_assert_msg(LSM_ERR_OK == rc, "Expected success on lsmAccessGroupInitiatorAdd %d %d", rc, is_simc_plugin);
 
     G(rc, lsm_access_group_list, c, NULL, NULL, &groups, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless( 1 == count );
+    ck_assert_msg( 1 == count, "count = %d", count );
 
-    fail_unless( updated != NULL );
+    ck_assert_msg( updated != NULL, "Updated = %p", updated);
     lsm_access_group_record_free(updated);
     updated = NULL;
 
     if( count ) {
         init_list = lsm_access_group_initiator_id_get(groups[0]);
-        fail_unless( lsm_string_list_size(init_list) == 2,
+        ck_assert_msg( lsm_string_list_size(init_list) == 2,
                 "Expecting 2 initiators, current num = %d\n",
                 lsm_string_list_size(init_list) );
         for( i = 0; i < lsm_string_list_size(init_list) - 1; ++i) {
@@ -736,7 +760,7 @@ START_TEST(test_access_groups)
                     LSM_ACCESS_GROUP_INIT_TYPE_ISCSI_IQN, &updated,
                     LSM_CLIENT_FLAG_RSVD)
 
-            fail_unless(updated != NULL);
+            ck_assert_msg(updated != NULL, "updated = %p", updated);
             lsm_access_group_record_free(updated);
             updated = NULL;
         }
@@ -753,13 +777,13 @@ START_TEST(test_access_groups)
     count = 0;
 
     G(rc, lsm_access_group_list, c, NULL, NULL, &groups, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless( LSM_ERR_OK == rc);
-    fail_unless( 1 == count );
+    ck_assert_msg( LSM_ERR_OK == rc, "rd = %d", rc);
+    ck_assert_msg( 1 == count, "count = %d", count);
 
     if( count ) {
         init_list = lsm_access_group_initiator_id_get(groups[0]);
-        fail_unless( init_list != NULL);
-        fail_unless( lsm_string_list_size(init_list) == 1, "%d",
+        ck_assert_msg( init_list != NULL, "init_list = %p", init_list);
+        ck_assert_msg( lsm_string_list_size(init_list) == 1, "%d",
                         lsm_string_list_size(init_list));
         init_list = NULL;
         G(rc, lsm_access_group_record_array_free, groups, count);
@@ -774,7 +798,7 @@ END_TEST
 
 START_TEST(test_access_groups_grant_revoke)
 {
-    fail_unless(c!=NULL);
+    ck_assert_msg(c!=NULL, "c = %p", c);
     lsm_access_group *group = NULL;
     int rc = 0;
     lsm_pool *pool = get_test_pool(c);
@@ -782,7 +806,7 @@ START_TEST(test_access_groups_grant_revoke)
     lsm_volume *n = NULL;
     lsm_system *system = NULL;
 
-    fail_unless(pool != NULL);
+    ck_assert_msg(pool != NULL, "pool = %p", pool);
     system = get_system(c);
 
     G(rc, lsm_access_group_create, c, "test_access_groups_grant_revoke",
@@ -795,30 +819,34 @@ START_TEST(test_access_groups_grant_revoke)
     int vc = lsm_volume_create(c, pool, "volume_grant_test", 20000000,
                                     LSM_VOLUME_PROVISION_DEFAULT, &n, &job, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless( vc == LSM_ERR_OK || vc == LSM_ERR_JOB_STARTED,
+    ck_assert_msg( vc == LSM_ERR_OK || vc == LSM_ERR_JOB_STARTED,
             "lsmVolumeCreate %d (%s)", vc, error(lsm_error_last_get(c)));
 
     if( LSM_ERR_JOB_STARTED == vc ) {
         n = wait_for_job_vol(c, &job);
     }
 
-    fail_unless(n != NULL);
+    ck_assert_msg(n != NULL, "n = %p", n);
 
     rc = lsm_volume_mask(c, group, n, LSM_CLIENT_FLAG_RSVD);
     if( LSM_ERR_JOB_STARTED == rc ) {
         wait_for_job(c, &job);
     } else {
-        fail_unless(LSM_ERR_OK == rc, "rc = %d, plug-in = %d", rc, is_simc_plugin);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc = %d, plug-in = %d", rc, is_simc_plugin);
     }
 
     lsm_volume **volumes = NULL;
     uint32_t v_count = 0;
     G(rc, lsm_volumes_accessible_by_access_group, c, group, &volumes, &v_count,
             LSM_CLIENT_FLAG_RSVD);
-    fail_unless(v_count == 1);
+    ck_assert_msg(v_count == 1, "v_count = %d", v_count);
 
     if( v_count >= 1 ) {
-        fail_unless(strcmp(lsm_volume_id_get(volumes[0]), lsm_volume_id_get(n)) == 0);
+        ck_assert_msg(strcmp(lsm_volume_id_get(volumes[0]),
+                             lsm_volume_id_get(n)) == 0,
+                             "%s != %s",
+                             lsm_volume_id_get(volumes[0]),
+                             lsm_volume_id_get(n));
         G(rc, lsm_volume_record_array_free, volumes, v_count);
     }
 
@@ -826,11 +854,15 @@ START_TEST(test_access_groups_grant_revoke)
     uint32_t g_count = 0;
     G(rc, lsm_access_groups_granted_to_volume, c, n, &groups, &g_count,
             LSM_CLIENT_FLAG_RSVD);
-    fail_unless(g_count == 1);
+    ck_assert_msg(g_count == 1, "g_count = %d", g_count);
 
 
     if( g_count >= 1 ) {
-        fail_unless(strcmp(lsm_access_group_id_get(groups[0]), lsm_access_group_id_get(group)) == 0);
+        ck_assert_msg(strcmp(lsm_access_group_id_get(groups[0]),
+                             lsm_access_group_id_get(group)) == 0,
+                             "%s != %s",
+                             lsm_access_group_id_get(groups[0]),
+                             lsm_access_group_id_get(group));
         G(rc, lsm_access_group_record_array_free, groups, g_count);
     }
 
@@ -838,7 +870,7 @@ START_TEST(test_access_groups_grant_revoke)
     if( LSM_ERR_JOB_STARTED == rc ) {
         wait_for_job(c, &job);
     } else {
-        fail_unless(LSM_ERR_OK == rc, "rc = %d, is_simc_plugin=%d",
+        ck_assert_msg(LSM_ERR_OK == rc, "rc = %d, is_simc_plugin=%d",
                     rc, is_simc_plugin);
     }
 
@@ -854,7 +886,7 @@ END_TEST
 
 START_TEST(test_fs)
 {
-    fail_unless(c!=NULL);
+    ck_assert_msg(c!=NULL, "c = %p", c);
 
     lsm_fs **fs_list = NULL;
     int rc = 0;
@@ -867,46 +899,46 @@ START_TEST(test_fs)
     lsm_pool *test_pool = get_test_pool(c);
 
     G(rc, lsm_fs_list, c, NULL, NULL, &fs_list, &fs_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(0 == fs_count);
+    ck_assert_msg(0 == fs_count, "fs_count = %d", fs_count);
 
     rc = lsm_fs_create(c, test_pool, "C_unit_test", 50000000, &nfs, &job, LSM_CLIENT_FLAG_RSVD);
 
     if( LSM_ERR_JOB_STARTED == rc ) {
-        fail_unless(NULL == nfs);
+        ck_assert_msg(NULL == nfs, "nfs = %p", nfs);
 
         nfs = wait_for_job_fs(c, &job);
     } else {
-        fail_unless(LSM_ERR_OK == rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "%d", rc);
     }
 
-    fail_unless(NULL != nfs);
+    ck_assert_msg(NULL != nfs, "nfs = %p", nfs);
 
     fs_free_space = lsm_fs_free_space_get(nfs);
-    fail_unless(fs_free_space != 0);
+    ck_assert_msg(fs_free_space != 0, "fs_free_space = %lu", fs_free_space);
 
     lsm_fs *cloned_fs = NULL;
     rc = lsm_fs_clone(c, nfs, "cloned_fs", NULL, &cloned_fs, &job, LSM_CLIENT_FLAG_RSVD);
     if( LSM_ERR_JOB_STARTED == rc ) {
-        fail_unless(NULL == cloned_fs);
+        ck_assert_msg(NULL == cloned_fs, "cloned_fs = %p", cloned_fs);
         cloned_fs = wait_for_job_fs(c, &job);
 
         rc = lsm_fs_record_free(cloned_fs);
         cloned_fs = NULL;
-        fail_unless(LSM_ERR_OK == rc, "rc= %d", rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc= %d", rc);
     } else {
-        fail_unless(LSM_ERR_OK == rc, "rc= %d", rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc= %d", rc);
     }
 
     rc = lsm_fs_file_clone(c, nfs, "src/file.txt", "dest/file.txt", NULL, &job, LSM_CLIENT_FLAG_RSVD);
     if( LSM_ERR_JOB_STARTED == rc ) {
         wait_for_job(c, &job);
     } else {
-        fail_unless(LSM_ERR_OK == rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc= %d", rc);
     }
 
 
     G(rc, lsm_fs_list, c, NULL, NULL, &fs_list, &fs_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(2 == fs_count, "fs_count = %d", fs_count);
+    ck_assert_msg(2 == fs_count, "fs_count = %d", fs_count);
     G(rc, lsm_fs_record_array_free, fs_list, fs_count);
     fs_list = NULL;
     fs_count = 0;
@@ -914,22 +946,22 @@ START_TEST(test_fs)
     rc = lsm_fs_resize(c,nfs, 100000000, &resized_fs, &job, LSM_CLIENT_FLAG_RSVD);
 
     if( LSM_ERR_JOB_STARTED == rc ) {
-        fail_unless(NULL == resized_fs);
+        ck_assert_msg(NULL == resized_fs, "resized_fs = %p", resized_fs);
         resized_fs = wait_for_job_fs(c, &job);
     }
 
     uint8_t yes_no = 10;
     G(rc, lsm_fs_child_dependency, c, nfs, NULL, &yes_no,
       LSM_CLIENT_FLAG_RSVD);
-    fail_unless( yes_no != 0);
+    ck_assert_msg( yes_no != 0, "%d", yes_no);
 
     rc = lsm_fs_child_dependency_delete(
         c, nfs, NULL, &job, LSM_CLIENT_FLAG_RSVD);
     if( LSM_ERR_JOB_STARTED == rc ) {
-        fail_unless(NULL != job);
+        ck_assert_msg(NULL != job, "NULL");
         wait_for_job(c, &job);
     } else {
-        fail_unless( LSM_ERR_OK == rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc= %d", rc);
     }
 
     rc = lsm_fs_delete(c, resized_fs, &job, LSM_CLIENT_FLAG_RSVD);
@@ -937,7 +969,7 @@ START_TEST(test_fs)
     if( LSM_ERR_JOB_STARTED == rc ) {
         wait_for_job(c, &job);
     } else {
-        fail_unless(LSM_ERR_OK == rc, "lsm_fs_delete() failed: %d (%s)",
+        ck_assert_msg(LSM_ERR_OK == rc, "lsm_fs_delete() failed: %d (%s)",
                     rc, error(lsm_error_last_get(c)));
     }
 
@@ -949,7 +981,7 @@ END_TEST
 
 START_TEST(test_ss)
 {
-    fail_unless(c != NULL);
+    ck_assert_msg(c != NULL, "c = %p", c);
     lsm_fs_ss **ss_list = NULL;
     uint32_t ss_count = 0;
     char *job = NULL;
@@ -966,15 +998,15 @@ START_TEST(test_ss)
         fs = wait_for_job_fs(c, &job);
     }
 
-    fail_unless(fs != NULL);
+    ck_assert_msg(fs != NULL, "fs = %p", fs);
 
     G(rc, lsm_pool_record_free, test_pool);
     test_pool = NULL;
 
 
     G(rc, lsm_fs_ss_list, c, fs, &ss_list, &ss_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless( NULL == ss_list);
-    fail_unless( 0 == ss_count );
+    ck_assert_msg( NULL == ss_list, "ss_list = %p", ss_list);
+    ck_assert_msg( 0 == ss_count, "ss_count = %d", ss_count );
 
 
     rc = lsm_fs_ss_create(c, fs, "test_snap", &ss, &job, LSM_CLIENT_FLAG_RSVD);
@@ -982,14 +1014,14 @@ START_TEST(test_ss)
         printf("Waiting for snap to create!\n");
         ss = wait_for_job_ss(c, &job);
     } else {
-        fail_unless(LSM_ERR_OK == rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc = %d", rc);
     }
 
-    fail_unless( NULL != ss);
+    ck_assert_msg( NULL != ss, "ss = %p", ss);
 
     G(rc, lsm_fs_ss_list, c, fs, &ss_list, &ss_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless( NULL != ss_list);
-    fail_unless( 1 == ss_count );
+    ck_assert_msg( NULL != ss_list, "ss_list = %p", ss_list);
+    ck_assert_msg( 1 == ss_count, "ss_count = %d", ss_count );
 
     lsm_string_list *files = lsm_string_list_alloc(1);
     if(files) {
@@ -1001,7 +1033,7 @@ START_TEST(test_ss)
         printf("Waiting for  lsm_fs_ss_restore!\n");
         wait_for_job(c, &job);
     } else {
-        fail_unless(LSM_ERR_OK == rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc = %d", rc);
     }
 
     G(rc, lsm_string_list_free, files);
@@ -1027,22 +1059,22 @@ START_TEST(test_systems)
     uint32_t status = 0;
     int rc = 0;
 
-    fail_unless(c!=NULL);
+    ck_assert_msg(c != NULL, "c = %p", c);
 
     G(rc, lsm_system_list, c, &sys, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(count == 1);
+    ck_assert_msg(count == 1, "count = %d", count);
 
     if( count ) {
         id = lsm_system_id_get(sys[0]);
-        fail_unless(id != NULL);
-        fail_unless(strcmp(id, SYSTEM_ID) == 0, "%s", id);
+        ck_assert_msg(id != NULL, "NULL");
+        ASSERT_STR_MATCH(id, SYSTEM_ID);
 
         name = lsm_system_name_get(sys[0]);
-        fail_unless(name != NULL);
-        fail_unless(strcmp(name, SYSTEM_NAME) == 0);
+        ck_assert_msg(name != NULL, "NULL");
+        ASSERT_STR_MATCH(name, SYSTEM_NAME);
 
         status = lsm_system_status_get(sys[0]);
-        fail_unless(status == LSM_SYSTEM_STATUS_OK, "status = %x", status);
+        ck_assert_msg(status == LSM_SYSTEM_STATUS_OK, "status = %x", status);
     }
 
     G(rc, lsm_system_record_array_free, sys, count);
@@ -1099,43 +1131,44 @@ START_TEST(test_disks)
     const char *system_id;
     uint32_t i = 0;
 
-    fail_unless(c!=NULL);
+    ck_assert_msg(c!=NULL, "c = %p", c);
 
     int rc = lsm_disk_list(c, NULL, NULL, &d, &count, 0);
 
     if( LSM_ERR_OK == rc ) {
-        fail_unless(LSM_ERR_OK == rc, "%d", rc);
-        fail_unless(count >= 1);
+        ck_assert_msg(LSM_ERR_OK == rc, "%d", rc);
+        ck_assert_msg(count >= 1, "count = %d", count);
 
         for( i = 0; i < count; ++i ) {
             lsm_disk *d_copy = lsm_disk_record_copy( d[i] );
-            fail_unless( d_copy != NULL );
+            ck_assert_msg( d_copy != NULL, "NULL");
             if( d_copy ) {
-                fail_unless(compare_disks(d[i], d_copy) == 0);
+                ck_assert_msg(compare_disks(d[i], d_copy) == 0,
+                              "compare_disks failed");
                 lsm_disk_record_free(d_copy);
                 d_copy = NULL;
             }
 
             id = lsm_disk_id_get(d[i]);
-            fail_unless(id != NULL && strlen(id) > 0);
+            ck_assert_msg(id != NULL && strlen(id) > 0, "NULL");
 
             name = lsm_disk_name_get(d[i]);
-            fail_unless(id != NULL && strlen(name) > 0);
+            ck_assert_msg(id != NULL && strlen(name) > 0, "NULL");
 
             system_id = lsm_disk_system_id_get(d[i]);
-            fail_unless(id != NULL && strlen(system_id) > 0);
-            fail_unless(strcmp(system_id, SYSTEM_ID) == 0, "%s", id);
-
-            fail_unless( lsm_disk_type_get(d[i]) >= 1 );
-            fail_unless( lsm_disk_number_of_blocks_get(d[i]) >= 1);
-            fail_unless( lsm_disk_block_size_get(d[i]) >= 1);
-            fail_unless( lsm_disk_status_get(d[i]) >= 1);
-            fail_unless(lsm_disk_vpd83_get(d[i]) != NULL);
+            ck_assert_msg(id != NULL && strlen(system_id) > 0, "NULL");
+            ck_assert_msg(strcmp(system_id, SYSTEM_ID) == 0, "%s", id);
+
+            ck_assert_msg( lsm_disk_type_get(d[i]) >= 1 , "%d", (int)lsm_disk_type_get(d[i]));
+            ck_assert_msg( lsm_disk_number_of_blocks_get(d[i]) >= 1, "%lu", lsm_disk_number_of_blocks_get(d[i]));
+            ck_assert_msg( lsm_disk_block_size_get(d[i]) >= 1, "%lu", lsm_disk_block_size_get(d[i]));
+            ck_assert_msg( lsm_disk_status_get(d[i]) >= 1, "%lu", lsm_disk_status_get(d[i]));
+            ck_assert_msg(lsm_disk_vpd83_get(d[i]) != NULL, "NULL");
         }
         lsm_disk_record_array_free(d, count);
     } else {
-        fail_unless(d == NULL);
-        fail_unless(count == 0);
+        ck_assert_msg(d == NULL, "d = %p", d);
+        ck_assert_msg(count == 0, "count = %d", count);
     }
 }
 END_TEST
@@ -1149,39 +1182,39 @@ START_TEST(test_disk_rpm_and_link_type)
     int32_t rpm = LSM_DISK_RPM_UNKNOWN;
     lsm_disk_link_type link_type = LSM_DISK_LINK_TYPE_UNKNOWN;
 
-    fail_unless(c != NULL);
+    ck_assert_msg(c!=NULL, "c = %p", c);
 
     rc = lsm_disk_list(c, NULL, NULL, &disks, &count, 0);
-    fail_unless(LSM_ERR_OK == rc, "rc: %d", rc);
+    ck_assert_msg(LSM_ERR_OK == rc, "rc: %d", rc);
 
     if (LSM_ERR_OK == rc) {
-        fail_unless(count >= 1);
+        ck_assert_msg(count >= 1, "count = %d", count);
 
         for (; i < count; ++i) {
             rpm = lsm_disk_rpm_get(disks[i]);
-            fail_unless(rpm != LSM_DISK_RPM_UNKNOWN,
+            ck_assert_msg(rpm != LSM_DISK_RPM_UNKNOWN,
                         "Should not be LSM_DISK_RPM_UNKNOWN when input disk "
-                        "is valid", rc);
+                        "is valid %d", rc);
 
             link_type = lsm_disk_link_type_get(disks[i]);
-            fail_unless(link_type != LSM_DISK_LINK_TYPE_UNKNOWN,
+            ck_assert_msg(link_type != LSM_DISK_LINK_TYPE_UNKNOWN,
                         "Should not be LSM_DISK_LINK_TYPE_UNKNOWN when input "
-                        "disk is valid", rc);
+                        "disk is valid %d", rc);
         }
 
         rpm = lsm_disk_rpm_get(NULL);
-        fail_unless(rpm == LSM_DISK_RPM_UNKNOWN,
-                    "Should be LSM_DISK_RPM_UNKNOWN when input disk is NULL",
+        ck_assert_msg(rpm == LSM_DISK_RPM_UNKNOWN,
+                    "Should be LSM_DISK_RPM_UNKNOWN when input disk is NULL %d",
                     rc);
         link_type = lsm_disk_link_type_get(NULL);
-        fail_unless(rpm == LSM_DISK_LINK_TYPE_UNKNOWN,
+        ck_assert_msg(rpm == LSM_DISK_LINK_TYPE_UNKNOWN,
                     "Should be LSM_DISK_LINK_TYPE_UNKNOWN when input disk is "
-                    "NULL", rc);
+                    "NULL %d", rc);
 
         lsm_disk_record_array_free(disks, count);
     } else {
-        fail_unless(disks == NULL);
-        fail_unless(count == 0);
+        ck_assert_msg(disks == NULL, "disks = %p", disks);
+        ck_assert_msg(count == 0, "count = %d", count);
     }
 }
 END_TEST
@@ -1194,20 +1227,20 @@ START_TEST(test_disk_location)
     uint32_t i = 0;
     int rc = LSM_ERR_OK;
 
-    fail_unless(c!=NULL);
+    ck_assert_msg(c!=NULL, "c = %p", c);
 
     G(rc, lsm_disk_list, c, NULL, NULL, &d, &count, 0);
-    fail_unless(count >= 1);
+    ck_assert_msg(count >= 1, "count = %d", count);
 
     for(; i < count; ++i ) {
         location = lsm_disk_location_get(d[i]);
-        fail_unless(location != NULL,
+        ck_assert_msg(location != NULL,
                     "Got NULL return from lsm_disk_location_get()");
 
         printf("Disk location: (%s)\n", location);
     }
     location = lsm_disk_location_get(NULL);
-    fail_unless(location == NULL,
+    ck_assert_msg(location == NULL,
                 "Got non-NULL return from lsm_disk_location_get(NULL)");
 
     lsm_disk_record_array_free(d, count);
@@ -1216,14 +1249,14 @@ END_TEST
 
 START_TEST(test_nfs_exports)
 {
-    fail_unless(c != NULL);
+    ck_assert_msg(c!=NULL, "c = %p", c);
     int rc = 0;
 
     lsm_pool *test_pool = get_test_pool(c);
     lsm_fs *nfs = NULL;
     char *job = NULL;
 
-    fail_unless(NULL != test_pool);
+    ck_assert_msg(NULL != test_pool, "test_pool = %p", test_pool);
 
     if( test_pool ) {
         rc = lsm_fs_create(c, test_pool, "C_unit_test_nfs_export", 50000000,
@@ -1232,10 +1265,10 @@ START_TEST(test_nfs_exports)
         if( LSM_ERR_JOB_STARTED == rc ) {
             nfs = wait_for_job_fs(c, &job);
         } else {
-            fail_unless(LSM_ERR_OK == rc, "RC = %d", rc);
+            ck_assert_msg(LSM_ERR_OK == rc, "RC = %d", rc);
         }
 
-        fail_unless(nfs != NULL);
+        ck_assert_msg(nfs != NULL, "nfs = %p", nfs);
         lsm_nfs_export **exports = NULL;
         uint32_t count = 0;
 
@@ -1245,12 +1278,12 @@ START_TEST(test_nfs_exports)
 
         if( nfs ) {
             G(rc, lsm_nfs_list, c, NULL, NULL, &exports, &count, LSM_CLIENT_FLAG_RSVD);
-            fail_unless(count == 0);
-            fail_unless(NULL == exports);
+            ck_assert_msg(count == 0, "count = %d", count);
+            ck_assert_msg(NULL == exports, "exports = %p", exports);
 
 
             lsm_string_list *access = lsm_string_list_alloc(1);
-            fail_unless(NULL != access);
+            ck_assert_msg(NULL != access, "access = %p", access);
 
             G(rc, lsm_string_list_elem_set, access, 0, "192.168.2.29");
 
@@ -1268,8 +1301,8 @@ START_TEST(test_nfs_exports)
             access = NULL;
 
             G(rc, lsm_nfs_list, c, NULL, NULL, &exports, &count, LSM_CLIENT_FLAG_RSVD);
-            fail_unless( exports != NULL);
-            fail_unless( count == 1 );
+            ck_assert_msg(exports != NULL, "exports = %p", exports);
+            ck_assert_msg(count == 1, "count = %d", count);
 
             if( count ) {
                 G(rc, lsm_nfs_export_delete, c, exports[0], LSM_CLIENT_FLAG_RSVD);
@@ -1279,8 +1312,8 @@ START_TEST(test_nfs_exports)
                 G(rc, lsm_nfs_list, c, NULL, NULL, &exports, &count,
                     LSM_CLIENT_FLAG_RSVD);
 
-                fail_unless(count == 0);
-                fail_unless(NULL == exports);
+                ck_assert_msg(count == 0, "count = %d", count);
+                ck_assert_msg(NULL == exports, "exports = %p", exports);
             }
 
 
@@ -1305,7 +1338,7 @@ START_TEST(test_volume_methods)
 
     int rc = 0;
 
-    fail_unless(c != NULL);
+    ck_assert_msg(c!=NULL, "c = %p", c);
 
     test_pool = get_test_pool(c);
 
@@ -1317,18 +1350,17 @@ START_TEST(test_volume_methods)
         if( LSM_ERR_JOB_STARTED == rc ) {
             v = wait_for_job_vol(c, &job);
         } else {
-            fail_unless(LSM_ERR_OK == rc, "rc %d", rc);
+            ck_assert_msg(LSM_ERR_OK == rc, "rc %d", rc);
         }
 
         if ( v ) {
-            fail_unless( strcmp(lsm_volume_pool_id_get(v),
-                            lsm_pool_id_get(test_pool)) == 0 );
-
+            ASSERT_STR_MATCH(lsm_volume_pool_id_get(v), lsm_pool_id_get(test_pool));
+           
             rc = lsm_volume_delete(c, v, &job, LSM_CLIENT_FLAG_RSVD);
             if( LSM_ERR_JOB_STARTED == rc ) {
                 wait_for_job(c, &job);
             } else {
-                fail_unless(LSM_ERR_OK == rc, "rc %d", rc);
+                ck_assert_msg(LSM_ERR_OK == rc, "rc %d", rc);
             }
 
             G(rc, lsm_volume_record_free, v);
@@ -1343,7 +1375,7 @@ END_TEST
 
 START_TEST(test_invalid_input)
 {
-    fail_unless(c != NULL);
+    ck_assert_msg(c!=NULL, "c = %p", c);
     int rc = 0;
 
     struct bad_record bad;
@@ -1357,103 +1389,103 @@ START_TEST(test_invalid_input)
     lsm_error_ptr test_error = NULL;
 
     rc = lsm_connect_password(NULL, NULL, NULL, 20000, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc %d", rc);
 
     rc = lsm_connect_password("INVALID_URI:\\yep", NULL, &test_connect, 20000,
                                 &test_error, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc %d", rc);
 
 
     rc = lsm_connect_close((lsm_connect *)&bad, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_connect_close((lsm_connect *)NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
 
 
     rc = lsm_job_status_get(c, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     char *job = NULL;
     rc = lsm_job_status_get(c, job, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     lsm_job_status status;
 
 
     rc = lsm_job_status_get(c, job, &status, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     uint8_t percent_complete;
     rc = lsm_job_status_get(c, "NO_SUCH_JOB", &status, &percent_complete, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_NOT_FOUND_JOB == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_NOT_FOUND_JOB == rc, "rc %d", rc);
 
     /* lsmJobStatusVolumeGet */
     lsm_volume *vol = NULL;
     rc = lsm_job_status_volume_get(c, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_status_volume_get(c, NULL, NULL, NULL, &vol, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_status_volume_get(c, job, NULL, NULL, &vol, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_status_volume_get(c, job, &status, NULL, &vol, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_status_volume_get(c, "NO_SUCH_JOB", &status, &percent_complete, &vol, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_NOT_FOUND_JOB == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_NOT_FOUND_JOB == rc, "rc %d", rc);
 
     /* lsmJobStatusFsGet */
     lsm_fs *fs = NULL;
 
     rc = lsm_job_status_fs_get(c, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_status_fs_get(c, NULL, NULL, NULL, &fs, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_status_fs_get(c, job, NULL, NULL, &fs, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_status_fs_get(c, job, &status, NULL, &fs, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_status_fs_get(c, "NO_SUCH_JOB", &status, &percent_complete, &fs, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_NOT_FOUND_JOB == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_NOT_FOUND_JOB == rc, "rc %d", rc);
 
     /* lsmJobStatusFsGet */
     lsm_fs_ss *ss = (lsm_fs_ss *)&bad;
 
     rc = lsm_job_status_ss_get(c, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_status_ss_get(c, NULL, NULL, NULL, &ss, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     ss = NULL;
 
     rc = lsm_job_status_ss_get(c, job, NULL, NULL, &ss, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_status_ss_get(c, job, &status, NULL, &ss, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_status_ss_get(c, "NO_SUCH_JOB", &status, &percent_complete, &ss, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_NOT_FOUND_JOB == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_NOT_FOUND_JOB == rc, "rc %d", rc);
 
 
     /* lsmJobFree */
     char *bogus_job = strdup("NO_SUCH_JOB");
     rc = lsm_job_free(c, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_job_free(c, &bogus_job, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_NOT_FOUND_JOB == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_NOT_FOUND_JOB == rc, "rc %d", rc);
 
-    fail_unless(bogus_job != NULL, "Expected bogus job to != NULL!");
+    ck_assert_msg(bogus_job != NULL, "Expected bogus job to != NULL!");
     free(bogus_job);
 
 
@@ -1462,85 +1494,85 @@ START_TEST(test_invalid_input)
     lsm_disk **disks = NULL;
 
     rc = lsm_disk_list(c, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d, rc");
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_disk_list(c, "bogus_key", NULL, &disks, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d, rc");
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_disk_list(c, "bogus_key", "nope", &disks, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_UNSUPPORTED_SEARCH_KEY == rc, "rc %d, rc");
+    ck_assert_msg(LSM_ERR_UNSUPPORTED_SEARCH_KEY == rc, "rc %d", rc);
 
     /* lsmPoolList */
     rc = lsm_pool_list(c, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     lsm_pool **pools = NULL;
     rc = lsm_pool_list(c, NULL, NULL, &pools, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_pool_list(c, NULL, NULL, NULL, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     pools = (lsm_pool **)&bad;
     rc = lsm_pool_list(c, NULL, NULL, &pools, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     pools = NULL;
     rc = lsm_pool_list(c, "bogus_key", "nope", &pools, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_UNSUPPORTED_SEARCH_KEY == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_UNSUPPORTED_SEARCH_KEY == rc, "rc %d", rc);
 
     rc = lsm_pool_list(c, "bogus_key", NULL, &pools, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     /* lsmVolumeList */
      rc = lsm_volume_list(c, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     lsm_volume **vols = NULL;
     rc = lsm_volume_list(c, NULL, NULL, &vols, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_volume_list(c, NULL, NULL, NULL, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     vols = (lsm_volume **)&bad;
     rc = lsm_volume_list(c, NULL, NULL, &vols, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     vols = NULL;
     rc = lsm_volume_list(c, "bogus_key", "nope", &vols, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_UNSUPPORTED_SEARCH_KEY == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_UNSUPPORTED_SEARCH_KEY == rc, "rc %d", rc);
 
     rc = lsm_volume_list(c, "bogus_key", NULL, &vols, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     /* lsmVolumeCreate */
     lsm_volume *new_vol = NULL;
     job = NULL;
 
     rc = lsm_volume_create(c, NULL, NULL, 0, 0, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_volume_create(c, (lsm_pool *)&bad, "BAD_POOL", 10000000,
                             LSM_VOLUME_PROVISION_DEFAULT, &new_vol, &job, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_volume_create(c, test_pool, "", 10000000, LSM_VOLUME_PROVISION_DEFAULT,
                             &new_vol, &job, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_volume_create(c, test_pool, "ARG_TESTING", 10000000, LSM_VOLUME_PROVISION_DEFAULT,
                             NULL, &job, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_volume_create(c, test_pool, "ARG_TESTING", 10000000, LSM_VOLUME_PROVISION_DEFAULT,
                             &new_vol, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     job = "NOT_NULL";
     rc = lsm_volume_create(c, test_pool, "ARG_TESTING", 10000000, LSM_VOLUME_PROVISION_DEFAULT,
                             &new_vol, &job, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     job = NULL;
     rc = lsm_volume_create(c, test_pool, "ARG_TESTING", 10000000, LSM_VOLUME_PROVISION_DEFAULT,
@@ -1549,47 +1581,47 @@ START_TEST(test_invalid_input)
     if( LSM_ERR_JOB_STARTED == rc ) {
         new_vol = wait_for_job_vol(c, &job);
     } else {
-        fail_unless(LSM_ERR_OK == rc, "rc %d", rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc %d", rc);
     }
 
     /* lsmVolumeResize */
     rc = lsm_volume_resize(c, NULL, 0, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
 
     lsm_volume *resized = (lsm_volume *)&bad;
     rc = lsm_volume_resize(c, new_vol, 20000000, &resized, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     resized = NULL;
     rc = lsm_volume_resize(c, new_vol, 20000000, &resized, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_volume_resize(c, new_vol,    lsm_volume_number_of_blocks_get(new_vol) *
                                         lsm_volume_block_size_get(new_vol),
                                         &resized, &job, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_NO_STATE_CHANGE == rc, "rc = %d", rc);
+    ck_assert_msg(LSM_ERR_NO_STATE_CHANGE == rc, "rc = %d", rc);
 
     rc = lsm_volume_resize(c, new_vol, 20000000, &resized, &job, LSM_CLIENT_FLAG_RSVD);
 
     if( LSM_ERR_JOB_STARTED == rc ) {
         resized = wait_for_job_vol(c, &job);
     } else {
-        fail_unless(LSM_ERR_OK == rc, "rc %d", rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc %d", rc);
     }
 
     /* lsmVolumeDelete */
     rc = lsm_volume_delete(c, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_volume_delete(c, resized, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc %d", rc);
 
     rc = lsm_volume_delete(c, resized, &job, LSM_CLIENT_FLAG_RSVD);
     if( LSM_ERR_JOB_STARTED == rc ) {
         wait_for_job(c, &job);
     } else {
-        fail_unless(LSM_ERR_OK == rc, "rc %d", rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc %d", rc);
     }
 
     /* lsmStorageCapabilities * */
@@ -1597,64 +1629,64 @@ START_TEST(test_invalid_input)
     uint32_t num_systems = 0;
     rc = lsm_system_list(c, &sys, &num_systems, LSM_CLIENT_FLAG_RSVD );
 
-    fail_unless(LSM_ERR_OK == rc, "rc %d", rc);
-    fail_unless( sys != NULL);
-    fail_unless( num_systems >= 1, "num_systems %d", num_systems);
+    ck_assert_msg(LSM_ERR_OK == rc, "rc %d", rc);
+    ck_assert_msg( sys != NULL, "sys = %p", sys);
+    ck_assert_msg( num_systems >= 1, "num_systems %d", num_systems);
 
 
     rc = lsm_capabilities(c, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT, "rc %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT, "rc %d", rc);
 
     if( num_systems ) {
         rc = lsm_capabilities(c, sys[0], NULL, LSM_CLIENT_FLAG_RSVD);
-        fail_unless(LSM_ERR_INVALID_ARGUMENT, "rc %d", rc);
+        ck_assert_msg(LSM_ERR_INVALID_ARGUMENT, "rc %d", rc);
     }
 
     /* lsmVolumeReplicate */
     lsm_volume *cloned = NULL;
     rc = lsm_volume_replicate(c, (lsm_pool *)&bad, 0, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_replicate(c, test_pool, LSM_VOLUME_REPLICATE_CLONE, NULL,
                             "cloned", &cloned, &job, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_replicate(c, test_pool, LSM_VOLUME_REPLICATE_CLONE, new_vol,
                             "", &cloned, &job, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_replicate(c, test_pool, LSM_VOLUME_REPLICATE_CLONE, new_vol,
                             "cloned", NULL, &job, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_replicate(c, test_pool, LSM_VOLUME_REPLICATE_CLONE, new_vol,
                             "cloned", &cloned, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     /* lsmVolumeReplicateRangeBlockSize */
     rc = lsm_volume_replicate_range_block_size(c, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     /* lsmVolumeReplicateRange */
     rc = lsm_volume_replicate_range(c, LSM_VOLUME_REPLICATE_CLONE, NULL, NULL,
                                     NULL, 0, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_replicate_range(c, LSM_VOLUME_REPLICATE_CLONE, new_vol,
                                     NULL, NULL, 0, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_replicate_range(c, LSM_VOLUME_REPLICATE_CLONE, new_vol, new_vol,
                                     NULL, 1, &job, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     rc = lsm_volume_enable(c, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_disable(c, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     /* lsmAccessGroupCreate */
@@ -1663,104 +1695,104 @@ START_TEST(test_invalid_input)
     system = get_system(c);
 
     rc = lsm_access_group_create(c, NULL, NULL, 0, system, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_access_group_create(c, "my_group", ISCSI_HOST[0], LSM_ACCESS_GROUP_INIT_TYPE_OTHER,
                                 NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     rc = lsm_access_group_create(c, "my_group", ISCSI_HOST[0], LSM_ACCESS_GROUP_INIT_TYPE_OTHER,
                                 system, &ag, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_OK, "rc = %d", rc);
-    fail_unless(ag != NULL);
+    ck_assert_msg(rc == LSM_ERR_OK, "rc = %d", rc);
+    ck_assert_msg(ag != NULL, "ag = %p", ag);
 
 
     /* lsmAccessGroupDel */
     rc = lsm_access_group_delete(c, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     /* lsmAccessGroupInitiatorAdd */
     rc = lsm_access_group_initiator_add(c, NULL, NULL, 0, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     rc = lsm_access_group_initiator_delete(c, NULL, NULL, 0, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_access_group_initiator_delete(c, ag, NULL,
                         LSM_ACCESS_GROUP_INIT_TYPE_OTHER, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
 
     rc = lsm_volume_mask(c, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_mask(c, ag, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_unmask(c, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_unmask(c, ag, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     /* lsmVolumesAccessibleByAccessGroup */
     rc = lsm_volumes_accessible_by_access_group(c, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volumes_accessible_by_access_group(c, ag, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     /* lsmAccessGroupsGrantedToVolume */
     rc = lsm_access_groups_granted_to_volume(c, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_access_groups_granted_to_volume(c, new_vol, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     /* lsmVolumeChildDependency */
     rc = lsm_volume_child_dependency(c, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_child_dependency(c, new_vol, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     /*lsmVolumeChildDependencyDelete*/
     rc = lsm_volume_child_dependency_delete(c, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_volume_child_dependency_delete(c, new_vol, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     /* lsmSystemList */
     lsm_system **systems = NULL;
     rc = lsm_system_list(c, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     rc = lsm_system_list(c, &systems, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     /* lsmFsList */
     rc = lsm_fs_list(c, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     lsm_fs **fsl = NULL;
     rc = lsm_fs_list(c, NULL, NULL, &fsl, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_list(c, "bogus_key", "nope", &fsl, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_UNSUPPORTED_SEARCH_KEY, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_UNSUPPORTED_SEARCH_KEY, "rc = %d", rc);
 
     /*lsmFsCreate*/
     rc = lsm_fs_create(c, NULL, NULL, 0, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_create(c, test_pool, NULL, 0, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     lsm_fs *arg_fs = NULL;
     rc = lsm_fs_create(c, test_pool, "argument_fs", 10000000, &arg_fs, &job,
@@ -1769,75 +1801,75 @@ START_TEST(test_invalid_input)
     if( LSM_ERR_JOB_STARTED == rc ) {
         arg_fs = wait_for_job_fs(c, &job);
     } else {
-        fail_unless(LSM_ERR_OK == rc, "rc = %d", rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc = %d", rc);
     }
 
     /* lsmFsDelete */
     rc = lsm_fs_delete(c, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_delete(c, arg_fs, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     /* lsmFsResize */
     rc = lsm_fs_resize(c, NULL, 0, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_resize(c, arg_fs, 0, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     /* lsmFsClone */
     rc = lsm_fs_clone(c, NULL, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_clone(c, arg_fs, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     /*lsmFsFileClone*/
     rc = lsm_fs_file_clone(c, NULL, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_file_clone(c, arg_fs, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     rc = lsm_fs_child_dependency(c, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     lsm_string_list *badf = (lsm_string_list *)&bad;
     rc = lsm_fs_child_dependency(c, arg_fs, badf, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     lsm_string_list *f = lsm_string_list_alloc(1);
     rc = lsm_fs_child_dependency(c, arg_fs, f, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     /*lsmFsChildDependencyDelete*/
     rc = lsm_fs_child_dependency_delete(c, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_child_dependency_delete(c, arg_fs, badf, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_child_dependency_delete(c, arg_fs, f, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
 
     rc = lsm_fs_ss_list(c, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     rc = lsm_fs_ss_list(c, arg_fs, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     rc = lsm_fs_ss_create(c, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_ss_create(c, arg_fs, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     lsm_fs_ss *arg_ss = NULL;
 
@@ -1847,88 +1879,88 @@ START_TEST(test_invalid_input)
     if( LSM_ERR_JOB_STARTED == rc ) {
         arg_ss = wait_for_job_ss(c, &job);
     } else {
-        fail_unless(rc == LSM_ERR_OK, "rc = %d", rc);
+        ck_assert_msg(rc == LSM_ERR_OK, "rc = %d", rc);
     }
 
     rc = lsm_fs_ss_delete(c, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_ss_delete(c, arg_fs, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_ss_delete(c, arg_fs, arg_ss, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     rc = lsm_fs_ss_restore(c, NULL, NULL, NULL, NULL, 0, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_ss_restore(c, arg_fs, NULL, NULL, NULL, 0, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_ss_restore(c, arg_fs, arg_ss, badf, NULL, 0, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_ss_restore(c, arg_fs, arg_ss, badf, badf, 0, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_fs_ss_restore(c, arg_fs, arg_ss, f, f, 0, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_nfs_list(c, NULL, NULL, NULL, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     rc = lsm_access_group_record_free(ag);
     ag = NULL;
-    fail_unless(LSM_ERR_OK == rc, "%d", rc);
+    ck_assert_msg(LSM_ERR_OK == rc, "%d", rc);
 
     rc = lsm_fs_ss_record_free(arg_ss);
-    fail_unless(LSM_ERR_OK == rc, "%d", rc);
+    ck_assert_msg(LSM_ERR_OK == rc, "%d", rc);
     arg_ss = NULL;
 
     rc = lsm_fs_record_free(arg_fs);
-    fail_unless(LSM_ERR_OK == rc, "%d", rc);
+    ck_assert_msg(LSM_ERR_OK == rc, "%d", rc);
     arg_fs = NULL;
 
     rc = lsm_nfs_export_fs(c, NULL, NULL, NULL, NULL, NULL, 0,0,NULL, NULL, NULL,
                         LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_nfs_export_fs(c, NULL, NULL, badf, NULL, NULL, 0,0,NULL, NULL, NULL,
                         LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_nfs_export_fs(c, NULL, NULL, f, badf, NULL, 0,0,NULL, NULL, NULL,
                         LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_nfs_export_fs(c, NULL, NULL, f, f, badf, 0,0,NULL, NULL, NULL,
                         LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     rc = lsm_nfs_export_fs(c, NULL, NULL, f, f, f, 0,0, NULL, NULL, NULL,
                         LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
     rc = lsm_nfs_export_delete(c, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT, "rc = %d", rc);
 
 
     rc = lsm_volume_record_free(new_vol);
     new_vol = NULL;
-    fail_unless(rc == LSM_ERR_OK, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_OK, "rc = %d", rc);
 
     rc = lsm_volume_record_free(resized);
     resized = NULL;
-    fail_unless(rc == LSM_ERR_OK, "rc = %d", rc);
+    ck_assert_msg(rc == LSM_ERR_OK, "rc = %d", rc);
 
     rc = lsm_system_record_array_free(sys, num_systems);
-    fail_unless(LSM_ERR_OK == rc, "%d", rc);
+    ck_assert_msg(LSM_ERR_OK == rc, "%d", rc);
 
     rc = lsm_pool_record_free(test_pool);
-    fail_unless(LSM_ERR_OK == rc, "%d", rc);
+    ck_assert_msg(LSM_ERR_OK == rc, "%d", rc);
 
     G(rc, lsm_system_record_free, system );
     system = NULL;
@@ -1943,9 +1975,9 @@ static void cap_test( lsm_storage_capabilities *cap,  lsm_capability_type t)
     lsm_capability_value_type supported;
     supported = lsm_capability_get(cap, t);
 
-    fail_unless ( lsm_capability_supported(cap, t) != 0,
+    ck_assert_msg ( lsm_capability_supported(cap, t) != 0,
             "lsm_capability_supported returned unsupported");
-    fail_unless( supported == LSM_CAP_SUPPORTED,
+    ck_assert_msg( supported == LSM_CAP_SUPPORTED,
                     "supported = %d for %d", supported, t);
 }
 
@@ -1958,7 +1990,7 @@ START_TEST(test_capabilities)
     lsm_storage_capabilities *cap = NULL;
 
     G(rc, lsm_system_list, c, &sys, &sys_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless( sys_count >= 1, "count = %d", sys_count);
+    ck_assert_msg( sys_count >= 1, "count = %d", sys_count);
 
     if( sys_count > 0 ) {
         G(rc, lsm_capabilities, c, sys[0], &cap, LSM_CLIENT_FLAG_RSVD);
@@ -2032,7 +2064,7 @@ START_TEST(test_iscsi_auth_in)
             LSM_CLIENT_FLAG_RSVD);
     printf("lsm_access_group_create() OK\n");
 
-    fail_unless(LSM_ERR_OK == rc, "rc = %d", rc);
+    ck_assert_msg(LSM_ERR_OK == rc, "rc = %d", rc);
     G(rc, lsm_system_record_free, system);
     printf("lsm_system_record_free() OK\n");
 
@@ -2044,11 +2076,11 @@ START_TEST(test_iscsi_auth_in)
             c, ISCSI_HOST[0], "username", "secret", NULL, NULL,
             LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(LSM_ERR_OK == rc, "rc = %d", rc);
+        ck_assert_msg(LSM_ERR_OK == rc, "rc = %d", rc);
 
         rc = lsm_access_group_delete(c, group, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(LSM_ERR_OK == rc );
+        ck_assert_msg(LSM_ERR_OK == rc, "rc = %d", rc);
 
         lsm_access_group_record_free(group);
         group = NULL;
@@ -2071,13 +2103,13 @@ START_TEST(test_plugin_info)
     }
 
     rc = lsm_plugin_info_get(NULL, &desc, &version, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc = %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc = %d", rc);
 
     rc = lsm_plugin_info_get(c, NULL, &version, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc = %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc = %d", rc);
 
     rc = lsm_plugin_info_get(c, &desc, NULL, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(LSM_ERR_INVALID_ARGUMENT == rc, "rc = %d", rc);
+    ck_assert_msg(LSM_ERR_INVALID_ARGUMENT == rc, "rc = %d", rc);
 }
 END_TEST
 
@@ -2089,14 +2121,14 @@ START_TEST(test_system_fw_version)
     uint32_t sys_count = 0;
 
     G(rc, lsm_system_list, c, &sys, &sys_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(sys_count >= 1, "count = %d", sys_count);
+    ck_assert_msg(sys_count >= 1, "count = %d", sys_count);
 
     fw_ver = lsm_system_fw_version_get(sys[0]);
-    fail_unless(fw_ver != NULL, "Got unexpected NULL return from "
+    ck_assert_msg(fw_ver != NULL, "Got unexpected NULL return from "
                 "lsm_system_fw_version_get()");
 
     fw_ver = lsm_system_fw_version_get(NULL);
-    fail_unless(fw_ver == NULL, "Got unexpected non-NULL return from "
+    ck_assert_msg(fw_ver == NULL, "Got unexpected non-NULL return from "
                 "lsm_system_fw_version_get(NULL)");
 
     lsm_system_record_array_free(sys, sys_count);
@@ -2111,16 +2143,16 @@ START_TEST(test_system_mode)
     uint32_t sys_count = 0;
 
     G(rc, lsm_system_list, c, &sys, &sys_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(sys_count >= 1, "count = %d", sys_count);
+    ck_assert_msg(sys_count >= 1, "count = %d", sys_count);
 
     mode = lsm_system_mode_get(sys[0]);
 
-    fail_unless(mode != LSM_SYSTEM_MODE_UNKNOWN,
+    ck_assert_msg(mode != LSM_SYSTEM_MODE_UNKNOWN,
                 "Got unexpected LSM_SYSTEM_MODE_UNKNOWN from "
                 "lsm_system_mode_get()");
 
     mode = lsm_system_mode_get(NULL);
-    fail_unless(mode == LSM_SYSTEM_MODE_UNKNOWN,
+    ck_assert_msg(mode == LSM_SYSTEM_MODE_UNKNOWN,
                 "Got unexpected return %d from "
                 "lsm_system_mode_get(NULL)", mode);
 
@@ -2136,15 +2168,15 @@ START_TEST(test_read_cache_pct)
     uint32_t sys_count = 0;
 
     G(rc, lsm_system_list, c, &sys, &sys_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(sys_count >= 1, "count = %d", sys_count);
+    ck_assert_msg(sys_count >= 1, "count = %d", sys_count);
 
     read_cache_pct = lsm_system_read_cache_pct_get(sys[0]);
 
-    fail_unless(read_cache_pct >= 0,
+    ck_assert_msg(read_cache_pct >= 0,
                 "Read cache should bigger that 0, but got %d", read_cache_pct);
 
     read_cache_pct = lsm_system_read_cache_pct_get(NULL);
-    fail_unless(LSM_SYSTEM_READ_CACHE_PCT_UNKNOWN == read_cache_pct,
+    ck_assert_msg(LSM_SYSTEM_READ_CACHE_PCT_UNKNOWN == read_cache_pct,
                 "When input system pointer is NULL, "
                 "lsm_system_read_cache_pct_get() should return "
                 "LSM_SYSTEM_READ_CACHE_PCT_UNKNOWN, but got %d",
@@ -2162,30 +2194,30 @@ START_TEST(test_read_cache_pct_update)
     int pct = 0;
 
     G(rc, lsm_system_list, c, &sys, &sys_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless( sys_count >= 1, "count = %d", sys_count);
+    ck_assert_msg( sys_count >= 1, "count = %d", sys_count);
 
     G(rc, lsm_system_read_cache_pct_update, c, sys[0], 100,
       LSM_CLIENT_FLAG_RSVD);
     lsm_system_record_array_free(sys, sys_count);
     G(rc, lsm_system_list, c, &sys, &sys_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless( sys_count >= 1, "count = %d", sys_count);
+    ck_assert_msg( sys_count >= 1, "count = %d", sys_count);
 
     pct = lsm_system_read_cache_pct_get(sys[0]);
     printf("Got pct %d\n", pct);
-    fail_unless(pct == 100, "Failed to set system read cache to 100, got %d, "
+    ck_assert_msg(pct == 100, "Failed to set system read cache to 100, got %d, "
                 "but got error message.", pct);
 
     printf("Read cache percentage changed\n");
 
     /* Test INVALID argument */
     rc = lsm_system_read_cache_pct_update(c, sys[0], -1, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expecting LSM_ERR_INVALID_ARGUMENT, but got %d", rc);
     rc = lsm_system_read_cache_pct_update(c, sys[0], 101, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expecting LSM_ERR_INVALID_ARGUMENT, but got %d", rc);
     rc = lsm_system_read_cache_pct_update(c, NULL, 10, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expecting LSM_ERR_INVALID_ARGUMENT, but got %d", rc);
 
     lsm_system_record_array_free(sys, sys_count);
@@ -2205,7 +2237,7 @@ START_TEST(test_get_available_plugins)
     num = lsm_string_list_size(plugins);
     for( i = 0; i < num; i++) {
         const char *info = lsm_string_list_elem_get(plugins, i);
-        fail_unless(strlen(info) > 0);
+        ck_assert_msg(strlen(info) > 0, "%lu", strlen(info));
         printf("%s\n", info);
     }
 
@@ -2227,19 +2259,21 @@ START_TEST(test_error_reporting)
                                         exception, debug_msg,
                                         d, sizeof(d));
 
-    fail_unless(e != NULL);
+    ck_assert_msg(e != NULL, "%p", e);
 
     if( e ) {
-        fail_unless(LSM_ERR_LIB_BUG == lsm_error_number_get(e));
-        fail_unless(strcmp(msg, lsm_error_message_get(e)) == 0);
-        fail_unless(strcmp(exception, lsm_error_exception_get(e)) == 0);
-        fail_unless(strcmp(debug_msg, lsm_error_debug_get(e)) == 0);
+        ck_assert_msg(LSM_ERR_LIB_BUG == lsm_error_number_get(e), "%d",
+                      lsm_error_number_get(e));
+        ASSERT_STR_MATCH(msg, lsm_error_message_get(e));
+        ASSERT_STR_MATCH(exception, lsm_error_exception_get(e));
+        ASSERT_STR_MATCH(debug_msg, lsm_error_debug_get(e));
         debug_data = lsm_error_debug_data_get(e, &debug_size);
-        fail_unless(debug_data != NULL);
-        fail_unless(debug_size == sizeof(d));
+        ck_assert_msg(debug_data != NULL, "%p", debug_data);
+        ck_assert_msg(debug_size == sizeof(d), "%u", debug_size);
         if (debug_data && (debug_size == sizeof(d)))
-            fail_unless(memcmp(d, debug_data, debug_size) == 0);
-        fail_unless( LSM_ERR_OK == lsm_error_free(e) );
+            ck_assert_msg(memcmp(d, debug_data, debug_size) == 0, "memcmp fail");
+        int free_rc = lsm_error_free(e);
+        ck_assert_msg( LSM_ERR_OK == free_rc, "%d", free_rc);
     }
 }
 END_TEST
@@ -2295,7 +2329,7 @@ START_TEST(test_capability)
 
     lsm_storage_capabilities *cap = lsm_capability_record_alloc(NULL);
 
-    fail_unless(cap != NULL);
+    ck_assert_msg(cap != NULL, "cap = %p", cap);
 
     if( cap ) {
         G(rc, lsm_capability_set_n, cap, LSM_CAP_SUPPORTED,
@@ -2352,8 +2386,9 @@ START_TEST(test_capability)
             i < sizeof(expected_present)/sizeof(expected_present[0]);
             ++i) {
 
-            fail_unless( lsm_capability_get(cap, expected_present[i]) ==
-                            LSM_CAP_SUPPORTED);
+            ck_assert_msg( lsm_capability_get(cap, expected_present[i]) ==
+                            LSM_CAP_SUPPORTED, "%d",
+                            (int)lsm_capability_get(cap, expected_present[i]));
         }
 
         G(rc, lsm_capability_record_free, cap);
@@ -2397,40 +2432,44 @@ START_TEST(test_nfs_export_funcs)
     lsm_nfs_export *copy = lsm_nfs_export_record_copy(export);
 
 
-    fail_unless( strcmp(lsm_nfs_export_id_get(copy), id) == 0 );
-    fail_unless( strcmp(lsm_nfs_export_fs_id_get(copy), fs_id) == 0);
-    fail_unless( strcmp(lsm_nfs_export_export_path_get(copy), export_path) == 0);
-    fail_unless( strcmp(lsm_nfs_export_auth_type_get(copy), auth) == 0);
-    fail_unless( strcmp(lsm_nfs_export_options_get(copy), options) == 0);
-    fail_unless( lsm_nfs_export_anon_uid_get(copy) == anonuid);
-    fail_unless( lsm_nfs_export_anon_gid_get(copy) == anongid);
+    ASSERT_STR_MATCH(lsm_nfs_export_id_get(copy), id);
+    ASSERT_STR_MATCH(lsm_nfs_export_fs_id_get(copy), fs_id);
+    ASSERT_STR_MATCH(lsm_nfs_export_export_path_get(copy), export_path);
+    ASSERT_STR_MATCH(lsm_nfs_export_auth_type_get(copy), auth);
+    ASSERT_STR_MATCH(lsm_nfs_export_options_get(copy), options);
+    
+    ck_assert_msg( lsm_nfs_export_anon_uid_get(copy) == anonuid, "%lu", lsm_nfs_export_anon_uid_get(copy));
+    ck_assert_msg( lsm_nfs_export_anon_gid_get(copy) == anongid, "%lu", lsm_nfs_export_anon_gid_get(copy));
 
-    fail_unless(compare_string_lists(lsm_nfs_export_root_get(export), lsm_nfs_export_root_get(copy)) == 0);
-    fail_unless(compare_string_lists(lsm_nfs_export_read_write_get(export), lsm_nfs_export_read_write_get(copy)) == 0);
-    fail_unless(compare_string_lists(lsm_nfs_export_read_only_get(export), lsm_nfs_export_read_only_get(copy)) == 0);
+    ck_assert_msg(compare_string_lists(lsm_nfs_export_root_get(export),
+                  lsm_nfs_export_root_get(copy)) == 0, "lists failed to compare");
+    ck_assert_msg(compare_string_lists(lsm_nfs_export_read_write_get(export),
+                  lsm_nfs_export_read_write_get(copy)) == 0, "lists failed to compare");
+    ck_assert_msg(compare_string_lists(lsm_nfs_export_read_only_get(export),
+                  lsm_nfs_export_read_only_get(copy)) == 0, "lists failed to compare");
 
     G(rc, lsm_nfs_export_record_free, copy);
 
 
     generate_random(rstring, sizeof(rstring));
     G(rc, lsm_nfs_export_id_set, export, rstring);
-    fail_unless( strcmp(lsm_nfs_export_id_get(export), rstring) == 0 );
-
+    ASSERT_STR_MATCH(lsm_nfs_export_id_get(export), rstring);
+ 
     generate_random(rstring, sizeof(rstring));
     G(rc, lsm_nfs_export_fs_id_set, export, rstring);
-    fail_unless( strcmp(lsm_nfs_export_fs_id_get(export), rstring) == 0 );
+    ASSERT_STR_MATCH(lsm_nfs_export_fs_id_get(export), rstring);
 
     generate_random(rstring, sizeof(rstring));
     G(rc, lsm_nfs_export_export_path_set, export, rstring);
-    fail_unless( strcmp(lsm_nfs_export_export_path_get(export), rstring) == 0 );
+    ASSERT_STR_MATCH(lsm_nfs_export_export_path_get(export), rstring);
 
     generate_random(rstring, sizeof(rstring));
     G(rc, lsm_nfs_export_auth_type_set, export, rstring);
-    fail_unless( strcmp(lsm_nfs_export_auth_type_get(export), rstring) == 0 );
+    ASSERT_STR_MATCH(lsm_nfs_export_auth_type_get(export), rstring);
 
     generate_random(rstring, sizeof(rstring));
     G(rc, lsm_nfs_export_options_set, export, rstring);
-    fail_unless( strcmp(lsm_nfs_export_options_get(export), rstring) == 0 );
+    ASSERT_STR_MATCH(lsm_nfs_export_options_get(export), rstring);
 
     anonuid = anonuid + 700;
     G(rc, lsm_nfs_export_anon_uid_set, export, anonuid);
@@ -2438,24 +2477,29 @@ START_TEST(test_nfs_export_funcs)
     anongid = anongid + 400;
     G(rc, lsm_nfs_export_anon_gid_set, export, anongid);
 
-    fail_unless(lsm_nfs_export_anon_uid_get(export) == anonuid);
-    fail_unless(lsm_nfs_export_anon_gid_get(export) == anongid);
+    ck_assert_msg(lsm_nfs_export_anon_uid_get(export) == anonuid, "%lu",
+                  lsm_nfs_export_anon_uid_get(export));
+    ck_assert_msg(lsm_nfs_export_anon_gid_get(export) == anongid, "%lu",
+                  lsm_nfs_export_anon_gid_get(export));
 
 
     generate_random(rstring, sizeof(rstring));
     G(rc, lsm_string_list_append, rand, rstring);
     G(rc, lsm_nfs_export_root_set, export, rand);
-    fail_unless(compare_string_lists(lsm_nfs_export_root_get(export), rand) == 0);
+    ck_assert_msg(compare_string_lists(lsm_nfs_export_root_get(export), rand) == 0,
+                  "lists failed to compare");
 
     generate_random(rstring, sizeof(rstring));
     G(rc, lsm_string_list_append, rand, rstring);
     G(rc, lsm_nfs_export_read_write_set, export, rand);
-    fail_unless(compare_string_lists(lsm_nfs_export_read_write_get(export), rand) == 0);
+    ck_assert_msg(compare_string_lists(lsm_nfs_export_read_write_get(export), rand) == 0,
+                  "lists failed to compare");
 
     generate_random(rstring, sizeof(rstring));
     G(rc, lsm_string_list_append, rand, rstring);
     G(rc, lsm_nfs_export_read_only_set, export, rand);
-    fail_unless(compare_string_lists(lsm_nfs_export_read_only_get(export), rand) == 0);
+    ck_assert_msg(compare_string_lists(lsm_nfs_export_read_only_get(export), rand) == 0,
+                  "lists failed to compare");
 
 
     G(rc, lsm_nfs_export_record_free, export);
@@ -2486,15 +2530,15 @@ START_TEST(test_uri_parse)
     G(rc, lsm_uri_parse, uri_g, &scheme, &user, &server, &port, &path, &qp);
 
     if( LSM_ERR_OK == rc ) {
-        fail_unless(strcmp(scheme, "sim") == 0, "%s", scheme);
-        fail_unless(strcmp(user, "user") == 0, "%s", user);
-        fail_unless(strcmp(server, "host") == 0, "%s", server);
-        fail_unless(strcmp(path, "/path/") == 0, "%s", path);
-        fail_unless(port == 123, "%d", port);
+        ck_assert_msg(strcmp(scheme, "sim") == 0, "%s", scheme);
+        ck_assert_msg(strcmp(user, "user") == 0, "%s", user);
+        ck_assert_msg(strcmp(server, "host") == 0, "%s", server);
+        ck_assert_msg(strcmp(path, "/path/") == 0, "%s", path);
+        ck_assert_msg(port == 123, "%d", port);
 
-        fail_unless(qp != NULL);
+        ck_assert_msg(qp != NULL, "qp = %p", qp);
         if( qp ) {
-            fail_unless(strcmp("root/uber",
+            ck_assert_msg(strcmp("root/uber",
                         lsm_hash_string_get(qp, "namespace")) == 0,
                         "%s", lsm_hash_string_get(qp, "namespace"));
         }
@@ -2517,15 +2561,15 @@ START_TEST(test_uri_parse)
             &qp);
 
     if( LSM_ERR_OK == rc ) {
-        fail_unless(strcmp(scheme, "smis") == 0, "%s", scheme);
-        fail_unless(strcmp(user, "user") == 0, "%s", user);
-        fail_unless(strcmp(server, "host") == 0, "%s", server);
-        fail_unless(path == NULL, "%s", path);
-        fail_unless(port == 0, "%d", port);
+        ck_assert_msg(strcmp(scheme, "smis") == 0, "%s", scheme);
+        ck_assert_msg(strcmp(user, "user") == 0, "%s", user);
+        ck_assert_msg(strcmp(server, "host") == 0, "%s", server);
+        ck_assert_msg(path == NULL, "%s", path);
+        ck_assert_msg(port == 0, "%d", port);
 
-        fail_unless(qp != NULL);
+        ck_assert_msg(qp != NULL, "qp = %p", qp);
         if( qp ) {
-            fail_unless(strcmp("root/emc",
+            ck_assert_msg(strcmp("root/emc",
                         lsm_hash_string_get(qp, "namespace")) == 0,
                         "%s", lsm_hash_string_get(qp, "namespace"));
         }
@@ -2557,7 +2601,7 @@ START_TEST(test_search_pools)
         G(rc, lsm_pool_list, c, "id", lsm_pool_id_get(pools[0]), &search_pools,
                     &search_count, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(search_count == 1, "Expecting 1 pool, got %d", search_count);
+        ck_assert_msg(search_count == 1, "Expecting 1 pool, got %d", search_count);
 
         G(rc, lsm_pool_record_array_free, search_pools, search_count);
 
@@ -2567,14 +2611,14 @@ START_TEST(test_search_pools)
 
         G(rc, lsm_pool_list, c, "id", "non-existent-id", &search_pools,
                     &search_count, LSM_CLIENT_FLAG_RSVD);
-        fail_unless(search_count == 0, "Expecting no pools! %d", search_count);
+        ck_assert_msg(search_count == 0, "Expecting no pools! %d", search_count);
 
         /* Search which results in all pools */
         G(rc, lsm_pool_list, c, "system_id", lsm_pool_system_id_get(pools[0]),
                     &search_pools,
                     &search_count, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(search_count == poolCount, "Expecting %d pools, got %d",
+        ck_assert_msg(search_count == poolCount, "Expecting %d pools, got %d",
                                 poolCount, search_count);
 
         G(rc, lsm_pool_record_array_free, search_pools, search_count);
@@ -2604,7 +2648,7 @@ START_TEST(test_search_volumes)
     G(rc, lsm_volume_list, c, NULL, NULL, &volumes, &volume_count,
             LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless(volume_count > 0, "We are expecting some volumes!");
+    ck_assert_msg(volume_count > 0, "We are expecting some volumes!");
 
     if( LSM_ERR_OK == rc && volume_count ) {
         lsm_volume **search_volume = NULL;
@@ -2614,7 +2658,7 @@ START_TEST(test_search_volumes)
                     &search_volume,
                     &search_count, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(search_count == 1, "Expecting 1 pool, got %d", search_count);
+        ck_assert_msg(search_count == 1, "Expecting 1 pool, got %d", search_count);
 
         G(rc, lsm_volume_record_array_free, search_volume, search_count);
         search_volume = NULL;
@@ -2623,7 +2667,7 @@ START_TEST(test_search_volumes)
         /* Search for non-existent */
         G(rc, lsm_volume_list, c, "id", "non-existent-id", &search_volume,
                     &search_count, LSM_CLIENT_FLAG_RSVD);
-        fail_unless(search_count == 0, "Expecting no volumes! %d", search_count);
+        ck_assert_msg(search_count == 0, "Expecting no volumes! %d", search_count);
 
         /* Search which results in all volumes */
         G(rc, lsm_volume_list, c, "system_id",
@@ -2631,7 +2675,7 @@ START_TEST(test_search_volumes)
                     &search_volume,
                     &search_count, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(search_count == volume_count, "Expecting %d volumes, got %d",
+        ck_assert_msg(search_count == volume_count, "Expecting %d volumes, got %d",
                                 volume_count, search_count);
 
         G(rc, lsm_volume_record_array_free, search_volume, search_count);
@@ -2658,7 +2702,7 @@ START_TEST(test_search_disks)
 
 
     G(rc, lsm_disk_list, c, NULL, NULL, &disks, &disk_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(disk_count > 0, "We are expecting some disks!");
+    ck_assert_msg(disk_count > 0, "We are expecting some disks!");
 
     if( LSM_ERR_OK == rc && disk_count ) {
 
@@ -2668,7 +2712,7 @@ START_TEST(test_search_disks)
         G(rc, lsm_disk_list, c, "id", lsm_disk_id_get(disks[0]),
                     &search_disks,
                     &search_count, LSM_CLIENT_FLAG_RSVD);
-        fail_unless(search_count == 1, "Expecting 1 disk, got %d", search_count);
+        ck_assert_msg(search_count == 1, "Expecting 1 disk, got %d", search_count);
 
         G(rc, lsm_disk_record_array_free, search_disks, search_count);
         search_disks = NULL;
@@ -2678,14 +2722,14 @@ START_TEST(test_search_disks)
         G(rc, lsm_disk_list, c, "id", "non-existent-id", &search_disks,
                     &search_count, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(search_count == 0, "Expecting no disks! %d", search_count);
+        ck_assert_msg(search_count == 0, "Expecting no disks! %d", search_count);
 
         /* Search which results in all disks */
         G(rc, lsm_disk_list, c, "system_id", lsm_disk_system_id_get(disks[0]),
                     &search_disks,
                     &search_count, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(search_count == disk_count, "Expecting %d disks, got %d",
+        ck_assert_msg(search_count == disk_count, "Expecting %d disks, got %d",
                                 disk_count, search_count);
 
         G(rc, lsm_disk_record_array_free, search_disks, search_count);
@@ -2710,7 +2754,7 @@ START_TEST(test_search_access_groups)
     lsm_system *system = get_system(c);
 
 
-    fail_unless(system != NULL, "Missing system!");
+    ck_assert_msg(system != NULL, "Missing system!");
 
     for( i = 0; i < 2; ++i ) {
         char ag_name[64];
@@ -2731,7 +2775,7 @@ START_TEST(test_search_access_groups)
     system = NULL;
 
     G(rc, lsm_access_group_list, c, NULL, NULL, &ag, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(count > 0, "We are expecting some access_groups!");
+    ck_assert_msg(count > 0, "We are expecting some access_groups!");
 
     if( LSM_ERR_OK == rc && count ) {
 
@@ -2741,7 +2785,7 @@ START_TEST(test_search_access_groups)
         G(rc, lsm_access_group_list, c, "id", lsm_access_group_id_get(ag[0]),
                     &search_ag,
                     &search_count, LSM_CLIENT_FLAG_RSVD);
-        fail_unless(search_count == 1, "Expecting 1 access group, got %d",
+        ck_assert_msg(search_count == 1, "Expecting 1 access group, got %d",
                     search_count);
 
         G(rc, lsm_access_group_record_array_free, search_ag, search_count);
@@ -2752,7 +2796,7 @@ START_TEST(test_search_access_groups)
 
         G(rc, lsm_access_group_list, c, "id", "non-existent-id", &search_ag,
                                     &search_count, LSM_CLIENT_FLAG_RSVD);
-        fail_unless(search_count == 0, "Expecting no access groups! %d",
+        ck_assert_msg(search_count == 0, "Expecting no access groups! %d",
                     search_count);
 
         /* Search which results in all disks */
@@ -2761,7 +2805,7 @@ START_TEST(test_search_access_groups)
                                     &search_ag,
                                     &search_count, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(search_count == count, "Expecting %d access groups, got %d",
+        ck_assert_msg(search_count == count, "Expecting %d access groups, got %d",
                     count, search_count);
 
         G(rc, lsm_access_group_record_array_free, search_ag, search_count);
@@ -2798,10 +2842,10 @@ START_TEST(test_search_fs)
         rc = lsm_fs_create(c, pool, fs_name, 50000000, &fs, &job, LSM_CLIENT_FLAG_RSVD);
 
         if( LSM_ERR_JOB_STARTED == rc ) {
-            fail_unless(NULL == fs);
+            ck_assert_msg(NULL == fs, "fs = %p", fs);
             fs = wait_for_job_fs(c, &job);
         } else {
-            fail_unless(LSM_ERR_OK == rc);
+            ck_assert_msg(LSM_ERR_OK == rc, "rc = %d", rc);
         }
 
         G(rc, lsm_fs_record_free, fs);
@@ -2809,7 +2853,7 @@ START_TEST(test_search_fs)
     }
 
     G(rc, lsm_fs_list, c, NULL, NULL, &fsl, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(count > 0, "We are expecting some file systems!");
+    ck_assert_msg(count > 0, "We are expecting some file systems!");
 
     if( LSM_ERR_OK == rc && count ) {
 
@@ -2820,7 +2864,7 @@ START_TEST(test_search_fs)
                     &search_fs,
                     &search_count, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(search_count == 1, "Expecting 1 fs, got %d",
+        ck_assert_msg(search_count == 1, "Expecting 1 fs, got %d",
                     search_count);
 
         G(rc, lsm_fs_record_array_free, search_fs, search_count);
@@ -2831,7 +2875,7 @@ START_TEST(test_search_fs)
         G(rc, lsm_fs_list, c, "id", "non-existent-id", &search_fs,
                                     &search_count, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(search_count == 0, "Expecting no fs! %d", search_count);
+        ck_assert_msg(search_count == 0, "Expecting no fs! %d", search_count);
 
         /* Search which results in all disks */
         G(rc, lsm_fs_list, c, "system_id",
@@ -2839,7 +2883,7 @@ START_TEST(test_search_fs)
                                     &search_fs,
                                     &search_count, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(search_count == count, "Expecting %d fs, got %d",
+        ck_assert_msg(search_count == count, "Expecting %d fs, got %d",
                     count, search_count);
 
         G(rc, lsm_fs_record_array_free, search_fs, search_count);
@@ -2855,9 +2899,9 @@ END_TEST
 
 static void verify_string(const char *method, const char *value)
 {
-    fail_unless(method != NULL, "%s rc is NULL", method);
+    ck_assert_msg(method != NULL, "%s rc is NULL", method);
     if( value ) {
-        fail_unless( strlen(value) > 0, "%s string len = 0", method);
+        ck_assert_msg( strlen(value) > 0, "%s string len = 0", method);
     }
 }
 
@@ -2877,7 +2921,7 @@ START_TEST(test_target_ports)
                             lsm_target_port_id_get(tp[i]));
 
             int pt = (int)lsm_target_port_type_get(tp[i]);
-            fail_unless(pt >= 0 && pt <= 4, "%d", pt);
+            ck_assert_msg(pt >= 0 && pt <= 4, "%d", pt);
 
             verify_string("lsm_target_port_service_address_get",
                             lsm_target_port_service_address_get(tp[i]));
@@ -2903,13 +2947,13 @@ START_TEST(test_target_ports)
             G(rc, lsm_target_port_list, c, "id", "does_not_exist",
                                         &search, &search_count,
                                         LSM_CLIENT_FLAG_RSVD);
-            fail_unless(search_count == 0, "%d", search_count);
+            ck_assert_msg(search_count == 0, "%d", search_count);
 
             G(rc, lsm_target_port_list, c, "system_id", "sim-01",
                                         &search, &search_count,
                                         LSM_CLIENT_FLAG_RSVD);
 
-            fail_unless(search_count == 5, "%d", search_count);
+            ck_assert_msg(search_count == 5, "%d", search_count);
             if( search_count ) {
                 G(rc, lsm_target_port_record_array_free, search, search_count);
             }
@@ -2931,8 +2975,8 @@ START_TEST(test_initiator_id_verification)
     lsm_system *system = get_system(c);
 
     G(rc, lsm_access_group_list, c, NULL, NULL, &groups, &count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless(count == 0, "Expect 0 access groups, got %"PRIu32, count);
-    fail_unless(groups == NULL);
+    ck_assert_msg(count == 0, "Expect 0 access groups, got %"PRIu32, count);
+    ck_assert_msg(groups == NULL, "groups = %p", groups);
 
     /* Test valid iqns first, then invalid */
 
@@ -3018,7 +3062,7 @@ START_TEST(test_initiator_id_verification)
             LSM_ACCESS_GROUP_INIT_TYPE_WWPN, &updated_group,
             LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expected initiator id with invalid form to fail! %d", rc);
 
     /* Test invalid iqn */
@@ -3026,7 +3070,7 @@ START_TEST(test_initiator_id_verification)
             LSM_ACCESS_GROUP_INIT_TYPE_WWPN, &updated_group,
             LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expected initiator id with invalid form to fail! %d", rc);
 
     /* Test invalid iqn */
@@ -3034,7 +3078,7 @@ START_TEST(test_initiator_id_verification)
             LSM_ACCESS_GROUP_INIT_TYPE_WWPN, &updated_group,
             LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expected initiator id with invalid form to fail! %d", rc);
 
     /* Test invalid iqn */
@@ -3042,7 +3086,7 @@ START_TEST(test_initiator_id_verification)
             LSM_ACCESS_GROUP_INIT_TYPE_WWPN, &updated_group,
             LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expected initiator id with invalid form to fail! %d", rc);
 
     /* Test invalid iqn */
@@ -3050,7 +3094,7 @@ START_TEST(test_initiator_id_verification)
             LSM_ACCESS_GROUP_INIT_TYPE_WWPN, &updated_group,
             LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expected initiator id with invalid form to fail! %d", rc);
 
     /* Delete group */
@@ -3096,7 +3140,7 @@ START_TEST(test_volume_raid_info)
         c, pool, "volume_raid_info_test", 20000000,
         LSM_VOLUME_PROVISION_DEFAULT, &volume, &job, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless( rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
+    ck_assert_msg( rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
             "lsmVolumeCreate %d (%s)", rc, error(lsm_error_last_get(c)));
 
     if( LSM_ERR_JOB_STARTED == rc ) {
@@ -3138,7 +3182,7 @@ START_TEST(test_pool_member_info)
             // Simulator user reading the member id.
             const char *cur_member_id = lsm_string_list_elem_get(
                 member_ids, y);
-            fail_unless( strlen(cur_member_id) );
+            ck_assert_msg( strlen(cur_member_id), "%ld",  strlen(cur_member_id));
         }
         lsm_string_list_free(member_ids);
     }
@@ -3153,7 +3197,7 @@ START_TEST(test_volume_raid_create_cap_get)
     uint32_t sys_count = 0;
 
     G(rc, lsm_system_list, c, &sys, &sys_count, LSM_CLIENT_FLAG_RSVD);
-    fail_unless( sys_count >= 1, "count = %d", sys_count);
+    ck_assert_msg( sys_count >= 1, "count = %d", sys_count);
 
     if( sys_count > 0 ) {
         uint32_t *supported_raid_types = NULL;
@@ -3196,7 +3240,7 @@ START_TEST(test_volume_raid_create)
             }
         }
     }
-    fail_unless(free_disk_count == 2, "Failed to find two free disks");
+    ck_assert_msg(free_disk_count == 2, "Failed to find two free disks");
 
     lsm_volume *new_volume = NULL;
 
@@ -3208,7 +3252,7 @@ START_TEST(test_volume_raid_create)
     int del_rc = lsm_volume_delete(
         c, new_volume, &job_del, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless( del_rc == LSM_ERR_OK || del_rc == LSM_ERR_JOB_STARTED,
+    ck_assert_msg( del_rc == LSM_ERR_OK || del_rc == LSM_ERR_JOB_STARTED,
                 "lsm_volume_delete %d (%s)", rc, error(lsm_error_last_get(c)));
 
     if( LSM_ERR_JOB_STARTED == del_rc ) {
@@ -3224,7 +3268,7 @@ START_TEST(test_volume_raid_create)
         rc, lsm_pool_list, c, "id", lsm_volume_pool_id_get(new_volume),
         &pools, &count, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless(
+    ck_assert_msg(
         count == 0,
         "New HW RAID pool still exists, it should be deleted along with "
         "lsm_volume_delete()");
@@ -3245,7 +3289,7 @@ START_TEST(test_volume_ident_led_on)
         c, pool, "volume_raid_info_test", 20000000,
         LSM_VOLUME_PROVISION_DEFAULT, &volume, &job, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless( rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
+    ck_assert_msg( rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
             "lsmVolumeCreate %d (%s)", rc, error(lsm_error_last_get(c)));
 
     if( LSM_ERR_JOB_STARTED == rc ) {
@@ -3272,7 +3316,7 @@ START_TEST(test_volume_ident_led_off)
         c, pool, "volume_raid_info_test", 20000000,
         LSM_VOLUME_PROVISION_DEFAULT, &volume, &job, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless( rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
+    ck_assert_msg( rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
             "lsmVolumeCreate %d (%s)", rc, error(lsm_error_last_get(c)));
 
     if( LSM_ERR_JOB_STARTED == rc ) {
@@ -3307,8 +3351,8 @@ START_TEST(test_local_disk_list)
     rc = lsm_local_disk_list(&disk_paths, &lsm_err);
     if (lsm_err)
         lsm_error_free(lsm_err);
-    fail_unless(rc == LSM_ERR_OK, "lsm_local_disk_list() failed as %d", rc);
-    fail_unless(disk_paths != NULL, "lsm_local_disk_list() return NULL for "
+    ck_assert_msg(rc == LSM_ERR_OK, "lsm_local_disk_list() failed as %d", rc);
+    ck_assert_msg(disk_paths != NULL, "lsm_local_disk_list() return NULL for "
                 "disk_paths");
     lsm_string_list_free(disk_paths);
 }
@@ -3330,60 +3374,60 @@ START_TEST(test_local_disk_vpd83_search)
     }
 
     rc = lsm_local_disk_vpd83_search(NULL, &disk_path_list, &lsm_err);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_vpd83_search(): Expecting "
                 "LSM_ERR_INVALID_ARGUMENT when vpd83 argument pointer is NULL");
 
-    fail_unless(disk_path_list == NULL,
+    ck_assert_msg(disk_path_list == NULL,
                 "lsm_local_disk_vpd83_search(): Expecting "
                 "disk_path_list been set as NULL.");
 
-    fail_unless(lsm_err != NULL,
+    ck_assert_msg(lsm_err != NULL,
                 "lsm_local_disk_vpd83_search(): Expecting "
                 "lsm_err been set as non-NULL.");
-    fail_unless(lsm_error_number_get(lsm_err) == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(lsm_error_number_get(lsm_err) == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_vpd83_search(): Expecting "
                 "lsm_err been set with LSM_ERR_INVALID_ARGUMENT");
-    fail_unless(lsm_error_message_get(lsm_err) != NULL,
+    ck_assert_msg(lsm_error_message_get(lsm_err) != NULL,
                 "lsm_local_disk_vpd83_search(): Expecting "
                 "lsm_err been set with non-NULL error message");
     lsm_error_free(lsm_err);
 
 
     rc = lsm_local_disk_vpd83_search(VPD83_TO_SEARCH, NULL, &lsm_err);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_vpd83_search(): Expecting "
                 "LSM_ERR_INVALID_ARGUMENT when disk_path_list argument pointer "
                 "is NULL");
     lsm_error_free(lsm_err);
 
     rc = lsm_local_disk_vpd83_search(VPD83_TO_SEARCH, &disk_path_list, NULL);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_vpd83_search(): Expecting "
                 "LSM_ERR_INVALID_ARGUMENT when lsm_err argument pointer "
                 "is NULL");
 
     rc = lsm_local_disk_vpd83_search(INVALID_VPD83, &disk_path_list, &lsm_err);
-    fail_unless(lsm_err != NULL,
+    ck_assert_msg(lsm_err != NULL,
                 "lsm_local_disk_vpd83_search(): Expecting lsm_err "
                 "been set at not NULL when incorrect VPD83 provided");
-    fail_unless(lsm_error_number_get(lsm_err) == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(lsm_error_number_get(lsm_err) == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_vpd83_search(): Expecting "
                 "lsm_err been set with LSM_ERR_INVALID_ARGUMENT");
-    fail_unless(lsm_error_message_get(lsm_err) != NULL,
+    ck_assert_msg(lsm_error_message_get(lsm_err) != NULL,
                 "lsm_local_disk_vpd83_search(): Expecting "
                 "lsm_err been set with non-NULL error message");
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_vpd83_search(): Expecting LSM_ERR_OK "
                 "when no argument is NULL");
     lsm_error_free(lsm_err);
 
     rc = lsm_local_disk_vpd83_search(VPD83_TO_SEARCH, &disk_path_list, &lsm_err);
-    fail_unless(rc == LSM_ERR_OK,
+    ck_assert_msg(rc == LSM_ERR_OK,
                 "lsm_local_disk_vpd83_search(): Expecting LSM_ERR_OK"
                 "when no argument is NULL");
 
-    fail_unless(lsm_err == NULL,
+    ck_assert_msg(lsm_err == NULL,
                 "lsm_local_disk_vpd83_search(): Expecting lsm_err as NULL"
                 "when valid argument provided");
 
@@ -3398,22 +3442,22 @@ START_TEST(test_local_disk_vpd83_search)
 
     rc = lsm_local_disk_vpd83_search(VALID_BUT_NOT_EXIST_VPD83, &disk_path_list,
                                       &lsm_err);
-    fail_unless(rc == LSM_ERR_OK,
+    ck_assert_msg(rc == LSM_ERR_OK,
                 "lsm_local_disk_vpd83_search(): Expecting LSM_ERR_OK"
                 "when no argument is NULL");
-    fail_unless(lsm_err == NULL,
+    ck_assert_msg(lsm_err == NULL,
                 "lsm_local_disk_vpd83_search(): Expecting lsm_err as NULL"
                 "when valid argument provided");
-    fail_unless(disk_path_list == NULL,
+    ck_assert_msg(disk_path_list == NULL,
                 "lsm_local_disk_vpd83_search(): Expecting disk_path_list as "
                 "NULL when searching for VALID_BUT_NOT_EXIST_VPD83");
 
     if (lsm_err != NULL)
         lsm_error_free(lsm_err);
-        /* ^ Just to trick coverity scan. The 'fail_unless' already quit */
+        /* ^ Just to trick coverity scan. The 'ck_assert_msg' already quit */
     if (disk_path_list != NULL)
         lsm_string_list_free(disk_path_list);
-        /* ^ Just to trick coverity scan. The 'fail_unless' already quit */
+        /* ^ Just to trick coverity scan. The 'ck_assert_msg' already quit */
 }
 END_TEST
 
@@ -3426,33 +3470,33 @@ START_TEST(test_local_disk_serial_num_get)
 
     rc = lsm_local_disk_serial_num_get(NULL, &serial_num, &lsm_err);
 
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_serial_num_get(): Expecting "
                 "LSM_ERR_INVALID_ARGUMENT when input is NULL");
-    fail_unless(serial_num == NULL,
+    ck_assert_msg(serial_num == NULL,
                 "lsm_local_disk_serial_num_get(): Expecting "
                 "serial_num been set as NULL.");
-    fail_unless(lsm_err != NULL,
+    ck_assert_msg(lsm_err != NULL,
                 "lsm_local_disk_serial_num_get(): Expecting "
                 "lsm_err been set as non-NULL.");
-    fail_unless(lsm_error_number_get(lsm_err) == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(lsm_error_number_get(lsm_err) == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_serial_num_get(): Expecting "
                 "lsm_err been set with LSM_ERR_INVALID_ARGUMENT");
-    fail_unless(lsm_error_message_get(lsm_err) != NULL,
+    ck_assert_msg(lsm_error_message_get(lsm_err) != NULL,
                 "lsm_local_disk_serial_num_get(): Expecting "
                 "lsm_err been set with non-NULL error message");
     lsm_error_free(lsm_err);
 
     rc = lsm_local_disk_serial_num_get("/dev/sda", NULL, &lsm_err);
 
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_serial_num_get(): Expecting "
                 "LSM_ERR_INVALID_ARGUMENT when input is NULL");
     lsm_error_free(lsm_err);
 
     rc = lsm_local_disk_serial_num_get("/dev/sda", &serial_num, NULL);
 
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_serial_num_get(): Expecting "
                 "LSM_ERR_INVALID_ARGUMENT when lsm_err is NULL");
 
@@ -3465,19 +3509,19 @@ START_TEST(test_local_disk_serial_num_get)
     /* Test nonexistent disk */
     rc = lsm_local_disk_serial_num_get(NOT_EXIST_SD_PATH, &serial_num,
                                        &lsm_err);
-    fail_unless(rc == LSM_ERR_NOT_FOUND_DISK,
+    ck_assert_msg(rc == LSM_ERR_NOT_FOUND_DISK,
                 "lsm_local_disk_serial_num_get(): Expecting "
                 "LSM_ERR_NOT_FOUND_DISK when disk does not exist");
-    fail_unless(serial_num == NULL,
+    ck_assert_msg(serial_num == NULL,
                 "lsm_local_disk_serial_num_get(): Expecting "
                 "serial_num as NULL when disk does not exist");
-    fail_unless(lsm_err != NULL,
+    ck_assert_msg(lsm_err != NULL,
                 "lsm_local_disk_serial_num_get(): Expecting "
                 "lsm_err not NULL when disk does not exist");
-    fail_unless(lsm_error_number_get(lsm_err) == LSM_ERR_NOT_FOUND_DISK,
+    ck_assert_msg(lsm_error_number_get(lsm_err) == LSM_ERR_NOT_FOUND_DISK,
                 "lsm_local_disk_serial_num_get(): Expecting "
                 "lsm_err been set with LSM_ERR_NOT_FOUND_DISK");
-    fail_unless(lsm_error_message_get(lsm_err) != NULL,
+    ck_assert_msg(lsm_error_message_get(lsm_err) != NULL,
                 "lsm_local_disk_serial_num_get(): Expecting lsm_err "
                 "been set with non-NULL error message when disk not exist");
     lsm_error_free(lsm_err);
@@ -3496,33 +3540,33 @@ START_TEST(test_local_disk_vpd83_get)
 
     rc = lsm_local_disk_vpd83_get(NULL, &vpd83, &lsm_err);
 
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_vpd83_get(): Expecting "
                 "LSM_ERR_INVALID_ARGUMENT when input is NULL");
-    fail_unless(vpd83 == NULL,
+    ck_assert_msg(vpd83 == NULL,
                 "lsm_local_disk_vpd83_get(): Expecting "
                 "vpd83 been set as NULL.");
-    fail_unless(lsm_err != NULL,
+    ck_assert_msg(lsm_err != NULL,
                 "lsm_local_disk_vpd83_get(): Expecting "
                 "lsm_err been set as non-NULL.");
-    fail_unless(lsm_error_number_get(lsm_err) == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(lsm_error_number_get(lsm_err) == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_vpd83_get(): Expecting "
                 "lsm_err been set with LSM_ERR_INVALID_ARGUMENT");
-    fail_unless(lsm_error_message_get(lsm_err) != NULL,
+    ck_assert_msg(lsm_error_message_get(lsm_err) != NULL,
                 "lsm_local_disk_vpd83_get(): Expecting "
                 "lsm_err been set with non-NULL error message");
     lsm_error_free(lsm_err);
 
     rc = lsm_local_disk_vpd83_get("/dev/sda", NULL, &lsm_err);
 
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_vpd83_get(): Expecting "
                 "LSM_ERR_INVALID_ARGUMENT when input is NULL");
     lsm_error_free(lsm_err);
 
     rc = lsm_local_disk_vpd83_get("/dev/sda", &vpd83, NULL);
 
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "lsm_local_disk_vpd83_get(): Expecting "
                 "LSM_ERR_INVALID_ARGUMENT when lsm_err is NULL");
 
@@ -3534,19 +3578,19 @@ START_TEST(test_local_disk_vpd83_get)
 
     /* Test non-exist disk */
     rc = lsm_local_disk_vpd83_get(NOT_EXIST_SD_PATH, &vpd83, &lsm_err);
-    fail_unless(rc == LSM_ERR_NOT_FOUND_DISK,
+    ck_assert_msg(rc == LSM_ERR_NOT_FOUND_DISK,
                 "lsm_local_disk_vpd83_get(): Expecting "
                 "LSM_ERR_NOT_FOUND_DISK when disk not exist");
-    fail_unless(vpd83 == NULL,
+    ck_assert_msg(vpd83 == NULL,
                 "lsm_local_disk_vpd83_get(): Expecting "
                 "vpd83 as NULL when disk not exist");
-    fail_unless(lsm_err != NULL,
+    ck_assert_msg(lsm_err != NULL,
                 "lsm_local_disk_vpd83_get(): Expecting "
                 "lsm_err not NULL when disk not exist");
-    fail_unless(lsm_error_number_get(lsm_err) == LSM_ERR_NOT_FOUND_DISK,
+    ck_assert_msg(lsm_error_number_get(lsm_err) == LSM_ERR_NOT_FOUND_DISK,
                 "lsm_local_disk_vpd83_get(): Expecting "
                 "lsm_err been set with LSM_ERR_NOT_FOUND_DISK");
-    fail_unless(lsm_error_message_get(lsm_err) != NULL,
+    ck_assert_msg(lsm_error_message_get(lsm_err) != NULL,
                 "lsm_local_disk_vpd83_get(): Expecting lsm_err "
                 "been set with non-NULL error message when disk not exist");
     lsm_error_free(lsm_err);
@@ -3562,7 +3606,7 @@ START_TEST(test_local_disk_rpm_get)
 
     rc = lsm_local_disk_rpm_get("/dev/sda", &rpm,  &lsm_err);
     if (rc == LSM_ERR_OK) {
-        fail_unless(rpm != LSM_DISK_RPM_UNKNOWN,
+        ck_assert_msg(rpm != LSM_DISK_RPM_UNKNOWN,
                     "lsm_local_disk_rpm_get(): "
                     "Expecting rpm not been LSM_DISK_RPM_UNKNOWN "
                     "when rc == LSM_ERR_OK");
@@ -3572,16 +3616,16 @@ START_TEST(test_local_disk_rpm_get)
 
     /* Test non-exist disk */
     rc = lsm_local_disk_rpm_get(NOT_EXIST_SD_PATH, &rpm,  &lsm_err);
-    fail_unless(rc == LSM_ERR_NOT_FOUND_DISK, "lsm_local_disk_rpm_get(): "
+    ck_assert_msg(rc == LSM_ERR_NOT_FOUND_DISK, "lsm_local_disk_rpm_get(): "
                 "Expecting LSM_ERR_NOT_FOUND_DISK error with "
                 "non-exist sd_path");
-    fail_unless(lsm_err != NULL, "lsm_local_disk_rpm_get(): "
+    ck_assert_msg(lsm_err != NULL, "lsm_local_disk_rpm_get(): "
                 "Expecting lsm_err not NULL with non-exist sd_path");
-    fail_unless(lsm_error_number_get(lsm_err) == LSM_ERR_NOT_FOUND_DISK,
+    ck_assert_msg(lsm_error_number_get(lsm_err) == LSM_ERR_NOT_FOUND_DISK,
                 "lsm_local_disk_rpm_get(): "
                 "Expecting error number of lsm_err been set as "
                 "LSM_ERR_NOT_FOUND_DISK with non-exist sd_path");
-    fail_unless(lsm_error_message_get(lsm_err) != NULL,
+    ck_assert_msg(lsm_error_message_get(lsm_err) != NULL,
                 "lsm_local_disk_rpm_get(): "
                 "Expecting error message of lsm_err not NULL "
                 "with non-exist sd_path");
@@ -3598,11 +3642,11 @@ START_TEST(test_local_disk_link_type)
 
     rc = lsm_local_disk_link_type_get("/dev/sda", &link_type,  &lsm_err);
     if (lsm_err != NULL)
-        fail_unless(rc != LSM_ERR_LIB_BUG,
+        ck_assert_msg(rc != LSM_ERR_LIB_BUG,
                     "lsm_local_disk_link_type_get() got LSM_ERR_LIB_BUG: %s",
                     lsm_error_message_get(lsm_err));
     else
-        fail_unless(rc != LSM_ERR_LIB_BUG,
+        ck_assert_msg(rc != LSM_ERR_LIB_BUG,
                     "lsm_local_disk_link_type_get() got LSM_ERR_LIB_BUG with "
                     "NULL lsm_err");
 
@@ -3611,17 +3655,17 @@ START_TEST(test_local_disk_link_type)
 
     /* Test non-exist disk */
     rc = lsm_local_disk_link_type_get(NOT_EXIST_SD_PATH, &link_type, &lsm_err);
-    fail_unless(rc == LSM_ERR_NOT_FOUND_DISK,
+    ck_assert_msg(rc == LSM_ERR_NOT_FOUND_DISK,
                 "lsm_local_disk_link_type_get(): "
                 "Expecting LSM_ERR_NOT_FOUND_DISK error with "
                 "non-exist disk_path");
-    fail_unless(lsm_err != NULL, "lsm_local_disk_link_type_get(): "
+    ck_assert_msg(lsm_err != NULL, "lsm_local_disk_link_type_get(): "
                 "Expecting lsm_err not NULL with non-exist disk_path");
-    fail_unless(lsm_error_number_get(lsm_err) == LSM_ERR_NOT_FOUND_DISK,
+    ck_assert_msg(lsm_error_number_get(lsm_err) == LSM_ERR_NOT_FOUND_DISK,
                 "lsm_local_disk_link_type_get(): "
                 "Expecting error number of lsm_err been set as "
                 "LSM_ERR_NOT_FOUND_DISK with non-exist disk_path");
-    fail_unless(lsm_error_message_get(lsm_err) != NULL,
+    ck_assert_msg(lsm_error_message_get(lsm_err) != NULL,
                 "lsm_local_disk_link_type_get(): "
                 "Expecting error message of lsm_err not NULL "
                 "with non-exist disk_path");
@@ -3637,7 +3681,7 @@ START_TEST(test_local_disk_health_status_get)
 
     rc = lsm_local_disk_health_status_get("/dev/sda", &health_status,  &lsm_err);
     if (rc == LSM_ERR_OK) {
-        fail_unless(health_status == LSM_DISK_HEALTH_STATUS_UNKNOWN,
+        ck_assert_msg(health_status == LSM_DISK_HEALTH_STATUS_UNKNOWN,
                     "lsm_local_disk_health_status_get(): "
                     "Expecting health_status to be "
                     "LSM_DISK_HEALTH_STATUS_UNKNOWN "
@@ -3650,17 +3694,17 @@ START_TEST(test_local_disk_health_status_get)
     /* Test disk that does not exist */
     rc = lsm_local_disk_health_status_get(NOT_EXIST_SD_PATH, &health_status,
                                          &lsm_err);
-    fail_unless(rc == LSM_ERR_NOT_FOUND_DISK,
+    ck_assert_msg(rc == LSM_ERR_NOT_FOUND_DISK,
                 "lsm_local_disk_health_status_get(): "
                 "Expecting LSM_ERR_NOT_FOUND_DISK error with "
                 "non-existent sd_path");
-    fail_unless(lsm_err != NULL, "lsm_local_disk_health_status_get(): "
+    ck_assert_msg(lsm_err != NULL, "lsm_local_disk_health_status_get(): "
                 "Expecting lsm_err not NULL with non-existent sd_path");
-    fail_unless(lsm_error_number_get(lsm_err) == LSM_ERR_NOT_FOUND_DISK,
+    ck_assert_msg(lsm_error_number_get(lsm_err) == LSM_ERR_NOT_FOUND_DISK,
                 "lsm_local_disk_health_status_get(): "
                 "Expecting error number of lsm_err to be set as "
                 "LSM_ERR_NOT_FOUND_DISK with non-existent sd_path");
-    fail_unless(lsm_error_message_get(lsm_err) != NULL,
+    ck_assert_msg(lsm_error_message_get(lsm_err) != NULL,
                 "lsm_local_disk_health_status_get(): "
                 "Expecting error message of lsm_err to not be NULL "
                 "with non-existent sd_path");
@@ -3678,32 +3722,34 @@ START_TEST(test_batteries)
     uint32_t i = 0;
     lsm_battery *b_copy = NULL;
 
-    fail_unless(c != NULL);
+    ck_assert_msg(c!=NULL, "c = %p", c);
 
     int rc = lsm_battery_list(c, NULL, NULL, &bs, &count, 0);
 
-    fail_unless(LSM_ERR_OK == rc, "lsm_battery_list(): rc %d", rc);
-    fail_unless(count >= 1, "Got no battery");
+    ck_assert_msg(LSM_ERR_OK == rc, "lsm_battery_list(): rc %d", rc);
+    ck_assert_msg(count >= 1, "Got no battery");
 
     for(; i < count; ++i) {
         b_copy = lsm_battery_record_copy(bs[i]);
-        fail_unless(b_copy != NULL );
-        fail_unless(compare_battery(bs[i], b_copy) == 0);
+        ck_assert_msg(b_copy != NULL, "b_copy %p", b_copy);
+        ck_assert_msg(compare_battery(bs[i], b_copy) == 0, "src copy miss-match");
         lsm_battery_record_free(b_copy);
         b_copy = NULL;
 
         id = lsm_battery_id_get(bs[i]);
-        fail_unless(id != NULL && strlen(id) > 0);
+        ck_assert_msg(id != NULL && strlen(id) > 0, "NULL");
 
         name = lsm_battery_name_get(bs[i]);
-        fail_unless(name != NULL && strlen(name) > 0);
+        ck_assert_msg(name != NULL && strlen(name) > 0, "NULL");
 
         system_id = lsm_battery_system_id_get(bs[i]);
-        fail_unless(system_id != NULL && strlen(system_id) > 0);
-        fail_unless(strcmp(system_id, SYSTEM_ID) == 0,
+        ck_assert_msg(system_id != NULL && strlen(system_id) > 0, "NULL");
+        ck_assert_msg(strcmp(system_id, SYSTEM_ID) == 0,
                     "Incorrect battery system id: %s", id);
-        fail_unless(lsm_battery_type_get(bs[i]) >= 1 );
-        fail_unless(lsm_battery_status_get(bs[i]) >= 1);
+        ck_assert_msg(lsm_battery_type_get(bs[i]) >= 1, "%u",
+                        lsm_battery_type_get(bs[i]));
+        ck_assert_msg(lsm_battery_status_get(bs[i]) >= 1, "%lu",
+                        lsm_battery_status_get(bs[i]));
     }
     lsm_battery_record_array_free(bs, count);
 }
@@ -3723,13 +3769,13 @@ START_TEST(test_volume_cache_info)
 
     pool = get_test_pool(c);
 
-    fail_unless(pool != NULL, "Failed to find the test pool");
+    ck_assert_msg(pool != NULL, "Failed to find the test pool");
 
     int rc = lsm_volume_create(
         c, pool, "volume_cache_info_test", 20000000,
         LSM_VOLUME_PROVISION_DEFAULT, &volume, &job, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless( rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
+    ck_assert_msg( rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
             "lsm_volume_create() %d (%s)", rc, error(lsm_error_last_get(c)));
 
     if( LSM_ERR_JOB_STARTED == rc ) {
@@ -3763,13 +3809,13 @@ START_TEST(test_volume_pdc_update)
 
     pool = get_test_pool(c);
 
-    fail_unless(pool != NULL, "Failed to find the test pool");
+    ck_assert_msg(pool != NULL, "Failed to find the test pool");
 
     int rc = lsm_volume_create(
         c, pool, "volume_cache_info_test", 20000000,
         LSM_VOLUME_PROVISION_DEFAULT, &volume, &job, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless(rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
+    ck_assert_msg(rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
             "lsm_volume_create() %d (%s)", rc, error(lsm_error_last_get(c)));
 
     if( LSM_ERR_JOB_STARTED == rc ) {
@@ -3783,7 +3829,7 @@ START_TEST(test_volume_pdc_update)
           &write_cache_status, &read_cache_policy, &read_cache_status,
           &physical_disk_cache, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(physical_disk_cache == all_pdcs[i],
+        ck_assert_msg(physical_disk_cache == all_pdcs[i],
                     "Failed to change physical disk cache to %" PRIu32 "",
                     all_pdcs[i]);
     }
@@ -3812,13 +3858,13 @@ START_TEST(test_volume_wcp_update)
 
     pool = get_test_pool(c);
 
-    fail_unless(pool != NULL, "Failed to find the test pool");
+    ck_assert_msg(pool != NULL, "Failed to find the test pool");
 
     int rc = lsm_volume_create(
         c, pool, "volume_cache_info_test", 20000000,
         LSM_VOLUME_PROVISION_DEFAULT, &volume, &job, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless(rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
+    ck_assert_msg(rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
             "lsm_volume_create() %d (%s)", rc, error(lsm_error_last_get(c)));
 
     if( LSM_ERR_JOB_STARTED == rc ) {
@@ -3832,7 +3878,7 @@ START_TEST(test_volume_wcp_update)
           &write_cache_status, &read_cache_policy, &read_cache_status,
           &physical_disk_cache, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(write_cache_policy == all_wcps[i],
+        ck_assert_msg(write_cache_policy == all_wcps[i],
                     "Failed to change write cache policy to %" PRIu32 "",
                     all_wcps[i]);
     }
@@ -3860,13 +3906,13 @@ START_TEST(test_volume_rcp_update)
 
     pool = get_test_pool(c);
 
-    fail_unless(pool != NULL, "Failed to find the test pool");
+    ck_assert_msg(pool != NULL, "Failed to find the test pool");
 
     int rc = lsm_volume_create(
         c, pool, "volume_cache_info_test", 20000000,
         LSM_VOLUME_PROVISION_DEFAULT, &volume, &job, LSM_CLIENT_FLAG_RSVD);
 
-    fail_unless(rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
+    ck_assert_msg(rc == LSM_ERR_OK || rc == LSM_ERR_JOB_STARTED,
             "lsm_volume_create() %d (%s)", rc, error(lsm_error_last_get(c)));
 
     if( LSM_ERR_JOB_STARTED == rc ) {
@@ -3880,7 +3926,7 @@ START_TEST(test_volume_rcp_update)
           &write_cache_status, &read_cache_policy, &read_cache_status,
           &physical_disk_cache, LSM_CLIENT_FLAG_RSVD);
 
-        fail_unless(read_cache_policy == all_rcps[i],
+        ck_assert_msg(read_cache_policy == all_rcps[i],
                     "Failed to change write cache policy to %" PRIu32 "",
                     all_rcps[i]);
     }
@@ -3901,17 +3947,17 @@ do { \
     rc = lsm_local_disk_list(&disk_paths, &lsm_err); \
     if (lsm_err != NULL) \
         lsm_error_free(lsm_err); \
-    fail_unless(rc == LSM_ERR_OK, "lsm_local_disk_list() failed as %d", rc); \
+    ck_assert_msg(rc == LSM_ERR_OK, "lsm_local_disk_list() failed as %d", rc); \
     /* Only try maximum 4 disks */ \
     for (; i < lsm_string_list_size(disk_paths) && i < 4; ++i) { \
         disk_path = lsm_string_list_elem_get(disk_paths, i); \
-        fail_unless (disk_path != NULL, "Got NULL disk path"); \
+        ck_assert_msg (disk_path != NULL, "Got NULL disk path"); \
         rc = on_func(disk_path, &lsm_err); \
-        fail_unless(rc == LSM_ERR_OK || rc == LSM_ERR_NO_SUPPORT || \
+        ck_assert_msg(rc == LSM_ERR_OK || rc == LSM_ERR_NO_SUPPORT || \
                     rc == LSM_ERR_PERMISSION_DENIED, \
                     # on_func "(): Got unexpected return: %d", rc); \
         if (rc != LSM_ERR_OK) { \
-            fail_unless(lsm_err != NULL, \
+            ck_assert_msg(lsm_err != NULL, \
                         # on_func "(): Got NULL lsm_err while " \
                         "rc(%d) != LSM_ERR_OK", rc); \
             lsm_error_free(lsm_err); \
@@ -3923,11 +3969,11 @@ do { \
             printf(# on_func "(): not supported disk %s\n", disk_path); \
         } \
         rc = off_func(disk_path, &lsm_err); \
-        fail_unless(rc == LSM_ERR_OK || rc == LSM_ERR_NO_SUPPORT || \
+        ck_assert_msg(rc == LSM_ERR_OK || rc == LSM_ERR_NO_SUPPORT || \
                     rc == LSM_ERR_PERMISSION_DENIED, \
                     # off_func "(): Got unexpected return: %d", rc); \
         if (rc != LSM_ERR_OK) { \
-            fail_unless(lsm_err != NULL, \
+            ck_assert_msg(lsm_err != NULL, \
                         # off_func "(): Got NULL lsm_err " \
                         "while rc(%d) != LSM_ERR_OK", rc); \
             lsm_error_free(lsm_err); \
@@ -3968,13 +4014,13 @@ START_TEST(test_local_disk_led_status_get)
     rc = lsm_local_disk_list(&disk_paths, &lsm_err);
     if (lsm_err)
         lsm_error_free(lsm_err);
-    fail_unless(rc == LSM_ERR_OK, "lsm_local_disk_list() failed as %d", rc);
+    ck_assert_msg(rc == LSM_ERR_OK, "lsm_local_disk_list() failed as %d", rc);
     /* Only try maximum 4 disks */
     for (; i < lsm_string_list_size(disk_paths) && i < 4; ++i) {
         disk_path = lsm_string_list_elem_get(disk_paths, i);
-        fail_unless (disk_path != NULL, "Got NULL disk path");
+        ck_assert_msg (disk_path != NULL, "Got NULL disk path");
         rc = lsm_local_disk_led_status_get(disk_path, &led_status, &lsm_err);
-        fail_unless(rc == LSM_ERR_OK || rc == LSM_ERR_NO_SUPPORT ||
+        ck_assert_msg(rc == LSM_ERR_OK || rc == LSM_ERR_NO_SUPPORT ||
                     rc == LSM_ERR_PERMISSION_DENIED,
                     "lsm_local_disk_led_status_get(): "
                     "Got unexpected return: %d", rc);
@@ -3985,26 +4031,26 @@ START_TEST(test_local_disk_led_status_get)
 
     /* Test invalid argument */
     rc = lsm_local_disk_led_status_get(NULL, &led_status, &lsm_err);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expecting LSM_ERR_INVALID_ARGUMENT, but got %d", rc);
-    fail_unless(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
+    ck_assert_msg(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
     lsm_error_free(lsm_err);
 
     rc = lsm_local_disk_led_status_get("/dev/sda", NULL, &lsm_err);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expecting LSM_ERR_INVALID_ARGUMENT, but got %d", rc);
-    fail_unless(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
+    ck_assert_msg(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
     lsm_error_free(lsm_err);
 
     rc = lsm_local_disk_led_status_get("/dev/sda", &led_status, NULL);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expecting LSM_ERR_INVALID_ARGUMENT, but got %d", rc);
 
     /* Test not exists disk */
     rc = lsm_local_disk_led_status_get(NOT_EXIST_SD_PATH, &led_status, &lsm_err);
-    fail_unless(rc == LSM_ERR_NOT_FOUND_DISK,
+    ck_assert_msg(rc == LSM_ERR_NOT_FOUND_DISK,
                 "Expecting LSM_ERR_NOT_FOUND_DISK, but got %d", rc);
-    fail_unless(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
+    ck_assert_msg(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
     lsm_error_free(lsm_err);
     lsm_string_list_free(disk_paths);
 }
@@ -4023,13 +4069,13 @@ START_TEST(test_local_disk_link_speed_get)
     rc = lsm_local_disk_list(&disk_paths, &lsm_err);
     if (lsm_err)
         lsm_error_free(lsm_err);
-    fail_unless(rc == LSM_ERR_OK, "lsm_local_disk_list() failed as %d", rc);
+    ck_assert_msg(rc == LSM_ERR_OK, "lsm_local_disk_list() failed as %d", rc);
     /* Only try maximum 4 disks */
     for (; i < lsm_string_list_size(disk_paths) && i < 4; ++i) {
         disk_path = lsm_string_list_elem_get(disk_paths, i);
-        fail_unless (disk_path != NULL, "Got NULL disk path");
+        ck_assert_msg (disk_path != NULL, "Got NULL disk path");
         rc = lsm_local_disk_link_speed_get(disk_path, &link_speed, &lsm_err);
-        fail_unless(rc == LSM_ERR_OK || rc == LSM_ERR_NO_SUPPORT ||
+        ck_assert_msg(rc == LSM_ERR_OK || rc == LSM_ERR_NO_SUPPORT ||
                     rc == LSM_ERR_PERMISSION_DENIED,
                     "lsm_local_disk_led_status_get(): "
                     "Got unexpected return: %d", rc);
@@ -4040,33 +4086,33 @@ START_TEST(test_local_disk_link_speed_get)
 
     /* Test invalid argument */
     rc = lsm_local_disk_link_speed_get(NULL, &link_speed, &lsm_err);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expecting LSM_ERR_INVALID_ARGUMENT, but got %d", rc);
-    fail_unless(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
-    fail_unless(link_speed == LSM_DISK_LINK_SPEED_UNKNOWN,
+    ck_assert_msg(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
+    ck_assert_msg(link_speed == LSM_DISK_LINK_SPEED_UNKNOWN,
                 "Expecting link_speed to have been set as "
                 "LSM_DISK_LINK_SPEED_UNKNOWN, but got %" PRIu32 "", link_speed);
     lsm_error_free(lsm_err);
 
     rc = lsm_local_disk_link_speed_get("/dev/sda", NULL, &lsm_err);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expecting LSM_ERR_INVALID_ARGUMENT, but got %d", rc);
-    fail_unless(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
+    ck_assert_msg(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
     lsm_error_free(lsm_err);
 
     rc = lsm_local_disk_link_speed_get("/dev/sda", &link_speed, NULL);
-    fail_unless(rc == LSM_ERR_INVALID_ARGUMENT,
+    ck_assert_msg(rc == LSM_ERR_INVALID_ARGUMENT,
                 "Expecting LSM_ERR_INVALID_ARGUMENT, but got %d", rc);
-    fail_unless(link_speed == LSM_DISK_LINK_SPEED_UNKNOWN,
+    ck_assert_msg(link_speed == LSM_DISK_LINK_SPEED_UNKNOWN,
                 "Expecting link_speed to have been set as "
                 "LSM_DISK_LINK_SPEED_UNKNOWN, but got %" PRIu32 "", link_speed);
 
     /* Test not exists disk */
     rc = lsm_local_disk_link_speed_get(NOT_EXIST_SD_PATH, &link_speed, &lsm_err);
-    fail_unless(rc == LSM_ERR_NOT_FOUND_DISK,
+    ck_assert_msg(rc == LSM_ERR_NOT_FOUND_DISK,
                 "Expecting LSM_ERR_NOT_FOUND_DISK, but got %d", rc);
-    fail_unless(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
-    fail_unless(link_speed == LSM_DISK_LINK_SPEED_UNKNOWN,
+    ck_assert_msg(lsm_err != NULL, "Expecting non-NULL lsm_error, but got NULL");
+    ck_assert_msg(link_speed == LSM_DISK_LINK_SPEED_UNKNOWN,
                 "Expecting link_speed to have been set as "
                 "LSM_DISK_LINK_SPEED_UNKNOWN, but got %" PRIu32 "", link_speed);
     lsm_error_free(lsm_err);
-- 
2.23.0

