summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-10-30 12:01:32 +0000
committerphk <phk@FreeBSD.org>2003-10-30 12:01:32 +0000
commit3b266c3cbf9a561d5b610513656365deed12d8d4 (patch)
treed0258a2f0a45220fdf928e7f16b00a92f31853f1 /usr.sbin/mtree
parentd61cbe3ed8f910460b487c14d1fa30ca8227a561 (diff)
downloadFreeBSD-src-3b266c3cbf9a561d5b610513656365deed12d8d4.zip
FreeBSD-src-3b266c3cbf9a561d5b610513656365deed12d8d4.tar.gz
Add another test-script for mtree(8): Check symlinks with space in them.
Diffstat (limited to 'usr.sbin/mtree')
-rw-r--r--usr.sbin/mtree/test/test01.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/usr.sbin/mtree/test/test01.sh b/usr.sbin/mtree/test/test01.sh
new file mode 100644
index 0000000..e4d3fc3
--- /dev/null
+++ b/usr.sbin/mtree/test/test01.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Copyright (c) 2003 Poul-Henning Kamp
+# All rights reserved.
+#
+# Please see src/share/examples/etc/bsd-style-copyright.
+#
+# $FreeBSD$
+#
+
+set -e
+
+TMP=/tmp/mtree.$$
+
+rm -rf ${TMP}
+mkdir -p ${TMP} ${TMP}/mr ${TMP}/mt
+
+
+ln -s "xx this=is=wrong" ${TMP}/mr/foo
+mtree -c -p ${TMP}/mr > ${TMP}/_
+
+if mtree -U -r -p ${TMP}/mt < ${TMP}/_ > /dev/null 2>&1 ; then
+ true
+else
+ echo "ERROR Mtree failed on symlink with space char" 1>&2
+ rm -rf ${TMP}
+ exit 1
+fi
+
+x=x`(cd ${TMP}/mr ; ls -l foo 2>&1) || true`
+y=x`(cd ${TMP}/mt ; ls -l foo 2>&1) || true`
+
+if [ "$x" != "$y" ] ; then
+ echo "ERROR Recreation of spaced symlink failed" 1>&2
+ rm -rf ${TMP}
+ exit 1
+fi
+
+rm -rf ${TMP}
+exit 0
OpenPOWER on IntegriCloud