From: Wayne Davison Date: Tue, 20 Sep 2011 20:19:39 +0000 (-0700) Subject: Add solaris xattr support to the tests. X-Git-Tag: v3.1.0pre1~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c7fdf705ec0ef4393d4af3f87de5f13956ece45;p=thirdparty%2Frsync.git Add solaris xattr support to the tests. Change the xattr case statements to use $HOST_OS. (Slightly tweaked version of a Ben Walton patch.) --- diff --git a/testsuite/chown.test b/testsuite/chown.test index 6f73a709..30a3a94d 100644 --- a/testsuite/chown.test +++ b/testsuite/chown.test @@ -18,14 +18,25 @@ case $0 in $RSYNC --version | grep ", xattrs" >/dev/null || test_skipped "Rsync needs xattrs for fake device tests" RSYNC="$RSYNC --fake-super" TLS_ARGS="$TLS_ARGS --fake-super" - case "`xattr 2>&1 || true`" in - *--list:*) + case "$HOST_OS" in + darwin*) chown() { own=$1 shift xattr -s 'rsync.%stat' "100644 0,0 $own" "${@}" } ;; + solaris*) + chown() { + own=$1 + shift + for fn in "${@}"; do + runat "$fn" "$SHELL_PATH" < rsync.%stat +EOF + done + } + ;; *) chown() { own=$1 diff --git a/testsuite/devices.test b/testsuite/devices.test index 1f6f068b..a9245138 100644 --- a/testsuite/devices.test +++ b/testsuite/devices.test @@ -19,8 +19,8 @@ case $0 in $RSYNC --version | grep ", xattrs" >/dev/null || test_skipped "Rsync needs xattrs for fake device tests" RSYNC="$RSYNC --fake-super" TLS_ARGS="$TLS_ARGS --fake-super" - case "`xattr 2>&1 || true`" in - *--list:*) + case "$HOST_OS" in + darwin*) mknod() { fn="$1" case "$2" in @@ -34,6 +34,22 @@ case $0 in xattr -s 'rsync.%stat' "$mode $maj,$min 0:0" "$fn" } ;; + solaris*) + mknod() { + fn="$1" + case "$2" in + p) mode=10644 ;; + c) mode=20644 ;; + b) mode=60644 ;; + esac + maj="${3:-0}" + min="${4:-0}" + touch "$fn" + runat "$fn" "$SHELL_PATH" < rsync.%stat +EOF + } + ;; *) mknod() { fn="$1" diff --git a/testsuite/xattrs.test b/testsuite/xattrs.test index c1846df5..06afcba0 100644 --- a/testsuite/xattrs.test +++ b/testsuite/xattrs.test @@ -10,8 +10,8 @@ lnkdir="$tmpdir/lnk" $RSYNC --version | grep ", xattrs" >/dev/null || test_skipped "Rsync is configured without xattr support" -case "`xattr 2>&1 || true`" in -*--list:*) +case "$HOST_OS" in +darwin*) xset() { xnam="$1" xval="$2" @@ -24,6 +24,27 @@ case "`xattr 2>&1 || true`" in RSYNC_PREFIX='rsync' RUSR='rsync.nonuser' ;; +solaris*) + xset() { + xnam="$1" + xval="$2" + shift 2 + for fn in "${@}"; do + runat "$fn" "$SHELL_PATH" < "${xnam}" +EOF + done + } + xls() { + for fn in "${@}"; do + runat "$fn" "$SHELL_PATH" <