Blame tests/p_tftp-server/20-tftp-server_put-test.sh
|
Christoph Galuschka |
a056a9 |
#!/bin/sh
|
|
Christoph Galuschka |
a056a9 |
# Author: Athmane Madjoudj <athmanem@gmail.com>
|
|
Christoph Galuschka |
a056a9 |
# Christoph Galuschka <christoph.galuschka@chello.at>
|
|
Christoph Galuschka |
a056a9 |
|
|
Christoph Galuschka |
a056a9 |
t_Log "Running $0 - tftp-server put file test."
|
|
Christoph Galuschka |
a056a9 |
|
|
Christoph Galuschka |
a056a9 |
if (t_GetPkgRel basesystem | grep -q el6)
|
|
Christoph Galuschka |
a056a9 |
then
|
|
Christoph Galuschka |
a056a9 |
TFTP_DIR=/var/lib/tftpboot
|
|
Christoph Galuschka |
a056a9 |
else
|
|
Christoph Galuschka |
a056a9 |
TFTP_DIR=/tftpboot
|
|
Christoph Galuschka |
a056a9 |
fi
|
|
Christoph Galuschka |
a056a9 |
|
|
Christoph Galuschka |
a056a9 |
chmod 777 $TFTP_DIR
|
|
Christoph Galuschka |
a056a9 |
echo "t_functional_test" > put_test
|
|
Christoph Galuschka |
a056a9 |
touch $TFTP_DIR/put_test
|
|
Christoph Galuschka |
a056a9 |
chmod 666 $TFTP_DIR/put_test
|
|
Christoph Galuschka |
a056a9 |
tftp 127.0.0.1 -c put put_test
|
|
Christoph Galuschka |
a056a9 |
|
|
Christoph Galuschka |
a056a9 |
cat $TFTP_DIR/put_test | grep -q 't_functional_test'
|
|
Christoph Galuschka |
a056a9 |
ret_val=$?
|
|
Christoph Galuschka |
a056a9 |
|
|
Christoph Galuschka |
a056a9 |
#cleaning up
|
|
Christoph Galuschka |
a056a9 |
/bin/rm -f put_test
|
|
Christoph Galuschka |
a056a9 |
/bin/rm -f $TFTP_DIR/put_test
|
|
Christoph Galuschka |
a056a9 |
|
|
Christoph Galuschka |
a056a9 |
t_CheckExitStatus $ret_val
|