From a056a931480bcb12bbee40df05113a93add76eb2 Mon Sep 17 00:00:00 2001 From: Christoph Galuschka Date: Jan 10 2012 20:51:25 +0000 Subject: added test for tftp-push, minor cleanup to grep's with '-cq' --- diff --git a/tests/p_tftp-server/10-tftp-server_get-test.sh b/tests/p_tftp-server/10-tftp-server_get-test.sh new file mode 100755 index 0000000..2c98b62 --- /dev/null +++ b/tests/p_tftp-server/10-tftp-server_get-test.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Author: Athmane Madjoudj + +t_Log "Running $0 - tftp-server get file test." + +if (t_GetPkgRel basesystem | grep -q el6) +then + TFTP_DIR=/var/lib/tftpboot +else + TFTP_DIR=/tftpboot +fi + +chmod 777 $TFTP_DIR +echo "t_functional_test" > $TFTP_DIR/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 diff --git a/tests/p_tftp-server/20-tftp-server_put-test.sh b/tests/p_tftp-server/20-tftp-server_put-test.sh new file mode 100755 index 0000000..b8f48dd --- /dev/null +++ b/tests/p_tftp-server/20-tftp-server_put-test.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Author: Athmane Madjoudj +# Christoph Galuschka + +t_Log "Running $0 - tftp-server put file test." + +if (t_GetPkgRel basesystem | grep -q el6) +then + TFTP_DIR=/var/lib/tftpboot +else + TFTP_DIR=/tftpboot +fi + +chmod 777 $TFTP_DIR +echo "t_functional_test" > put_test +touch $TFTP_DIR/put_test +chmod 666 $TFTP_DIR/put_test +tftp 127.0.0.1 -c put put_test + +cat $TFTP_DIR/put_test | grep -q 't_functional_test' +ret_val=$? + +#cleaning up +/bin/rm -f put_test +/bin/rm -f $TFTP_DIR/put_test + +t_CheckExitStatus $ret_val diff --git a/tests/p_tftp-server/tftp-server_test.sh b/tests/p_tftp-server/tftp-server_test.sh deleted file mode 100755 index 2c98b62..0000000 --- a/tests/p_tftp-server/tftp-server_test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# Author: Athmane Madjoudj - -t_Log "Running $0 - tftp-server get file test." - -if (t_GetPkgRel basesystem | grep -q el6) -then - TFTP_DIR=/var/lib/tftpboot -else - TFTP_DIR=/tftpboot -fi - -chmod 777 $TFTP_DIR -echo "t_functional_test" > $TFTP_DIR/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