summaryrefslogtreecommitdiffstats
path: root/modules/auth/pam/pam_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/auth/pam/pam_test.go')
-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 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)
+}