Blame tests/p_tftp-server/tftp-server_test.sh

Athmane Madjoudj 81d17c
#!/bin/sh
Athmane Madjoudj 81d17c
# Author: Athmane Madjoudj <athmanem@gmail.com>
Athmane Madjoudj 81d17c
Athmane Madjoudj 81d17c
t_Log "Running $0 - tftp-server get file test."
Athmane Madjoudj 81d17c
Athmane Madjoudj c7aea7
if (t_GetPkgRel basesystem | grep -q el6)
Athmane Madjoudj c7aea7
then
Athmane Madjoudj c7aea7
  TFTP_DIR=/var/lib/tftpboot
Athmane Madjoudj c7aea7
else
Athmane Madjoudj c7aea7
  TFTP_DIR=/tftpboot
Athmane Madjoudj c7aea7
fi
Athmane Madjoudj c7aea7
Athmane Madjoudj c7aea7
chmod 777 $TFTP_DIR
Athmane Madjoudj c7aea7
echo "t_functional_test" > $TFTP_DIR/tftp_test
Athmane Madjoudj 81d17c
tftp  127.0.0.1 -c get tftp_test
Athmane Madjoudj 81d17c
Athmane Madjoudj 81d17c
cat tftp_test | grep -q 't_functional_test' 
Athmane Madjoudj 81d17c
ret_val=$?
Athmane Madjoudj 81d17c
Athmane Madjoudj 81d17c
/bin/rm -f tftp_test
Athmane Madjoudj 81d17c
Athmane Madjoudj 81d17c
t_CheckExitStatus $ret_val