diff --git a/tests/p_httpd/httpd_php.sh b/tests/p_httpd/httpd_php.sh index d69d441..13fc58e 100755 --- a/tests/p_httpd/httpd_php.sh +++ b/tests/p_httpd/httpd_php.sh @@ -5,6 +5,6 @@ echo "" > /var/www/html/test.php t_Log "Running $0 - httpd handle PHP test" -echo -e "GET /test.php HTTP/1.0\r\n" | nc localhost 80 | grep 'PHP Version' +curl -s http://localhost/test.php | grep 'PHP Version' > /dev/null 2>&1 t_CheckExitStatus $? diff --git a/tests/p_httpd/httpd_servehtml.sh b/tests/p_httpd/httpd_servehtml.sh index 30ca6e7..6dcc076 100755 --- a/tests/p_httpd/httpd_servehtml.sh +++ b/tests/p_httpd/httpd_servehtml.sh @@ -3,6 +3,6 @@ t_Log "Running $0 - httpd serve html page test." -echo -e "GET / HTTP/1.0\r\n" | nc localhost 80 | grep 'Test Page' +curl -s http://localhost/ | grep 'Test Page' > /dev/null 2>&1 t_CheckExitStatus $? diff --git a/tests/p_httpd/httpd_vhost.sh b/tests/p_httpd/httpd_vhost.sh index 16ee048..6200880 100755 --- a/tests/p_httpd/httpd_vhost.sh +++ b/tests/p_httpd/httpd_vhost.sh @@ -17,7 +17,7 @@ EOF mkdir -p /var/www/vhosts/test/ echo "Virtual Host Test Page" > /var/www/vhosts/test/index.html t_ServiceControl httpd reload -echo -e "GET / HTTP/1.0\r\n" | nc test 80 | grep 'Virtual Host Test Page' +curl -s http://test/ | grep 'Virtual Host Test Page' > /dev/null 2>&1 t_CheckExitStatus $? diff --git a/tests/p_mysql/mysqld_grant_test.sh b/tests/p_mysql/mysqld_grant_test.sh old mode 100644 new mode 100755 diff --git a/tests/p_openssh/sshd_user_login.py b/tests/p_openssh/sshd_user_login.py index 15efa49..acf6a37 100755 --- a/tests/p_openssh/sshd_user_login.py +++ b/tests/p_openssh/sshd_user_login.py @@ -37,7 +37,7 @@ if __name__ == '__main__': if install_pexpect() != 0: sys.exit("[FAIL] pexpect installation failed") print "[INFO] Adding new user ..." - if os.system("userdel sshtest; useradd sshtest && echo sshtest | passwd --stdin sshtest") != 0: + if os.system("userdel -rf sshtest; useradd sshtest && echo sshtest | passwd --stdin sshtest") != 0: sys.exit("[FAIL] can't add new user") try: ssh_command('sshtest','localhost','sshtest','/bin/ls') diff --git a/tests/p_squirrelmail/squirrelmail_test.sh b/tests/p_squirrelmail/squirrelmail_test.sh index 7626d7c..f150b57 100755 --- a/tests/p_squirrelmail/squirrelmail_test.sh +++ b/tests/p_squirrelmail/squirrelmail_test.sh @@ -2,5 +2,5 @@ # Author: Athmane Madjoudj t_Log "Running $0 - test SquirrelMail URL." -echo -e "GET /webmail/src/login.php HTTP/1.0\r\n" | nc localhost 80 | grep 'SquirrelMail' > /dev/null 2>&1 +curl -s http://localhost/webmail/src/login.php | grep 'SquirrelMail' > /dev/null 2>&1 t_CheckExitStatus $? diff --git a/tests/p_vsftpd/vsftpd_localusers_login.sh b/tests/p_vsftpd/vsftpd_localusers_login.sh new file mode 100755 index 0000000..5e224ef --- /dev/null +++ b/tests/p_vsftpd/vsftpd_localusers_login.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# Author: Athmane Madjoudj + +t_Log "Running $0 - vsFTPd local user can login test." + +# Add a test ftp user +{ userdel -rf ftptest; useradd ftptest && echo ftptest | passwd --stdin ftptest; } &>/dev/null + +# Fix SELinux boolean +setsebool ftp_home_dir 1 + +echo -e "user ftptest\npass ftptest\nquit" | nc localhost 21 | grep "230 Login successful." + +t_CheckExitStatus $? diff --git a/tests/p_webalizer/webalizer_test.sh b/tests/p_webalizer/webalizer_test.sh index e367e6d..c90201d 100755 --- a/tests/p_webalizer/webalizer_test.sh +++ b/tests/p_webalizer/webalizer_test.sh @@ -13,6 +13,6 @@ done /etc/cron.daily/00webalizer # Run the test -echo -e "GET /usage/ HTTP/1.0\r\n" | nc localhost 80 | grep 'Usage Statistics for' > /dev/null 2>&1 +curl -s http://localhost/usage/ | grep 'Usage Statistics for' > /dev/null 2>&1 t_CheckExitStatus $?