From: Sean Purcell Date: Thu, 6 Apr 2017 19:58:49 +0000 (-0700) Subject: Add test for overwriting read-only X-Git-Tag: v1.2.0^2~52^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9da11c6aaecff37e2b167f1e5d1e5c1463689f9a;p=thirdparty%2Fzstd.git Add test for overwriting read-only --- diff --git a/tests/playTests.sh b/tests/playTests.sh index 5abbb14e3..5409d9aa1 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -109,6 +109,13 @@ $ZSTD -q tmp && die "overwrite check failed!" $ECHO "test : force overwrite" $ZSTD -q -f tmp $ZSTD -q --force tmp +$ECHO "test : overwrite readonly file" +$ECHO foo > tmpro.zst +$ECHO foo > tmpro +chmod 400 tmpro.zst +$ZSTD -q --force tmpro || die "failed to overwrite read-only file" +chmod 600 tmpro.zst +rm tmpro tmpro.zst $ECHO "test : file removal" $ZSTD -f --rm tmp ls tmp && die "tmp should no longer be present"