aboutsummaryrefslogtreecommitdiffstats
path: root/modules/auth/pam
diff options
context:
space:
mode:
Diffstat (limited to 'modules/auth/pam')
-rw-r--r--modules/auth/pam/pam_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/auth/pam/pam_test.go b/modules/auth/pam/pam_test.go
new file mode 100644
index 0000000000..eafc9bc3db
--- /dev/null
+++ b/modules/auth/pam/pam_test.go
@@ -0,0 +1,20 @@
+// +build pam
+
+// Copyright 2021 The Gitea Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package pam
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func TestPamAuth(t *testing.T) {
+ result, err := Auth("gitea", "user1", "false-pwd")
+ assert.Error(t, err)
+ assert.EqualValues(t, "Authentication failure", err.Error())
+ assert.Len(t, result, 0)
+}