Skip to content

Commit

Permalink
Fix integration test broken by previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
colmsnowplow committed Aug 1, 2022
1 parent f5291a8 commit 9917658
Showing 1 changed file with 6 additions and 25 deletions.
31 changes: 6 additions & 25 deletions pkg/target/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package target

import (
"bytes"
"encoding/base64"
"encoding/json"
"io/ioutil"
"net/http"
Expand Down Expand Up @@ -302,24 +301,6 @@ func TestHttpWrite_TLS(t *testing.T) {
}
assert := assert.New(t)

defer os.RemoveAll(`tmp_replicator`)

crt, err := os.ReadFile(`../../integration/http/localhost.crt`)
if err != nil {
return
}
encodedCrt := base64.StdEncoding.EncodeToString(crt)
key, err := os.ReadFile(`../../integration/http/localhost.key`)
if err != nil {
return
}
encodedKey := base64.StdEncoding.EncodeToString(key)
ca, err := os.ReadFile(`../../integration/http/rootCA.crt`)
if err != nil {
return
}
encodedCa := base64.StdEncoding.EncodeToString(ca)

// Test that https requests work with manually provided certs
target, err := newHTTPTarget("https://localhost:8999/hello",
5,
Expand All @@ -328,9 +309,9 @@ func TestHttpWrite_TLS(t *testing.T) {
"",
"",
"",
string(encodedCrt),
string(encodedKey),
string(encodedCa),
string(`../../integration/http/localhost.crt`),
string(`../../integration/http/localhost.key`),
string(`../../integration/http/rootCA.crt`),
false)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -362,9 +343,9 @@ func TestHttpWrite_TLS(t *testing.T) {
"",
"",
"",
string(encodedCrt),
string(encodedKey),
string(encodedCa),
string(`../../integration/http/localhost.crt`),
string(`../../integration/http/localhost.key`),
string(`../../integration/http/rootCA.crt`),
false)
if err2 != nil {
os.RemoveAll(`tmp_replicator`)
Expand Down

0 comments on commit 9917658

Please sign in to comment.