[ostree] misc test fixes



commit e125dffbfd6b72fbde648c1e8a4367dda26ee887
Author: Colin Walters <walters verbum org>
Date:   Tue Nov 1 08:49:01 2011 -0400

    misc test fixes

 tests/libtest.sh     |    6 +++++-
 tests/t0000-basic.sh |    7 ++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/tests/libtest.sh b/tests/libtest.sh
index cbd3ea6..5c0dff8 100644
--- a/tests/libtest.sh
+++ b/tests/libtest.sh
@@ -35,6 +35,10 @@ die () {
     fi
 }
 
+assert_streq () {
+    test "$1" = "$2" || (echo "$1 != $2"; exit 1)
+}
+
 assert_has_file () {
     test -f "$1" || (echo "Couldn't find '$1'"; exit 1)
 }
@@ -81,7 +85,7 @@ setup_test_repository () {
     if test "$mode" = "archive"; then
 	ostree init --archive $ot_repo
     else
-	ostree init --archive $ot_repo
+	ostree init $ot_repo
     fi
     ostree commit $ot_repo -b test2 -s "Test Commit 1" -m "Commit body first" --add=firstfile --add=somelink
     ostree commit $ot_repo -b test2 -s "Test Commit 2" -m "Commit body second" --add=baz/cow  --add=baz/saucer --add=baz/deeper/ohyeah --add=baz/another/y --add=baz/alink
diff --git a/tests/t0000-basic.sh b/tests/t0000-basic.sh
index 57315de..3e07b8f 100755
--- a/tests/t0000-basic.sh
+++ b/tests/t0000-basic.sh
@@ -20,13 +20,18 @@
 
 set -e
 
-echo "1..6"
+echo "1..7"
 
 . libtest.sh
 
 setup_test_repository "regular"
 echo "ok setup"
 
+assert_file_has_content ${test_tmpdir}/repo/objects/f2/c7a70e5e252c1cb7a018d98f34cbf01d553185e9adc775e10213f4187fa91a.file moo
+assert_streq "$(readlink ${test_tmpdir}/repo/objects/cf/443bea5eb400bc25b376c07925cc06cd05235d5fb38f20cd5f7ca53b7b3b10.file)" nonexistent
+
+echo "ok check"
+
 ostree checkout $ot_repo test2 checkout-test2
 echo "ok checkout"
 



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