mirror of
https://github.com/ostreedev/ostree.git
synced 2024-12-22 17:35:55 +03:00
test: Improve pull corruption test
To verify pull with a second repo works.
This commit is contained in:
parent
bb8418ff01
commit
902848cd71
@ -35,10 +35,15 @@ do_corrupt_pull_test() {
|
||||
${CMD_PREFIX} ostree --repo=repo init
|
||||
${CMD_PREFIX} ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo
|
||||
if ${CMD_PREFIX} ostree --repo=repo pull origin main; then
|
||||
assert_not_reached "pull unexpectedly succeeded!"
|
||||
assert_not_reached "pull unexpectedly succeeded!"
|
||||
fi
|
||||
rm -rf ${repopath}
|
||||
cp -a ${repopath}.orig ${repopath}
|
||||
if ${CMD_PREFIX} ostree --repo=repo pull origin main && ${CMD_PREFIX} ostree --repo=repo fsck; then
|
||||
echo "ok pull with correct data worked"
|
||||
else
|
||||
assert_not_reached "pull with correct data failed!"
|
||||
fi
|
||||
}
|
||||
|
||||
# Corrupt .dirmeta
|
||||
@ -55,6 +60,7 @@ echo "ok corrupt dirtree"
|
||||
|
||||
# Corrupt .filez
|
||||
someobject=$(find ${repopath} -name '*.filez' | head -1)
|
||||
echo "garbage garbage garbage" > ${someobject}
|
||||
otherobject=$(find ${repopath} -name '*.filez' | head -2 | tail -1)
|
||||
cp ${someobject} ${otherobject}
|
||||
do_corrupt_pull_test
|
||||
echo "ok corrupt filez"
|
||||
|
Loading…
Reference in New Issue
Block a user