diff options
Diffstat (limited to 'testsuite/test.sh')
-rwxr-xr-x | testsuite/test.sh | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/testsuite/test.sh b/testsuite/test.sh index a0621778..5d6d2d33 100755 --- a/testsuite/test.sh +++ b/testsuite/test.sh @@ -1352,6 +1352,58 @@ echo "================================================" # These can be painfully slow so test small repos. +#confirm that checkout works with raw URLs +testing="http://abe.git@staging.git.linaro.org/git/toolchain/abe.git" +in="${testing}" +if test x"${debug}" = xyes; then + out="`cd ${local_snapshots} && checkout ${testing}`" +else + out="`cd ${local_snapshots} && checkout ${testing} 2>/dev/null`" +fi +if test $? -eq 0; then + pass "${testing}" +else + fail "${testing}" +fi + +#confirm that checkout fails approriately with a range of bad services in raw URLs +for service in "foomatic://" "http:" "http:/fake.git" "http/" "http//" ""; do + in="${service}abe.git@staging.git.linaro.org/git/toolchain/abe.git" + testing="checkout: ${in} should fail with 'proper URL required' message." + if test x"${debug}" = xyes; then + out="`cd ${local_snapshots} && checkout ${in} 2> >(tee /dev/stderr)`" + else + out="`cd ${local_snapshots} && checkout ${in} 2>&1`" + fi + if test $? -eq 0; then + fail "${testing}" + else + if echo "${out}" | tail -n1 | grep -q "^ERROR.*: checkout (Unable to parse service from '${in}'\\. You have either a bad URL, or an identifier that should be passed to get_URL\\.)$"; then + pass "${testing}" + else + fail "${testing}" + fi + fi +done + +#confirm that checkout fails with bad repo - abe is so forgiving that I can only find one suitable input +in="http://" +testing="checkout: ${in} should fail with 'cannot parse repo' message." +if test x"${debug}" = xyes; then + out="`cd ${local_snapshots} && checkout ${in} 2> >(tee /dev/stderr)`" +else + out="`cd ${local_snapshots} && checkout ${in} 2>&1`" +fi +if test $? -eq 0; then + fail "${testing}" +else + if echo "${out}" | tail -n1 | grep -q "^ERROR.*: git_parser (Malformed input\\. No repo found\\.)$"; then + pass "${testing}" + else + fail "${testing}" + fi +fi + test_checkout () { local should="$1" @@ -1531,6 +1583,18 @@ else untested "${testing}" fi +testing="checkout: http://git@<url>/<repo>.git~<branch> should pass with appropriate notice" +if test ! -e "${PWD}/host.conf"; then + package="abe.git" + branch='staging' + revision="" + should="pass" + expected="^NOTE: Checking out branch staging for abe in .\\+~staging$" + test_checkout "${should}" "${testing}" "${package}" "${branch}" "${revision}" "${expected}" +else + untested "${testing}" +fi + echo "============= misc tests ================" testing="pipefail" out="`false | tee /dev/null`" |