cifs-utils/tests/sanity/runte‎st.sh
Xiaoli Feng 472a3b70d8 Add simple tests for gating tests
As before, cifs-utils gating tests don't do anything tests. Now
add simple tests. Such as mount/umount cifs.

Signed-off-by: Xiaoli Feng <xifeng@redhat.com>
2024-05-21 16:25:00 +08:00

25 lines
580 B
Bash
Executable File

#!/usr/bin/bash
set -x
CIFS_SHARE=$PWD/cifs-share
CIFS_MNT=$PWD/cifs-mnt
mount.cifs -V
cp /etc/samba/smb.conf /etc/samba/smb.conf.bark
cat << __EOF__ >/etc/samba/smb.conf
[cifs]
path=$CIFS_SHARE
writeable=yes
__EOF__
testparm -s
mkdir -p $CIFS_SHARE $CIFS_MNT
chcon -t samba_share_t $CIFS_SHARE
setsebool -P samba_export_all_rw on
echo -e "redhat\nredhat" | smbpasswd -a root -s
systemctl start smb
sleep 5
mount //localhost/cifs $CIFS_MNT -o user=root,password=redhat
ls -l $CIFS_MNT
umount $CIFS_MNT
cp /etc/samba/smb.conf.bark /etc/samba/smb.conf
rm -rf $CIFS_SHARE $CIFS_MNT