24 lines
752 B
Go
24 lines
752 B
Go
|
package controltest
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestAuthenticateNull(t *testing.T) {
|
||
|
ctx, conn := NewTestContextConnected(t)
|
||
|
defer ctx.CloseConnected(conn)
|
||
|
ctx.Require.NoError(conn.Authenticate(""))
|
||
|
}
|
||
|
|
||
|
func TestAuthenticateSafeCookie(t *testing.T) {
|
||
|
ctx, conn := NewTestContextConnected(t, "--CookieAuthentication", "1")
|
||
|
defer ctx.CloseConnected(conn)
|
||
|
ctx.Require.NoError(conn.Authenticate(""))
|
||
|
}
|
||
|
|
||
|
func TestAuthenticateHashedPassword(t *testing.T) {
|
||
|
// "testpass" - 16:5417AE717521511A609921392778FFA8518EC089BF2162A199241AEB4A
|
||
|
ctx, conn := NewTestContextConnected(t, "--HashedControlPassword",
|
||
|
"16:5417AE717521511A609921392778FFA8518EC089BF2162A199241AEB4A")
|
||
|
defer ctx.CloseConnected(conn)
|
||
|
ctx.Require.NoError(conn.Authenticate("testpass"))
|
||
|
}
|