summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree/test
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2006-07-03 10:55:22 +0000
committermaxim <maxim@FreeBSD.org>2006-07-03 10:55:22 +0000
commit8b4567954816aa15b8523fddfd8a49d4c756b26f (patch)
tree35c89a96671ac41a2996c77c3f64e00872f36eae /usr.sbin/mtree/test
parent57f08c23c3227560f032b55c61beba76566b1793 (diff)
downloadFreeBSD-src-8b4567954816aa15b8523fddfd8a49d4c756b26f.zip
FreeBSD-src-8b4567954816aa15b8523fddfd8a49d4c756b26f.tar.gz
o Add an 'optional' keyword, which allows files to be in the
specification, but not in the file hierarchy. PR: bin/99531 Submitted by: skv Obtained from: NetBSD, originally from Ed Symanzik Regress. test: test/test05.sh MFC after: 1 month
Diffstat (limited to 'usr.sbin/mtree/test')
-rw-r--r--usr.sbin/mtree/test/test05.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/usr.sbin/mtree/test/test05.sh b/usr.sbin/mtree/test/test05.sh
new file mode 100644
index 0000000..eda544f
--- /dev/null
+++ b/usr.sbin/mtree/test/test05.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# Test for 'optional' keyword.
+#
+
+TMP=`mktemp -d /tmp/mtree.XXXXXX`
+mkdir -p ${TMP}/mr ${TMP}/mr/optional-dir ${TMP}/mr/some-dir
+touch ${TMP}/mr/optional-file ${TMP}/mr/some-file
+
+mtree -c -p ${TMP}/mr > ${TMP}/_
+rm -rf ${TMP}/mr/optional-file ${TMP}/mr/optional-dir
+mtree -p ${TMP}/mr -K optional < ${TMP}/_ > /dev/null
+
+res=$?
+
+if [ $res -ne 0 ] ; then
+ echo "ERROR 'optional' keyword failed" 1>&2
+ rm -rf ${TMP}
+ exit 1
+fi
+
+rm -rf ${TMP}
+exit 0
OpenPOWER on IntegriCloud