ostree/manual-tests/static-delta-generate-crosscheck.sh
Colin Walters 455cc5e892 repo+tests: Add [core]disable-xattrs=true, use it on overlayfs
There are a lot of things suboptimal about this approach, but
on the other hand we need to get our CI back up and running.

The basic approach is to - in the test suite, detect if we're on overlayfs. If
so, set a flag in the repo, which gets picked up by a few strategic places in
the core to turn on "ignore xattrs".

I also had to add a variant of this for the sysroot work.

The core problem here is while overlayfs will let us read and
see the SELinux labels, it won't let us write them.

Down the line, we should improve this so that we can selectively ignore e.g.
`security.*` attributes but not `user.*` say.

Closes: https://github.com/ostreedev/ostree/issues/758

Closes: #759
Approved by: jlebon
2017-03-24 22:16:43 +00:00

62 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Generate multiple variants of static deltas in a repo, then use them
# to upgrade in a test repository, verifying that fsck works.
#
# This test is manual so it's easy to run against arbitrary content.
set -euo pipefail
repo=$(pwd)/${1}
shift
branch=${1}
shift
from=$(ostree --repo=${repo} rev-parse "${branch}"^)
to=$(ostree --repo=${repo} rev-parse ${branch})
tmpdir=$(mktemp -d /var/tmp/ostree-delta-check.XXXXXX)
cd ${tmpdir}
touch ${tmpdir}/.tmp
echo "Using tmpdir ${tmpdir}"
cleanup_tmpdir() {
if test -f ${tmpdir}/.tmp; then
rm -rf ${tmpdir}
fi
}
if test -z "${PRESERVE_TMP:-}"; then
trap cleanup_tmpdir EXIT
fi
fatal() {
echo "$@"
exit 1
}
assert_streq() {
if ! test $1 = $2; then
fatal "assertion failed: $1 = $2"
fi
}
validate_delta_options() {
mkdir testrepo
ostree_repo_init testrepo --mode=bare-user
ostree --repo=testrepo remote add --set=gpg-verify=false local file://${repo}
ostree --repo=${repo} static-delta generate $@ --from=${from} --to=${to}
ostree --repo=testrepo pull --require-static-deltas local ${branch}@${from}
assert_streq $(ostree --repo=testrepo rev-parse ${branch}) ${from}
ostree --repo=testrepo pull --require-static-deltas local ${branch}
assert_streq $(ostree --repo=testrepo rev-parse ${branch}) ${to}
ostree --repo=testrepo fsck
rm testrepo -rf
}
set -x
validate_delta_options
validate_delta_options --inline
validate_delta_options --disable-bsdiff