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
00cde8
dist=$(t_DistCheck)
a2ab96
00cde8
if [ "$dist" = "6" ]; then
00cde8
        setsebool tftp_anon_write 1
a2ab96
        TFTP_DIR=/var/lib/tftpboot
00cde8
elif [ "$dist" = "5" ]; then
00cde8
        setsebool allow_tftp_anon_write 1
a2ab96
        chcon -R -t tftpdir_rw_t /tftpboot/
a2ab96
        TFTP_DIR=/tftpboot
00cde8
else
a2ab96
        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