diff --git a/tests/apply-diff.bats b/tests/apply-diff.bats index 0f4351dd1d..83807c845e 100644 --- a/tests/apply-diff.bats +++ b/tests/apply-diff.bats @@ -44,3 +44,60 @@ load helpers checkchanges checkdiffs } + +@test "apply-diff-from-staging-directory" { + case "$STORAGE_DRIVER" in + overlay*) + ;; + *) + skip "driver $STORAGE_DRIVER does not support diff-from-staging-directory" + ;; + esac + + SRC=$TESTDIR/source + mkdir -p $SRC + createrandom $SRC/file1 + createrandom $SRC/file2 + createrandom $SRC/file3 + + local sconf=$TESTDIR/storage.conf + + local root=`storage status 2>&1 | awk '/^Root:/{print $2}'` + local runroot=`storage status 2>&1 | awk '/^Run Root:/{print $3}'` + + cat >$sconf <