summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--transaction_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/transaction_test.go b/transaction_test.go
index e5da07b..b5b807e 100644
--- a/transaction_test.go
+++ b/transaction_test.go
@@ -160,6 +160,13 @@ func TestPAM_005(t *testing.T) {
if err != nil {
t.Fatalf("start #error: %v", err)
}
+ service, err := tx.GetItem(Service)
+ if err != nil {
+ t.Fatalf("GetItem #error: %v", err)
+ }
+ if service != "passwd" {
+ t.Fatalf("Unexpected service: %v", service)
+ }
err = tx.ChangeAuthTok(Silent)
if err != nil {
t.Fatalf("chauthtok #error: %v", err)
@@ -234,6 +241,13 @@ func TestPAM_ConfDir(t *testing.T) {
// nothing else we do, we don't support it.
return
}
+ service, err := tx.GetItem(Service)
+ if err != nil {
+ t.Fatalf("GetItem #error: %v", err)
+ }
+ if service != "permit-service" {
+ t.Fatalf("Unexpected service: %v", service)
+ }
if err != nil {
t.Fatalf("start #error: %v", err)
}
@@ -285,6 +299,13 @@ func TestPAM_ConfDir_InfoMessage(t *testing.T) {
if err != nil {
t.Fatalf("start #error: %v", err)
}
+ service, err := tx.GetItem(Service)
+ if err != nil {
+ t.Fatalf("GetItem #error: %v", err)
+ }
+ if service != "echo-service" {
+ t.Fatalf("Unexpected service: %v", service)
+ }
err = tx.Authenticate(0)
if err != nil {
t.Fatalf("authenticate #error: %v", err)
@@ -302,6 +323,13 @@ func TestPAM_ConfDir_Deny(t *testing.T) {
if err != nil {
t.Fatalf("start #error: %v", err)
}
+ service, err := tx.GetItem(Service)
+ if err != nil {
+ t.Fatalf("GetItem #error: %v", err)
+ }
+ if service != "deny-service" {
+ t.Fatalf("Unexpected service: %v", service)
+ }
err = tx.Authenticate(0)
if err == nil {
t.Fatalf("authenticate #expected an error")