diff --git a/tests/p_nfs/0-install_nfs.sh b/tests/p_nfs/0-install_nfs.sh new file mode 100644 index 0000000..e40fb57 --- /dev/null +++ b/tests/p_nfs/0-install_nfs.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Author: Athmane Madjoudj + +# NFS +t_InstallPackage nfs-utils.i686 + +# Restart because usualy NFS is enabled by default on CentOS-5 +t_ServiceControl nfs restart +t_ServiceControl portmap restart diff --git a/tests/p_nfs/nfs_share_rw.sh b/tests/p_nfs/nfs_share_rw.sh new file mode 100644 index 0000000..6d63574 --- /dev/null +++ b/tests/p_nfs/nfs_share_rw.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Author: Athmane Madjoudj + +t_Log "Running $0 - NFS writable share test." + +cp /etc/exports /etc/exports.orig +echo '/srv/nfs *(rw,sync,no_root_squash)' >/etc/exports +mkdir -p /srv/nfs +exportfs -ar + +# Mount the share +mount -t nfs 127.0.0.1:/srv/nfs /mnt +echo 'NFS test file' > /mnt/test.txt + +# Test twice +(cat /mnt/test.txt | grep 'NFS test file' > /dev/null 2>&1) && \ +(cat /srv/nfs/test.txt | grep 'NFS test file' > /dev/null 2>&1) + +t_CheckExitStatus $?