diff --git a/tests/p_jwhois/0-install_jwhois.sh b/tests/p_jwhois/0-install_jwhois.sh new file mode 100755 index 0000000..c5163b2 --- /dev/null +++ b/tests/p_jwhois/0-install_jwhois.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Author: Athmane Madjoudj + +# nc (netcat) is required for the test +t_InstallPackage jwhois nc + diff --git a/tests/p_jwhois/jwhois_test.sh b/tests/p_jwhois/jwhois_test.sh new file mode 100755 index 0000000..0afac83 --- /dev/null +++ b/tests/p_jwhois/jwhois_test.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Author: Athmane Madjoudj + +t_Log "Running $0 - check that jwhois can connect to whois server and get the info." + +# Dummy whois server +echo 'tf_jwhois_test_response' | nc -l 43 & +sleep 1 + +whois -h 127.0.0.1 domain.tld | grep -q 'tf_jwhois_test_response' + +t_CheckExitStatus $?