Codebase list ostree / aca5671
tests/basic-bare-split-xattrs: add fixture, check read logic Luca BRUNO 2 years ago
3 changed file(s) with 29 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
201201 tests/ostree-path-traverse.tar.gz \
202202 tests/pre-signed-pull-data.tar.gz \
203203 tests/libtest-core.sh \
204 tests/fixtures/bare-split-xattrs/basic.tar.xz \
204205 $(NULL)
205206
206207 EXTRA_DIST += tests/libtest.sh
77
88 mode="bare-split-xattrs"
99 OSTREE="${CMD_PREFIX} ostree --repo=${test_tmpdir}/repo"
10
11 SUDO="sudo --non-interactive"
12 PRIVILEGED="false"
13 if [ $(id -u) -eq 0 ]; then
14 PRIVILEGED="true"
15 SUDO=""
16 elif $(${SUDO} -v); then
17 PRIVILEGED="true"
18 fi
1019
1120 cd ${test_tmpdir}
1221 ${OSTREE} init --mode "${mode}"
4352 tap_ok "commit exp override"
4453 rm -rf -- repo files
4554
55 if [ "${PRIVILEGED}" = "true" ]; then
56 COMMIT="d614c428015227259031b0f19b934dade908942fd71c49047e0daa70e7800a5d"
57 cd ${test_tmpdir}
58 ${SUDO} tar --same-permissions --same-owner -xaf ${test_srcdir}/fixtures/bare-split-xattrs/basic.tar.xz
59 ${SUDO} ${OSTREE} fsck --all
60 ${OSTREE} log ${COMMIT} > out.txt
61 assert_file_has_content_literal out.txt "fixtures: bare-split-xattrs repo"
62 ${OSTREE} ls ${COMMIT} -X /foo > out.txt
63 assert_file_has_content_literal out.txt "{ @a(ayay) [] } /foo"
64 ${OSTREE} ls ${COMMIT} -X /bar > out.txt
65 assert_file_has_content_literal out.txt "{ [(b'user.mykey', [byte 0x6d, 0x79, 0x76, 0x61, 0x6c, 0x75, 0x65])] } /bar"
66 ${OSTREE} ls ${COMMIT} /foolink > out.txt
67 assert_file_has_content_literal out.txt "/foolink -> foo"
68 tap_ok "reading simple fixture"
69 ${SUDO} rm -rf -- repo log.txt
70 else
71 tap_ok "reading simple fixture # skip Unable to sudo"
72 fi
73
4674 tap_end