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 <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7226
This commit is contained in:
Brian Behlendorf 2018-02-24 10:07:12 -08:00 committed by GitHub
parent 41532e5a29
commit 2a0428f16b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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