[ostree] test: Improve pull corruption test



commit 902848cd71d699ad7e3532247e33155e4cb0ff50
Author: Jeremy Whiting <jpwhiting kde org>
Date:   Tue Aug 27 16:01:43 2013 -0600

    test: Improve pull corruption test
    
    To verify pull with a second repo works.

 tests/test-pull-corruption.sh |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/tests/test-pull-corruption.sh b/tests/test-pull-corruption.sh
index 7a28cce..70efa88 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"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]