commit-reach(get_octopus_merge_bases): pass on "missing commits" errors
[git.git] / t / t0303-credential-external.sh
blob095574bfc6edf2aaf835b2ff43bb8cd35f792591
1 #!/bin/sh
3 test_description='external credential helper tests
5 This is a tool for authors of external helper tools to sanity-check
6 their helpers. If you have written the "git-credential-foo" helper,
7 you check it with:
9 make GIT_TEST_CREDENTIAL_HELPER=foo t0303-credential-external.sh
11 This assumes that your helper is capable of both storing and
12 retrieving credentials (some helpers may be read-only, and they will
13 fail these tests).
15 Please note that the individual tests do not verify all of the
16 preconditions themselves, but rather build on each other. A failing
17 test means that tests later in the sequence can return false "OK"
18 results.
20 If your helper supports time-based expiration with a configurable
21 timeout, you can test that feature with:
23 make GIT_TEST_CREDENTIAL_HELPER=foo \
24 GIT_TEST_CREDENTIAL_HELPER_TIMEOUT="foo --timeout=1" \
25 t0303-credential-external.sh
27 If your helper requires additional setup before the tests are started,
28 you can set GIT_TEST_CREDENTIAL_HELPER_SETUP to a sequence of shell
29 commands.
32 . ./test-lib.sh
33 . "$TEST_DIRECTORY"/lib-credential.sh
35 if test -z "$GIT_TEST_CREDENTIAL_HELPER"; then
36 skip_all="used to test external credential helpers"
37 test_done
40 test -z "$GIT_TEST_CREDENTIAL_HELPER_SETUP" ||
41 eval "$GIT_TEST_CREDENTIAL_HELPER_SETUP"
43 # clean before the test in case there is cruft left
44 # over from a previous run that would impact results
45 helper_test_clean "$GIT_TEST_CREDENTIAL_HELPER"
47 helper_test "$GIT_TEST_CREDENTIAL_HELPER"
48 helper_test_password_expiry_utc "$GIT_TEST_CREDENTIAL_HELPER"
49 helper_test_oauth_refresh_token "$GIT_TEST_CREDENTIAL_HELPER"
51 if test -z "$GIT_TEST_CREDENTIAL_HELPER_TIMEOUT"; then
52 say "# skipping timeout tests (GIT_TEST_CREDENTIAL_HELPER_TIMEOUT not set)"
53 else
54 helper_test_timeout "$GIT_TEST_CREDENTIAL_HELPER_TIMEOUT"
57 # clean afterwards so that we are good citizens
58 # and don't leave cruft in the helper's storage, which
59 # might be long-term system storage
60 helper_test_clean "$GIT_TEST_CREDENTIAL_HELPER"
62 test_done