vfs_gpfs: Use O_PATH for opening dirfd for stat with CAP_DAC_OVERRIDE
[Samba.git] / source4 / setup / tests / blackbox_supported_features.sh
blob9861fbc39279c116a517ec38471f98d2cb259e79
1 #!/bin/sh
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: blackbox_supported_features.sh PREFIX
6 EOF
7 exit 1
8 fi
10 PREFIX="$1"
11 shift 1
13 DBPATH=$PREFIX/supported-features
15 mkdir -p $DBPATH
17 . $(dirname $0)/../../../testprogs/blackbox/subunit.sh
19 ldbmodify="ldbmodify"
20 if [ -x "$BINDIR/ldbmodify" ]; then
21 ldbmodify="$BINDIR/ldbmodify"
24 ldbdel="ldbdel"
25 if [ -x "$BINDIR/ldbdel" ]; then
26 ldbdel="$BINDIR/ldbdel"
29 ldbsearch="ldbsearch"
30 if [ -x "$BINDIR/ldbsearch" ]; then
31 ldbsearch="$BINDIR/ldbsearch"
34 testit "provision" $PYTHON $BINDIR/samba-tool domain provision \
35 --domain=FOO --realm=foo.example.com \
36 --targetdir=$DBPATH --use-ntvfs
38 testit "add-compatible-feature" $ldbmodify \
39 -H tdb://$DBPATH/private/sam.ldb <<EOF
40 dn: @SAMBA_DSDB
41 changetype: modify
42 add: compatibleFeatures
43 compatibleFeatures: non-existent-feature
46 EOF
48 # The non-existent feature is not compatible with this version, so it
49 # should not be listed in compatibleFeatures even though we tried to
50 # put it there.
52 ldb_search_fail()
54 $ldbsearch -H tdb://$DBPATH/private/sam.ldb \
55 -s base -b "$1" "$2" |
56 grep -q "$3"
59 testit_expect_failure "find-compatible-feature" \
60 ldb_search_fail '@SAMBA_DSDB' 'compatibleFeatures' non-existent-feature
62 # just make sure the thing we're using is normally findable
63 testit "find-test-feature" \
64 $ldbsearch -H tdb://$DBPATH/private/sam.ldb \
65 -b 'CN=LostAndFound,DC=foo,DC=example,DC=com'
67 testit "add-required-feature" $ldbmodify \
68 -H tdb://$DBPATH/private/sam.ldb <<EOF
69 dn: @SAMBA_DSDB
70 changetype: modify
71 add: requiredFeatures
72 requiredFeatures: futuristic-feature
75 EOF
77 # The futuristic-feature is not implemented in this version, but it is
78 # required by this database. A search for anything should fail.
80 testit_expect_failure "find-required-feature" \
81 $ldbsearch -H tdb://$DBPATH/private/sam.ldb \
82 -b 'CN=LostAndFound,DC=foo,DC=example,DC=com'
84 rm -rf $DBPATH
86 exit $failed