Blame tests/p_nfs/nfs_share_rw.sh

Steve Barnes 723e7b
#!/bin/sh
Steve Barnes 723e7b
# Author: Athmane Madjoudj <athmanem@gmail.com>
Steve Barnes 723e7b
Steve Barnes 723e7b
t_Log "Running $0 - NFS writable share test."
Steve Barnes 723e7b
Steve Barnes 723e7b
cp /etc/exports /etc/exports.orig
Steve Barnes 723e7b
echo '/srv/nfs *(rw,sync,no_root_squash)' >/etc/exports
Steve Barnes 723e7b
mkdir -p /srv/nfs
Steve Barnes 723e7b
exportfs -ar
Steve Barnes 723e7b
Athmane Madjoudj f4110c
# Fix SELinux boolean
Athmane Madjoudj f4110c
setsebool allow_nfsd_anon_write 1
Athmane Madjoudj f4110c
Steve Barnes 723e7b
# Mount the share
Athmane Madjoudj ca1e78
mkdir /mnt/nfs
Athmane Madjoudj 1ae544
mount -t nfs 127.0.0.1:/srv/nfs /mnt/nfs || exit 1
Athmane Madjoudj ca1e78
echo 'NFS test file' > /mnt/nfs/test.txt
Steve Barnes 723e7b
Steve Barnes 723e7b
# Test twice
Athmane Madjoudj ca1e78
(cat /mnt/nfs/test.txt | grep 'NFS test file' > /dev/null 2>&1) && \
Steve Barnes 723e7b
(cat /srv/nfs/test.txt | grep 'NFS test file' > /dev/null 2>&1)
Steve Barnes 723e7b
Steve Barnes 723e7b
t_CheckExitStatus $?