tests/basic-bare-split-xattrs: add fixture, check read logic
This commit is contained in:
parent
7e79b82ff8
commit
aca5671eb1
|
|
@ -202,6 +202,7 @@ dist_installed_test_data = tests/archive-test.sh \
|
||||||
tests/ostree-path-traverse.tar.gz \
|
tests/ostree-path-traverse.tar.gz \
|
||||||
tests/pre-signed-pull-data.tar.gz \
|
tests/pre-signed-pull-data.tar.gz \
|
||||||
tests/libtest-core.sh \
|
tests/libtest-core.sh \
|
||||||
|
tests/fixtures/bare-split-xattrs/basic.tar.xz \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXTRA_DIST += tests/libtest.sh
|
EXTRA_DIST += tests/libtest.sh
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -9,6 +9,15 @@ set -euo pipefail
|
||||||
mode="bare-split-xattrs"
|
mode="bare-split-xattrs"
|
||||||
OSTREE="${CMD_PREFIX} ostree --repo=${test_tmpdir}/repo"
|
OSTREE="${CMD_PREFIX} ostree --repo=${test_tmpdir}/repo"
|
||||||
|
|
||||||
|
SUDO="sudo --non-interactive"
|
||||||
|
PRIVILEGED="false"
|
||||||
|
if [ $(id -u) -eq 0 ]; then
|
||||||
|
PRIVILEGED="true"
|
||||||
|
SUDO=""
|
||||||
|
elif $(${SUDO} -v); then
|
||||||
|
PRIVILEGED="true"
|
||||||
|
fi
|
||||||
|
|
||||||
cd ${test_tmpdir}
|
cd ${test_tmpdir}
|
||||||
${OSTREE} init --mode "${mode}"
|
${OSTREE} init --mode "${mode}"
|
||||||
${OSTREE} config get core.mode > mode.txt
|
${OSTREE} config get core.mode > mode.txt
|
||||||
|
|
@ -44,4 +53,23 @@ fi
|
||||||
tap_ok "commit exp override"
|
tap_ok "commit exp override"
|
||||||
rm -rf -- repo files
|
rm -rf -- repo files
|
||||||
|
|
||||||
|
if [ "${PRIVILEGED}" = "true" ]; then
|
||||||
|
COMMIT="d614c428015227259031b0f19b934dade908942fd71c49047e0daa70e7800a5d"
|
||||||
|
cd ${test_tmpdir}
|
||||||
|
${SUDO} tar --same-permissions --same-owner -xaf ${test_srcdir}/fixtures/bare-split-xattrs/basic.tar.xz
|
||||||
|
${SUDO} ${OSTREE} fsck --all
|
||||||
|
${OSTREE} log ${COMMIT} > out.txt
|
||||||
|
assert_file_has_content_literal out.txt "fixtures: bare-split-xattrs repo"
|
||||||
|
${OSTREE} ls ${COMMIT} -X /foo > out.txt
|
||||||
|
assert_file_has_content_literal out.txt "{ @a(ayay) [] } /foo"
|
||||||
|
${OSTREE} ls ${COMMIT} -X /bar > out.txt
|
||||||
|
assert_file_has_content_literal out.txt "{ [(b'user.mykey', [byte 0x6d, 0x79, 0x76, 0x61, 0x6c, 0x75, 0x65])] } /bar"
|
||||||
|
${OSTREE} ls ${COMMIT} /foolink > out.txt
|
||||||
|
assert_file_has_content_literal out.txt "/foolink -> foo"
|
||||||
|
tap_ok "reading simple fixture"
|
||||||
|
${SUDO} rm -rf -- repo log.txt
|
||||||
|
else
|
||||||
|
tap_ok "reading simple fixture # skip Unable to sudo"
|
||||||
|
fi
|
||||||
|
|
||||||
tap_end
|
tap_end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue