From e68b9d00a6e05b3a941f63ffb696f91e554ac5ec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.3. Signed-off-by: Daniel Baumann --- modules/auth/pam/pam_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 modules/auth/pam/pam_test.go (limited to 'modules/auth/pam/pam_test.go') diff --git a/modules/auth/pam/pam_test.go b/modules/auth/pam/pam_test.go new file mode 100644 index 0000000..e9b844e --- /dev/null +++ b/modules/auth/pam/pam_test.go @@ -0,0 +1,20 @@ +//go:build pam + +// Copyright 2021 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + +package pam + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestPamAuth(t *testing.T) { + result, err := Auth("gitea", "user1", "false-pwd") + require.Error(t, err) + assert.EqualError(t, err, "Authentication failure") + assert.Len(t, result, 0) +} -- cgit v1.2.3