From 692517d602b1072875cfad2710c8fad39dc35bb4 Mon Sep 17 00:00:00 2001 From: Madhurranjan Mohaan Date: Sep 16 2012 18:41:55 +0000 Subject: Added telnet package tests to install telnet and run it against ssh port --- 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 $?