diff --git a/tests/p_telnet/0-install_telnet.sh b/tests/p_telnet/0-install_telnet.sh new file mode 100755 index 0000000..efc877d --- /dev/null +++ b/tests/p_telnet/0-install_telnet.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Author: Madhurranjan Mohaan + +t_Log "Running $0 - installing telnet" + +# Install Telnet +t_InstallPackage telnet diff --git a/tests/p_telnet/10-test_telnet.sh b/tests/p_telnet/10-test_telnet.sh new file mode 100755 index 0000000..453e269 --- /dev/null +++ b/tests/p_telnet/10-test_telnet.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Author: Madhurranjan Mohaan + +t_Log "Running $0 - testing telnet against ssh port" +t_Log "Making sure port 22 is listening by calling ssh installer" +../p_openssh/0-install_sshd.sh + +sshd_status=`service sshd status | grep running` +if ! [ "$sshd_status" ] +then + service sshd start +fi + +telnet_port_22=`telnet 127.0.0.1 22 << EOH +EOH` +echo $telnet_port_22 | grep "Escape character is '^]'" +t_CheckExitStatus $?