diff options
author | Colin Walters <walters@verbum.org> | 2014-09-13 10:36:59 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2014-09-13 10:41:59 -0400 |
commit | 7b01bd2e4333d4346dd08e0b5caf672f56b1ccfd (patch) | |
tree | 30e06987822ebf41650b7be62846755ce49a9199 /tests/test-admin-deploy-etcmerge-cornercases.sh | |
parent | 34c336c1f3ad98918bb044533a43985413d05734 (diff) | |
download | ostree-7b01bd2e4333d4346dd08e0b5caf672f56b1ccfd.tar.gz |
deploy: Consistently use fd-relative API
While looking to fix a different bug here, I found the current
state of things where we had a mix of fd-relative API versus not
frustrating.
Change the code around to consistently use *at, and also add some more
tests.
Diffstat (limited to 'tests/test-admin-deploy-etcmerge-cornercases.sh')
-rw-r--r-- | tests/test-admin-deploy-etcmerge-cornercases.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test-admin-deploy-etcmerge-cornercases.sh b/tests/test-admin-deploy-etcmerge-cornercases.sh index 09386aa2..17900941 100644 --- a/tests/test-admin-deploy-etcmerge-cornercases.sh +++ b/tests/test-admin-deploy-etcmerge-cornercases.sh @@ -95,4 +95,31 @@ rev=$(ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runt assert_has_file sysroot/ostree/deploy/testos/deploy/$rev.0/etc/initially-empty/afile assert_has_file sysroot/ostree/deploy/testos/deploy/$rev.0/etc/initially-empty/bfile +# Replace config file with default directory +cd "${test_tmpdir}/osdata" +mkdir usr/etc/somenewdir +ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-runtime -s "Add default dir" +cd ${test_tmpdir} +rev=$(ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime) +newconfpath=sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/somenewdir +echo "some content blah" > ${newconfpath} +if ostree admin --sysroot=sysroot upgrade --os=testos 2>err.txt; then + assert_not_reached "upgrade should have failed" +fi +assert_file_has_content err.txt "Modified config file newly defaults to directory" +rm ${newconfpath} + +# Remove parent directory of modified config file +cd "${test_tmpdir}/osdata" +rm -rf usr/etc/initially-empty +ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-runtime -s "Remove default dir" +cd ${test_tmpdir} +newconfpath=sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/initially-empty/mynewfile +touch ${newconfpath} +if ostree admin --sysroot=sysroot upgrade --os=testos 2>err.txt; then + assert_not_reached "upgrade should have failed" +fi +assert_file_has_content err.txt "New tree removes parent directory" +rm ${newconfpath} + echo "ok" |