From 902848cd71d699ad7e3532247e33155e4cb0ff50 Mon Sep 17 00:00:00 2001 From: Jeremy Whiting Date: Tue, 27 Aug 2013 16:01:43 -0600 Subject: [PATCH] test: Improve pull corruption test To verify pull with a second repo works. --- tests/test-pull-corruption.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test-pull-corruption.sh b/tests/test-pull-corruption.sh index 7a28cce8..70efa886 100755 --- a/tests/test-pull-corruption.sh +++ b/tests/test-pull-corruption.sh @@ -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"