From ebcf14dc07e9b868b256bb505d9ccd612d8c8a10 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 19 Sep 2023 13:44:12 +0200 Subject: [PATCH] test: test create layer from staging directory Signed-off-by: Giuseppe Scrivano --- tests/apply-diff.bats | 58 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/tests/apply-diff.bats b/tests/apply-diff.bats index 0f4351dd1d..2f906248eb 100644 --- a/tests/apply-diff.bats +++ b/tests/apply-diff.bats @@ -44,3 +44,61 @@ 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 <