Blame tests/p_openssh/sshd_user_login.sh

Steve Barnes d25592
#!/bin/sh
Steve Barnes d25592
# Author: Athmane Madjoudj <athmanem@gmail.com>
Steve Barnes d25592
Steve Barnes d25592
userdel -rf sshtest; useradd sshtest && echo sshtest | passwd --stdin sshtest
Steve Barnes d25592
Steve Barnes d25592
# Create a test file
Steve Barnes d25592
touch /home/sshtest/ssh_test_file
Steve Barnes d25592
Karanbir Singh bcf349
t_Log "Running $0 - SSH Interactive user login test."
Athmane Madjoudj cf6174
40b4c8
if [ "$CONTAINERTEST" -eq "1" ]; then
40b4c8
    t_Log "Running in container -> SKIP"
40b4c8
    exit 0
40b4c8
fi
40b4c8
Karanbir Singh fc26b0
if [ `egrep "^PasswordAuthentication" /etc/ssh/sshd_config | tail -n1 | egrep "\syes$" | wc -l ` -gt 0 ]; then
Karanbir Singh bcf349
  ./tests/p_openssh/_helper_sshd_user_login.expect | grep "ssh_test_file"  > /dev/null 2>&1
Karanbir Singh bcf349
  t_CheckExitStatus $?
Karanbir Singh bcf349
  userdel -rf sshtest
Karanbir Singh bcf349
else
Karanbir Singh bcf349
	t_Log 'Skipped'
Karanbir Singh bcf349
fi