Skip to content
Snippets Groups Projects
Commit 29c0229f authored by Josh Brooks's avatar Josh Brooks
Browse files

Allow for disabling TLS in tests

parent 268f44b8
No related branches found
No related tags found
2 merge requests!117Release,!77Xx 3563/disable tls check
...@@ -9,6 +9,7 @@ package gateway ...@@ -9,6 +9,7 @@ package gateway
import ( import (
"fmt" "fmt"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/storage" "gitlab.com/elixxir/client/storage"
"gitlab.com/elixxir/comms/network" "gitlab.com/elixxir/comms/network"
"gitlab.com/elixxir/crypto/fastRNG" "gitlab.com/elixxir/crypto/fastRNG"
...@@ -16,10 +17,17 @@ import ( ...@@ -16,10 +17,17 @@ import (
"gitlab.com/xx_network/crypto/csprng" "gitlab.com/xx_network/crypto/csprng"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/ndf" "gitlab.com/xx_network/primitives/ndf"
"os"
"reflect" "reflect"
"testing" "testing"
) )
func TestMain(m *testing.M) {
jww.SetStdoutThreshold(jww.LevelTrace)
connect.TestingOnlyDisableTLS = true
os.Exit(m.Run())
}
// Unit test // Unit test
func TestNewHostPool(t *testing.T) { func TestNewHostPool(t *testing.T) {
manager := newMockManager() manager := newMockManager()
......
...@@ -2,6 +2,7 @@ package message ...@@ -2,6 +2,7 @@ package message
import ( import (
"encoding/binary" "encoding/binary"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/interfaces/message" "gitlab.com/elixxir/client/interfaces/message"
"gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/interfaces/params"
"gitlab.com/elixxir/client/network/gateway" "gitlab.com/elixxir/client/network/gateway"
...@@ -13,13 +14,21 @@ import ( ...@@ -13,13 +14,21 @@ import (
"gitlab.com/elixxir/comms/client" "gitlab.com/elixxir/comms/client"
"gitlab.com/elixxir/crypto/fastRNG" "gitlab.com/elixxir/crypto/fastRNG"
"gitlab.com/elixxir/primitives/format" "gitlab.com/elixxir/primitives/format"
"gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/crypto/csprng" "gitlab.com/xx_network/crypto/csprng"
"gitlab.com/xx_network/primitives/netTime" "gitlab.com/xx_network/primitives/netTime"
"math/rand" "math/rand"
"os"
"testing" "testing"
"time" "time"
) )
func TestMain(m *testing.M) {
jww.SetStdoutThreshold(jww.LevelTrace)
connect.TestingOnlyDisableTLS = true
os.Exit(m.Run())
}
type TestListener struct { type TestListener struct {
ch chan bool ch chan bool
} }
......
...@@ -8,17 +8,26 @@ ...@@ -8,17 +8,26 @@
package rounds package rounds
import ( import (
jww "github.com/spf13/jwalterweatherman"
bloom "gitlab.com/elixxir/bloomfilter" bloom "gitlab.com/elixxir/bloomfilter"
"gitlab.com/elixxir/client/interfaces" "gitlab.com/elixxir/client/interfaces"
"gitlab.com/elixxir/client/storage/reception" "gitlab.com/elixxir/client/storage/reception"
"gitlab.com/elixxir/comms/mixmessages" "gitlab.com/elixxir/comms/mixmessages"
"gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id/ephemeral" "gitlab.com/xx_network/primitives/id/ephemeral"
"os"
"reflect" "reflect"
"testing" "testing"
"time" "time"
) )
func TestMain(m *testing.M) {
jww.SetStdoutThreshold(jww.LevelTrace)
connect.TestingOnlyDisableTLS = true
os.Exit(m.Run())
}
// Unit test NewRemoteFilter // Unit test NewRemoteFilter
func TestNewRemoteFilter(t *testing.T) { func TestNewRemoteFilter(t *testing.T) {
bloomFilter := &mixmessages.ClientBloom{ bloomFilter := &mixmessages.ClientBloom{
......
...@@ -8,12 +8,21 @@ ...@@ -8,12 +8,21 @@
package registration package registration
import ( import (
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/comms/client" "gitlab.com/elixxir/comms/client"
"gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/ndf" "gitlab.com/xx_network/primitives/ndf"
"os"
"testing" "testing"
) )
func TestMain(m *testing.M) {
jww.SetStdoutThreshold(jww.LevelTrace)
connect.TestingOnlyDisableTLS = true
os.Exit(m.Run())
}
// Init should create a valid Registration communications struct // Init should create a valid Registration communications struct
func TestInit(t *testing.T) { func TestInit(t *testing.T) {
// Create dummy comms and ndf // Create dummy comms and ndf
......
package ud package ud
import ( import (
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/comms/client" "gitlab.com/elixxir/comms/client"
pb "gitlab.com/elixxir/comms/mixmessages" pb "gitlab.com/elixxir/comms/mixmessages"
"gitlab.com/elixxir/primitives/fact" "gitlab.com/elixxir/primitives/fact"
...@@ -8,9 +9,16 @@ import ( ...@@ -8,9 +9,16 @@ import (
"gitlab.com/xx_network/crypto/csprng" "gitlab.com/xx_network/crypto/csprng"
"gitlab.com/xx_network/crypto/signature/rsa" "gitlab.com/xx_network/crypto/signature/rsa"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"os"
"testing" "testing"
) )
func TestMain(m *testing.M) {
jww.SetStdoutThreshold(jww.LevelTrace)
connect.TestingOnlyDisableTLS = true
os.Exit(m.Run())
}
type testAFC struct{} type testAFC struct{}
// Dummy implementation of SendRegisterFact so that we don't need to run our own // Dummy implementation of SendRegisterFact so that we don't need to run our own
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment