]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - usr.sbin/mtree/test/test01.sh
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / usr.sbin / mtree / test / test01.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2003 Poul-Henning Kamp
4 # All rights reserved.
5 #
6 # Please see src/share/examples/etc/bsd-style-copyright.
7 #
8 # $FreeBSD$
9 #
10
11 set -e
12
13 TMP=/tmp/mtree.$$
14
15 rm -rf ${TMP}
16 mkdir -p ${TMP} ${TMP}/mr ${TMP}/mt
17
18
19 ln -s "xx this=is=wrong" ${TMP}/mr/foo
20 mtree -c -p ${TMP}/mr > ${TMP}/_
21
22 if mtree -U -r -p ${TMP}/mt < ${TMP}/_ > /dev/null 2>&1 ; then
23         true
24 else
25         echo "ERROR Mtree failed on symlink with space char" 1>&2
26         rm -rf ${TMP}
27         exit 1
28 fi
29
30 x=x`(cd ${TMP}/mr ; ls -l foo 2>&1) || true`
31 y=x`(cd ${TMP}/mt ; ls -l foo 2>&1) || true`
32
33 if [ "$x" != "$y" ] ; then
34         echo "ERROR Recreation of spaced symlink failed" 1>&2
35         rm -rf ${TMP}
36         exit 1
37 fi
38
39 rm -rf ${TMP}
40 exit 0