changeset 1962:f1ba89f735ba

Tests: fixed auth_basic.t on OpenBSD. OpenBSD does not provide any crypt() schemes except bcrypt-based "$2" anymore. As such, relevant tests are now skipped not for win32 only, but based on crypt() results. Note that just testing crypt('password', 'salt') is not enough, since Perl on win32 provides its own crypt() implementation, which is able to handle traditional DES crypt(), but rejects "$1$".
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 05 May 2024 23:56:07 +0300
parents fe6f22da53ec
children 5656138f2e46
files auth_basic.t
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/auth_basic.t
+++ b/auth_basic.t
@@ -86,7 +86,9 @@ like(http_get('/'), qr!401 Unauthorized!
 
 SKIP: {
 
-skip 'no crypt on win32', 5 if $^O eq 'MSWin32';
+skip 'no crypt', 5
+	if not crypt('password', 'salt')
+	or not crypt('password', '$1$salt$');
 
 like(http_get_auth('/', 'crypt', 'password'), qr!SEETHIS!, 'normal crypt');
 unlike(http_get_auth('/', 'crypt', '123'), qr!SEETHIS!, 'normal wrong');