Blame tests/p_tftp-server/10-tftp-server_get-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 |
|
|
![](https://seccdn.libravatar.org/avatar/5ee4a5868feec154826c1c20b7dbff96e1c2b23222b39ecb3814404ccdffe2fd?s=16&d=retro) |
e80acd |
if [ "$centos_ver" -gt "5" ] ; 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
|