|
| 1 | +diff --git a/src/vos/tests/vts_common.c b/src/vos/tests/vts_common.c |
| 2 | +index 618f9feddd..7452ba2a34 100644 |
| 3 | +--- a/src/vos/tests/vts_common.c |
| 4 | ++++ b/src/vos/tests/vts_common.c |
| 5 | +@@ -52,11 +52,22 @@ vts_file_exists(const char *filename) |
| 6 | + } |
| 7 | + |
| 8 | + int |
| 9 | +-vts_alloc_gen_fname(char **fname) |
| 10 | ++vts_alloc_gen_fname(char *po_uuid_str, char **fname) |
| 11 | + { |
| 12 | + int rc; |
| 13 | + |
| 14 | +- rc = asprintf(fname, "%s/vpool.%d", vos_path, gc++); |
| 15 | ++ assert(*fname == NULL); |
| 16 | ++ rc = asprintf(fname, "%s/%s/", vos_path, po_uuid_str); |
| 17 | ++ if (rc < 0) { |
| 18 | ++ *fname = NULL; |
| 19 | ++ print_error("Failed to allocate memory for fname: rc = %d\n", rc); |
| 20 | ++ return rc; |
| 21 | ++ } |
| 22 | ++ rc = mkdir(*fname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); |
| 23 | ++ assert(rc == 0 || errno == EEXIST); |
| 24 | ++ free(*fname); |
| 25 | ++ |
| 26 | ++ rc = asprintf(fname, "%s/%s/vpool.%d", vos_path, po_uuid_str, gc++); |
| 27 | + if (rc < 0) { |
| 28 | + *fname = NULL; |
| 29 | + print_error("Failed to allocate memory for fname: rc = %d\n", rc); |
| 30 | +@@ -71,9 +82,9 @@ vts_pool_fallocate(char **fname) |
| 31 | + { |
| 32 | + int ret = 0, fd; |
| 33 | + |
| 34 | +- ret = vts_alloc_gen_fname(fname); |
| 35 | +- if (ret) |
| 36 | +- return ret; |
| 37 | ++ // ret = vts_alloc_gen_fname(fname); |
| 38 | ++ // if (ret) |
| 39 | ++ // return ret; |
| 40 | + |
| 41 | + fd = open(*fname, O_CREAT | O_TRUNC | O_RDWR, 0666); |
| 42 | + if (fd < 0) { |
| 43 | +@@ -92,10 +103,17 @@ int |
| 44 | + vts_ctx_init(struct vos_test_ctx *tcx, size_t psize) |
| 45 | + { |
| 46 | + int rc; |
| 47 | ++ char uuid_str[] = "dd6728be-696a-11ef-a059-a4bf0165c389"; |
| 48 | ++ char uuid_str2[] = "591d19e4-69fe-11ef-b13d-a4bf0165c389"; |
| 49 | + |
| 50 | + memset(tcx, 0, sizeof(*tcx)); |
| 51 | ++ |
| 52 | ++ uuid_parse(uuid_str, tcx->tc_po_uuid); |
| 53 | ++ // uuid_generate_time_safe(tcx->tc_po_uuid); |
| 54 | ++ // uuid_unparse(tcx->tc_po_uuid, uuid_str); |
| 55 | ++ |
| 56 | + oid_cnt = 0; |
| 57 | +- rc = vts_alloc_gen_fname(&tcx->tc_po_name); |
| 58 | ++ rc = vts_alloc_gen_fname(uuid_str, &tcx->tc_po_name); |
| 59 | + assert_int_equal(rc, 0); |
| 60 | + |
| 61 | + if (vts_file_exists(tcx->tc_po_name)) { |
| 62 | +@@ -103,8 +121,8 @@ vts_ctx_init(struct vos_test_ctx *tcx, size_t psize) |
| 63 | + assert_int_equal(rc, 0); |
| 64 | + } |
| 65 | + |
| 66 | +- uuid_generate_time_safe(tcx->tc_po_uuid); |
| 67 | +- uuid_generate_time_safe(tcx->tc_co_uuid); |
| 68 | ++ // uuid_generate_time_safe(tcx->tc_co_uuid); |
| 69 | ++ uuid_parse(uuid_str2, tcx->tc_co_uuid); |
| 70 | + |
| 71 | + /* specify @psize as both NVMe size and SCM size */ |
| 72 | + rc = vos_pool_create(tcx->tc_po_name, tcx->tc_po_uuid, psize, psize, 0, 0 /* version */, |
| 73 | +@@ -155,14 +173,14 @@ vts_ctx_fini(struct vos_test_ctx *tcx) |
| 74 | + assert_rc_equal(rc, 0); |
| 75 | + /* fallthrough */ |
| 76 | + case TCX_CO_CREATE: |
| 77 | +- rc = vos_cont_destroy(tcx->tc_po_hdl, tcx->tc_co_uuid); |
| 78 | +- assert_rc_equal(rc, 0); |
| 79 | ++ // rc = vos_cont_destroy(tcx->tc_po_hdl, tcx->tc_co_uuid); |
| 80 | ++ // assert_rc_equal(rc, 0); |
| 81 | + /* fallthrough */ |
| 82 | + case TCX_PO_CREATE_OPEN: |
| 83 | + rc = vos_pool_close(tcx->tc_po_hdl); |
| 84 | + assert_rc_equal(rc, 0); |
| 85 | +- rc = vos_pool_destroy(tcx->tc_po_name, tcx->tc_po_uuid); |
| 86 | +- assert_rc_equal(rc, 0); |
| 87 | ++ // rc = vos_pool_destroy(tcx->tc_po_name, tcx->tc_po_uuid); |
| 88 | ++ // assert_rc_equal(rc, 0); |
| 89 | + free(tcx->tc_po_name); |
| 90 | + /* fallthrough */ |
| 91 | + } |
| 92 | +diff --git a/src/vos/tests/vts_common.h b/src/vos/tests/vts_common.h |
| 93 | +index 2a08cbd8ff..b7dc09dcfe 100644 |
| 94 | +--- a/src/vos/tests/vts_common.h |
| 95 | ++++ b/src/vos/tests/vts_common.h |
| 96 | +@@ -83,7 +83,7 @@ bool |
| 97 | + vts_file_exists(const char *filename); |
| 98 | + |
| 99 | + int |
| 100 | +-vts_alloc_gen_fname(char **fname); |
| 101 | ++vts_alloc_gen_fname(char *po_uuid, char **fname); |
| 102 | + |
| 103 | + int |
| 104 | + vts_pool_fallocate(char **fname); |
| 105 | +diff --git a/src/vos/tests/vts_io.c b/src/vos/tests/vts_io.c |
| 106 | +index 5ec1bb08f7..abc269b1f6 100644 |
| 107 | +--- a/src/vos/tests/vts_io.c |
| 108 | ++++ b/src/vos/tests/vts_io.c |
| 109 | +@@ -956,7 +956,7 @@ io_obj_cache_test(void **state) |
| 110 | + struct vos_object *obj1, *obj2; |
| 111 | + daos_epoch_range_t epr = {0, 1}; |
| 112 | + daos_unit_oid_t oids[2]; |
| 113 | +- char *po_name; |
| 114 | ++ char *po_name = ""; |
| 115 | + uuid_t pool_uuid; |
| 116 | + daos_handle_t l_poh, l_coh; |
| 117 | + struct daos_lru_cache *old_cache; |
| 118 | +@@ -970,8 +970,8 @@ io_obj_cache_test(void **state) |
| 119 | + old_cache = tls->vtl_ocache; |
| 120 | + tls->vtl_ocache = occ; |
| 121 | + |
| 122 | +- rc = vts_alloc_gen_fname(&po_name); |
| 123 | +- assert_int_equal(rc, 0); |
| 124 | ++ // rc = vts_alloc_gen_fname(&po_name); |
| 125 | ++ // assert_int_equal(rc, 0); |
| 126 | + |
| 127 | + uuid_generate_time_safe(pool_uuid); |
| 128 | + rc = vos_pool_create(po_name, pool_uuid, VPOOL_256M, 0, 0, 0 /* version */, &l_poh); |
| 129 | +@@ -1105,7 +1105,7 @@ io_obj_cache_test(void **state) |
| 130 | + assert_rc_equal(rc, 0); |
| 131 | + vos_obj_cache_destroy(occ); |
| 132 | + tls->vtl_ocache = old_cache; |
| 133 | +- free(po_name); |
| 134 | ++ // free(po_name); |
| 135 | + } |
| 136 | + |
| 137 | + static void |
| 138 | +diff --git a/src/vos/tests/vts_pool.c b/src/vos/tests/vts_pool.c |
| 139 | +index acfd4e46a8..8e2fe3742c 100644 |
| 140 | +--- a/src/vos/tests/vts_pool.c |
| 141 | ++++ b/src/vos/tests/vts_pool.c |
| 142 | +@@ -49,7 +49,7 @@ static int |
| 143 | + pool_file_setup(void **state) |
| 144 | + { |
| 145 | + struct vp_test_args *arg = *state; |
| 146 | +- int ret = 0; |
| 147 | ++ // int ret = 0; |
| 148 | + |
| 149 | + D_ALLOC(arg->fname, sizeof(char *)); |
| 150 | + assert_ptr_not_equal(arg->fname, NULL); |
| 151 | +@@ -57,8 +57,8 @@ pool_file_setup(void **state) |
| 152 | + D_ALLOC_ARRAY(arg->poh, 10); |
| 153 | + assert_ptr_not_equal(arg->poh, NULL); |
| 154 | + |
| 155 | +- ret = vts_alloc_gen_fname(&arg->fname[0]); |
| 156 | +- assert_int_equal(ret, 0); |
| 157 | ++ // ret = vts_alloc_gen_fname(&arg->fname[0]); |
| 158 | ++ // assert_int_equal(ret, 0); |
| 159 | + return 0; |
| 160 | + } |
| 161 | + |
| 162 | +@@ -153,8 +153,8 @@ pool_ops_run(void **state) |
| 163 | + VPOOL_TEST_WAL_SZ, 0, |
| 164 | + 0 /* version */, poh); |
| 165 | + } else { |
| 166 | +- ret = vts_alloc_gen_fname(&arg->fname[j]); |
| 167 | +- assert_int_equal(ret, 0); |
| 168 | ++ // ret = vts_alloc_gen_fname(&arg->fname[j]); |
| 169 | ++ // assert_int_equal(ret, 0); |
| 170 | + ret = vos_pool_create_ex(arg->fname[j], arg->uuid[j], |
| 171 | + VPOOL_256M, 0, VPOOL_TEST_WAL_SZ, |
| 172 | + 0, 0 /* version */, poh); |
0 commit comments