bstinson / centos / t_functional

Forked from centos/t_functional 4 years ago
Clone

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>
a2ab96
#       Christoph Galuschka <christoph.galuschka@chello.at>
Christoph Galuschka 442e3b
#       Fabian Arrotin <arrfab@centos.org>
Christoph Galuschka a056a9
Christoph Galuschka a056a9
t_Log "Running $0 - tftp-server put file test."
Christoph Galuschka a056a9
e80acd
if [ "$centos_ver" -gt "5" ]; then
e80acd
  setsebool tftp_anon_write 1
e80acd
  TFTP_DIR=/var/lib/tftpboot
00cde8
else
e80acd
  setsebool allow_tftp_anon_write 1
e80acd
  chcon -R -t tftpdir_rw_t /tftpboot/
e80acd
  TFTP_DIR=/tftpboot
Athmane Madjoudj f66082
fi
Athmane Madjoudj 0cf4dc
00cde8
a2ab96
chmod 777 $TFTP_DIR
a2ab96
echo "t_functional_test" > put_test
a2ab96
touch $TFTP_DIR/put_test
a2ab96
chmod 666 $TFTP_DIR/put_test
a2ab96
a2ab96
a2ab96
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