diff options
author | Andy Wingo <wingo@pobox.com> | 2019-02-01 17:18:50 +0100 |
---|---|---|
committer | Andy Wingo <wingo@igalia.com> | 2019-02-21 11:13:28 +0100 |
commit | 27ffbfb0235de466016ea5a6421508f6548971b6 (patch) | |
tree | ceb8c06cafa494001c763483c7872011972a5756 /test-suite | |
parent | 78468baa118d316050a27e43250966e52ffd3d54 (diff) |
Fix crypt-on-glibc test error
* test-suite/tests/posix.test ("crypt"): Allow for the given salt being
valid. Thanks to Jonathan Brielmaier for the report and debugging!
Diffstat (limited to 'test-suite')
-rw-r--r-- | test-suite/tests/posix.test | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test index d3170c743..87a0c704a 100644 --- a/test-suite/tests/posix.test +++ b/test-suite/tests/posix.test @@ -262,10 +262,17 @@ (pass-if "basic usage" (string? (crypt "pass" "abcdefg"))) - (pass-if-exception "glibc EINVAL" exception:system-error - ;; This used to deadlock while trying to throw to 'system-error'. - ;; This test uses the special interpretation of the salt that glibc - ;; does; specifically, we pass a syntactically invalid salt here. - (if (string-contains %host-type "-gnu") - (crypt "pass" "$X$abc") ;EINVAL - (throw 'unresolved)))) + (pass-if "crypt invalid salt on glibc" + (begin + (unless (string-contains %host-type "-gnu") + (throw 'unresolved)) + (catch 'system-error + (lambda () + ;; This used to deadlock on glibc while trying to throw to + ;; 'system-error'. This test uses the special + ;; interpretation of the salt that glibc does; + ;; specifically, we pass a salt that's probably + ;; syntactically invalid here. Note, whether it's invalid + ;; or not is system-defined, so it's possible it just works. + (string? (crypt "pass" "$X$abc"))) + (lambda _ #t))))) |