python:tests: Store keys as bytes rather than as lists of ints
[samba.git] / source4 / setup / tests / blackbox_supported_features.sh
index 640338ebf8476be51635e5fccaeee3ce41d42204..9861fbc39279c116a517ec38471f98d2cb259e79 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/sh
 
 if [ $# -lt 1 ]; then
-cat <<EOF
+       cat <<EOF
 Usage: blackbox_supported_features.sh PREFIX
 EOF
-exit 1;
+       exit 1
 fi
 
 PREFIX="$1"
@@ -12,29 +12,31 @@ shift 1
 
 DBPATH=$PREFIX/supported-features
 
-. `dirname $0`/../../../testprogs/blackbox/subunit.sh
+mkdir -p $DBPATH
+
+. $(dirname $0)/../../../testprogs/blackbox/subunit.sh
 
 ldbmodify="ldbmodify"
 if [ -x "$BINDIR/ldbmodify" ]; then
-    ldbmodify="$BINDIR/ldbmodify"
+       ldbmodify="$BINDIR/ldbmodify"
 fi
 
 ldbdel="ldbdel"
 if [ -x "$BINDIR/ldbdel" ]; then
-    ldbdel="$BINDIR/ldbdel"
+       ldbdel="$BINDIR/ldbdel"
 fi
 
 ldbsearch="ldbsearch"
 if [ -x "$BINDIR/ldbsearch" ]; then
-    ldbsearch="$BINDIR/ldbsearch"
+       ldbsearch="$BINDIR/ldbsearch"
 fi
 
 testit "provision" $PYTHON $BINDIR/samba-tool domain provision \
-       --domain=FOO --realm=foo.example.com \
-       --targetdir=$DBPATH --use-ntvfs
+       --domain=FOO --realm=foo.example.com \
+       --targetdir=$DBPATH --use-ntvfs
 
 testit "add-compatible-feature" $ldbmodify \
-       -H tdb://$DBPATH/private/sam.ldb <<EOF
+       -H tdb://$DBPATH/private/sam.ldb <<EOF
 dn: @SAMBA_DSDB
 changetype: modify
 add: compatibleFeatures
@@ -47,25 +49,23 @@ EOF
 # should not be listed in compatibleFeatures even though we tried to
 # put it there.
 
-ldb_search_fail() {
-    $ldbsearch -H tdb://$DBPATH/private/sam.ldb \
-               -s base -b "$1" "$2" \
-        |   grep -q "$3"
+ldb_search_fail()
+{
+       $ldbsearch -H tdb://$DBPATH/private/sam.ldb \
+               -s base -b "$1" "$2" |
+               grep -q "$3"
 }
 
-
 testit_expect_failure "find-compatible-feature" \
-                      ldb_search_fail '@SAMBA_DSDB' 'compatibleFeatures' non-existent-feature
-
+       ldb_search_fail '@SAMBA_DSDB' 'compatibleFeatures' non-existent-feature
 
 # just make sure the thing we're using is normally findable
 testit "find-test-feature" \
-       $ldbsearch -H tdb://$DBPATH/private/sam.ldb \
-       -b 'CN=LostAndFound,DC=foo,DC=example,DC=com'
-
+       $ldbsearch -H tdb://$DBPATH/private/sam.ldb \
+       -b 'CN=LostAndFound,DC=foo,DC=example,DC=com'
 
 testit "add-required-feature" $ldbmodify \
-       -H tdb://$DBPATH/private/sam.ldb <<EOF
+       -H tdb://$DBPATH/private/sam.ldb <<EOF
 dn: @SAMBA_DSDB
 changetype: modify
 add: requiredFeatures
@@ -78,8 +78,8 @@ EOF
 # required by this database. A search for anything should fail.
 
 testit_expect_failure "find-required-feature" \
-                      $ldbsearch -H tdb://$DBPATH/private/sam.ldb \
-                      -b 'CN=LostAndFound,DC=foo,DC=example,DC=com'
+       $ldbsearch -H tdb://$DBPATH/private/sam.ldb \
+       -b 'CN=LostAndFound,DC=foo,DC=example,DC=com'
 
 rm -rf $DBPATH