From 2a0428f16b93b7d5160c277dd678e65ad27d996f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Sat, 24 Feb 2018 10:07:12 -0800 Subject: [PATCH] ZTS: Fix zfs_share_* test case failures Prevent false positives when running the zfs_share_* test cases due to leftover stale /var/lib/nfs/etab entries. When starting the test group re-synchronize the /var/lib/nfs/etab file with /etc/exports. At this point in the testing there will be no additional `zfs share` entries to add. Reviewed by: George Melikov Reviewed-by: loli10K Signed-off-by: Brian Behlendorf Closes #7226 --- tests/zfs-tests/include/libtest.shlib | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index da5456b6f7d0..7d29760d8eb1 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -1420,7 +1420,13 @@ function setup_nfs_server fi if is_linux; then - log_note "NFS server must started prior to running test framework." + # + # Re-synchronize /var/lib/nfs/etab with /etc/exports and + # /etc/exports.d./* to provide a clean test environment. + # + log_must share -r + + log_note "NFS server must be started prior to running ZTS." return fi