From a2ab96f7b14344eb99b4c97c1c39a836e7d0de15 Mon Sep 17 00:00:00 2001 From: Fabian Arrotin Date: Feb 08 2012 12:43:31 +0000 Subject: Fixed the selinux context on /tftpboot under c5 to allow tftp_write test --- diff --git a/tests/p_tftp-server/20-tftp-server_put-test.sh b/tests/p_tftp-server/20-tftp-server_put-test.sh index bf257f8..33660c6 100755 --- a/tests/p_tftp-server/20-tftp-server_put-test.sh +++ b/tests/p_tftp-server/20-tftp-server_put-test.sh @@ -1,33 +1,30 @@ #!/bin/sh # Author: Athmane Madjoudj -# Christoph Galuschka +# Christoph Galuschka t_Log "Running $0 - tftp-server put file test." -if (t_GetPkgRel basesystem | grep -q el6) -then - TFTP_DIR=/var/lib/tftpboot -else - TFTP_DIR=/tftpboot -fi - -chmod 777 $TFTP_DIR -echo "t_functional_test" > put_test -touch $TFTP_DIR/put_test -chmod 666 $TFTP_DIR/put_test - -# Fix selinux bool dist=$(t_DistCheck) + if [ "$dist" = "6" ]; then setsebool tftp_anon_write 1 + TFTP_DIR=/var/lib/tftpboot elif [ "$dist" = "5" ]; then setsebool allow_tftp_anon_write 1 + chcon -R -t tftpdir_rw_t /tftpboot/ + TFTP_DIR=/tftpboot else - echo undefined + TFTP_DIR=/tftpboot fi -tftp 127.0.0.1 -c put put_test +chmod 777 $TFTP_DIR +echo "t_functional_test" > put_test +touch $TFTP_DIR/put_test +chmod 666 $TFTP_DIR/put_test + + +tftp 127.0.0.1 -c put put_test cat $TFTP_DIR/put_test | grep -q 't_functional_test' ret_val=$?