From 81d17c517ebbce488918eb580e2647cb8c70d395 Mon Sep 17 00:00:00 2001 From: Athmane Madjoudj Date: Sep 19 2011 17:55:07 +0000 Subject: Add tftp-server test --- diff --git a/tests/p_tftp-server/0-install_tftp-server.sh b/tests/p_tftp-server/0-install_tftp-server.sh new file mode 100755 index 0000000..57882a4 --- /dev/null +++ b/tests/p_tftp-server/0-install_tftp-server.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Author: Athmane Madjoudj + +t_InstallPackage tftp-server xinetd tftp + +# Enable tftp +sed -i 's/\(disable\s*=\ \)yes/\1no/' /etc/xinetd.d/tftp + +t_ServiceControl xinetd start diff --git a/tests/p_tftp-server/tftp-server_test.sh b/tests/p_tftp-server/tftp-server_test.sh new file mode 100755 index 0000000..a4f82a6 --- /dev/null +++ b/tests/p_tftp-server/tftp-server_test.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# Author: Athmane Madjoudj + +t_Log "Running $0 - tftp-server get file test." + +chmod 777 /var/lib/tftpboot +echo "t_functional_test" > /var/lib/tftpboot/tftp_test +tftp 127.0.0.1 -c get tftp_test + +cat tftp_test | grep -q 't_functional_test' +ret_val=$? + +/bin/rm -f tftp_test + +t_CheckExitStatus $ret_val