From 6c0bbee611e9e7ac0bdcfe5c95300de19f2b0b56 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Mon, 14 May 2018 21:59:23 -0700 Subject: fixing auth test fixing auth test for auth.go auth is failing unit tests because of updated use of gettlsconfig Issue-ID: AAF-285 Change-Id: I96ec74adcce042aa411d834811881755f00b7ac7 Signed-off-by: Kiran Kamineni --- sms-service/src/sms/auth/auth_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sms-service') diff --git a/sms-service/src/sms/auth/auth_test.go b/sms-service/src/sms/auth/auth_test.go index cd11f85..dc9745b 100644 --- a/sms-service/src/sms/auth/auth_test.go +++ b/sms-service/src/sms/auth/auth_test.go @@ -24,11 +24,16 @@ import ( //Unit test to varify GetTLSconfig func and varify the tls config min version to be 771 //Assuming cert file name as auth_test.cert func TestGetTLSConfig(t *testing.T) { - _, err := GetTLSConfig("filedoesnotexist.cert") + _, err := GetTLSConfig("filedoesnotexist.cert", "filedoesnotexist.cert", "filedoesnotexist.cert") if err == nil { t.Errorf("Test failed, expected error but got none") } - tlsConfig, err := GetTLSConfig("../test/auth_test.cert") + tlsConfig, err := GetTLSConfig("../test/auth_test_certificate.pem", + "../test/auth_test_certificate.pem", + "../test/auth_test_key.pem") + if err != nil { + t.Fatal("Test Failed as GetTLSConfig returned error: " + err.Error()) + } expected := tls.VersionTLS12 actual := tlsConfig.MinVersion if tlsConfig != nil { -- cgit 1.2.3-korg