diff --git a/tests/p_samba/0-install_samba.sh b/tests/p_samba/0-install_samba.sh new file mode 100755 index 0000000..96f9e0f --- /dev/null +++ b/tests/p_samba/0-install_samba.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Author: Athmane Madjoudj + +t_InstallPackage samba samba-client + +t_ServiceControl smb start diff --git a/tests/p_samba/samba_share_test.sh b/tests/p_samba/samba_share_test.sh new file mode 100755 index 0000000..e408605 --- /dev/null +++ b/tests/p_samba/samba_share_test.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# Author: Athmane Madjoudj + +t_Log "Running $0 - Samba share test." + + +cp /etc/samba/smb.conf /etc/samba/smb.conf.orig +cat > /etc/samba/smb.conf < /srv/smb/test.txt +mkdir /mnt/smb + +# Fix SELinux context +chcon -R -t samba_share_t /srv/smb + +# Mount the share +mount -t cifs -o guest,ro //127.0.0.1/testshare /mnt/smb +sleep 1 + +# Test +cat /mnt/smb/test.txt | grep 'SMB test file' > /dev/null 2>&1 + +t_CheckExitStatus $?