Blame tests/p_vsftpd/vsftpd_localusers_login.sh

Steve Barnes bf9e19
#!/bin/sh
Steve Barnes bf9e19
# Author: Athmane Madjoudj <athmanem@gmail.com>
Steve Barnes bf9e19
Steve Barnes bf9e19
t_Log "Running $0 - vsFTPd local user can login test."
Steve Barnes bf9e19
40b4c8
if [ "$CONTAINERTEST" -eq "1" ]; then
40b4c8
    t_Log "Running in container -> SKIP"
40b4c8
    exit 0
40b4c8
fi
40b4c8
Steve Barnes bf9e19
# Add a test ftp user
Steve Barnes bf9e19
{ userdel -rf ftptest; useradd ftptest && echo ftptest | passwd --stdin ftptest; } &>/dev/null
Steve Barnes bf9e19
Steve Barnes bf9e19
# Fix SELinux boolean
Steve Barnes bf9e19
setsebool ftp_home_dir 1
Steve Barnes bf9e19
Christoph Galuschka eb8570
echo -e "user ftptest\npass ftptest\nquit" | nc localhost 21 | grep -q "230 Login successful."
Steve Barnes bf9e19
Steve Barnes bf9e19
t_CheckExitStatus $?
Athmane Madjoudj 0b80b5
Athmane Madjoudj 0b80b5
userdel -rf ftptest