From 0809378c9bd5afc0f5a152d220fe457b6402801c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 19 Jun 2015 03:31:19 -0700 Subject: [PATCH] audit: some tests --- audit/hashstructure_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/audit/hashstructure_test.go b/audit/hashstructure_test.go index cc8e33933..b827310f0 100644 --- a/audit/hashstructure_test.go +++ b/audit/hashstructure_test.go @@ -80,6 +80,8 @@ func TestCopy_response(t *testing.T) { } func TestHash(t *testing.T) { + now := time.Now().UTC() + cases := []struct { Input interface{} Output interface{} @@ -116,6 +118,24 @@ func TestHash(t *testing.T) { "foo", "foo", }, + { + &logical.Auth{ + LeaseOptions: logical.LeaseOptions{ + Lease: 1 * time.Hour, + LeaseIssue: now, + }, + + ClientToken: "foo", + }, + &logical.Auth{ + LeaseOptions: logical.LeaseOptions{ + Lease: 1 * time.Hour, + LeaseIssue: now, + }, + + ClientToken: "sha1:0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33", + }, + }, } for _, tc := range cases {