misc test fixes

This commit is contained in:
Colin Walters 2011-11-01 08:49:01 -04:00
parent c910f29c00
commit e125dffbfd
2 changed files with 11 additions and 2 deletions

View File

@ -35,6 +35,10 @@ die () {
fi fi
} }
assert_streq () {
test "$1" = "$2" || (echo "$1 != $2"; exit 1)
}
assert_has_file () { assert_has_file () {
test -f "$1" || (echo "Couldn't find '$1'"; exit 1) test -f "$1" || (echo "Couldn't find '$1'"; exit 1)
} }
@ -81,7 +85,7 @@ setup_test_repository () {
if test "$mode" = "archive"; then if test "$mode" = "archive"; then
ostree init --archive $ot_repo ostree init --archive $ot_repo
else else
ostree init --archive $ot_repo ostree init $ot_repo
fi 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 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 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

View File

@ -20,13 +20,18 @@
set -e set -e
echo "1..6" echo "1..7"
. libtest.sh . libtest.sh
setup_test_repository "regular" setup_test_repository "regular"
echo "ok setup" 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 ostree checkout $ot_repo test2 checkout-test2
echo "ok checkout" echo "ok checkout"