3 # This program tests the PERMISSIONS command
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
8 # ensure that top_builddir are absolute
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp
14 # ensure that top_srcdir is absolute
15 top_srcdir=`cd $top_srcdir; pwd`
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
23 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
24 echo "NOT cleaning $TEMPDIR"
60 activity="Create file"
63 if [ $? -ne 0 ] ; then no_result ; fi
65 activity="Create program"
67 PERMISSIONS /FILE='foobar'
68 PERMISSIONS = READONLY.
70 if [ $? -ne 0 ] ; then no_result ; fi
72 activity="run program"
73 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/per.sps
74 if [ $? -ne 0 ] ; then no_result ; fi
76 activity="Check Permissions"
77 ls -l foobar | grep '^-r-xr-xr-x' > /dev/null
78 if [ $? -ne 0 ] ; then fail ; fi
81 activity="Create program"
83 PERMISSIONS /FILE='foobar'
84 PERMISSIONS = WRITEABLE.
86 if [ $? -ne 0 ] ; then no_result ; fi
88 activity="run program"
89 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/per.sps
90 if [ $? -ne 0 ] ; then no_result ; fi
92 activity="Check Permissions"
93 ls -l foobar | grep '^-rwxr-xr-x' > /dev/null
94 if [ $? -ne 0 ] ; then fail ; fi