From 23fcc697e56e9c4449dd8a4f5f13f8a425569373 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Sun, 14 Jul 2019 20:55:12 -0400 Subject: [PATCH] UT/nvmf: use /tmp directory as the reservation persist file Existing code using /var/log directory can't work with non-root users, so change to /tmp directory instead. Fix issue #859. Change-Id: I270a41d29ad5bafa522540e8bbbcfe83536823ae Signed-off-by: Changpeng Liu Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461774 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Xiaodong Liu --- test/unit/lib/nvmf/subsystem.c/subsystem_ut.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/lib/nvmf/subsystem.c/subsystem_ut.c b/test/unit/lib/nvmf/subsystem.c/subsystem_ut.c index 6743cb49e..811334f45 100644 --- a/test/unit/lib/nvmf/subsystem.c/subsystem_ut.c +++ b/test/unit/lib/nvmf/subsystem.c/subsystem_ut.c @@ -784,7 +784,7 @@ test_reservation_register_with_ptpl(void) SPDK_CU_ASSERT_FATAL(reg == NULL); /* TEST CASE: Enable PTPL */ - g_ns.ptpl_file = "/var/log/Ns1PR.cfg"; + g_ns.ptpl_file = "/tmp/Ns1PR.cfg"; ut_reservation_build_register_request(req, SPDK_NVME_RESERVE_REGISTER_KEY, 0, SPDK_NVME_RESERVE_PTPL_PERSIST_POWER_LOSS, 0, 0xa1); update_sgroup = nvmf_ns_reservation_register(&g_ns, &g_ctrlr1_A, req); @@ -905,7 +905,7 @@ test_reservation_acquire_release_with_ptpl(void) SPDK_CU_ASSERT_FATAL(req != NULL); /* TEST CASE: Enable PTPL */ - g_ns.ptpl_file = "/var/log/Ns1PR.cfg"; + g_ns.ptpl_file = "/tmp/Ns1PR.cfg"; ut_reservation_build_register_request(req, SPDK_NVME_RESERVE_REGISTER_KEY, 0, SPDK_NVME_RESERVE_PTPL_PERSIST_POWER_LOSS, 0, 0xa1); update_sgroup = nvmf_ns_reservation_register(&g_ns, &g_ctrlr1_A, req);