Add test for overwriting read-only

This commit is contained in:
Sean Purcell 2017-04-06 12:58:49 -07:00
parent 279be2015b
commit 9da11c6aae

View File

@ -109,6 +109,13 @@ $ZSTD -q tmp && die "overwrite check failed!"
$ECHO "test : force overwrite" $ECHO "test : force overwrite"
$ZSTD -q -f tmp $ZSTD -q -f tmp
$ZSTD -q --force 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" $ECHO "test : file removal"
$ZSTD -f --rm tmp $ZSTD -f --rm tmp
ls tmp && die "tmp should no longer be present" ls tmp && die "tmp should no longer be present"