diff options
author | Ruben Pollan <meskio@sindominio.net> | 2018-06-13 20:48:27 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2018-06-20 12:18:17 +0200 |
commit | 37413f5eb2b8d4719c959db03874cc9bcc362ddc (patch) | |
tree | bd14bf1489da7b0da030015d2d9ff112c1b2b833 /bitmask_go/bonafide_test.go | |
parent | d4f013fee611299aea7f8cfff0377ba8646ba17d (diff) |
[feat] get openvpn args/gateways from the eip-service.json
Diffstat (limited to 'bitmask_go/bonafide_test.go')
-rw-r--r-- | bitmask_go/bonafide_test.go | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/bitmask_go/bonafide_test.go b/bitmask_go/bonafide_test.go index c40c98d..152b108 100644 --- a/bitmask_go/bonafide_test.go +++ b/bitmask_go/bonafide_test.go @@ -11,16 +11,32 @@ var ( ) func TestGetCert(t *testing.T) { - cert, err := getCertPem() + b := newBonafide() + cert, err := b.getCertPem() if err != nil { - t.Fatal("get_cert returned an error: ", err) + t.Fatal("getCert returned an error: ", err) } if !bytes.Contains(cert, privateKeyHeader) { t.Errorf("No private key present: \n%q", cert) } - if !bytes.Equal(cert, certHeader) { + if !bytes.Contains(cert, certHeader) { t.Errorf("No cert present: \n%q", cert) } } + +func TestGetGateways(t *testing.T) { + b := newBonafide() + gateways, err := b.getGateways() + if err != nil { + t.Fatal("getGateways returned an error: ", err) + } + + for _, gw := range gateways { + if gw.IPAddress == "5.79.86.180" { + return + } + } + t.Errorf("5.79.86.180 not in the list") +} |