summaryrefslogtreecommitdiff
path: root/tests/basic-test.sh
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-04-21 15:43:17 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2017-04-24 15:26:11 +0000
commit6060abbb4bd8751cc69a320b4e8e5ff058a1226b (patch)
treea23eb6969457318ee00d3b99db920b612f4269e8 /tests/basic-test.sh
parent3f1bcab27f1f6ee77e4a8d2a88858ed2e6d2aa70 (diff)
downloadostree-6060abbb4bd8751cc69a320b4e8e5ff058a1226b.tar.gz
repo: Add a "force copy" flag to checkout
This is intended to be used for copying `/usr/etc` → `/etc` for deployments. A TODO here is to use `glnx_file_copy_at()` if the repo mode allows it - then we'd use reflinks if available. Closes: #804 Approved by: jlebon
Diffstat (limited to 'tests/basic-test.sh')
-rw-r--r--tests/basic-test.sh17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/basic-test.sh b/tests/basic-test.sh
index f4b2b118..6ddf7b2e 100644
--- a/tests/basic-test.sh
+++ b/tests/basic-test.sh
@@ -19,7 +19,7 @@
set -euo pipefail
-echo "1..65"
+echo "1..66"
$CMD_PREFIX ostree --version > version.yaml
python -c 'import yaml; yaml.safe_load(open("version.yaml"))'
@@ -28,7 +28,7 @@ echo "ok yaml version"
CHECKOUT_U_ARG=""
COMMIT_ARGS=""
DIFF_ARGS=""
-if grep bare-user-only repo/config; then
+if grep -q bare-user-only repo/config; then
# In bare-user-only repos we can only represent files with uid/gid 0, no
# xattrs and canonical permissions, so we need to commit them as such, or
# we end up with repos that don't pass fsck
@@ -50,11 +50,14 @@ validate_checkout_basic() {
$OSTREE checkout test2 checkout-test2
validate_checkout_basic checkout-test2
+if grep -q 'mode=bare$' repo/config; then
+ assert_not_streq $(stat -c '%h' checkout-test2/firstfile) 1
+fi
echo "ok checkout"
# Note this tests bare-user *and* bare-user-only
rm checkout-test2 -rf
-if grep bare-user repo/config; then
+if grep -q bare-user repo/config; then
$OSTREE checkout -U -H test2 checkout-test2
else
$OSTREE checkout -H test2 checkout-test2
@@ -78,6 +81,14 @@ fi
fi
echo "ok checkout -H"
+rm checkout-test2 -rf
+$OSTREE checkout -C test2 checkout-test2
+for file in firstfile baz/cow baz/alink; do
+ assert_streq $(stat -c '%h' checkout-test2/$file) 1
+done
+
+echo "ok checkout -C"
+
$OSTREE rev-parse test2
$OSTREE rev-parse 'test2^'
$OSTREE rev-parse 'test2^^' 2>/dev/null && fatal "rev-parse test2^^ unexpectedly succeeded!"