summaryrefslogtreecommitdiff
path: root/caddytest/integration/sni_test.go
diff options
context:
space:
mode:
authorMark Sargent <99003+sarge@users.noreply.github.com>2020-04-27 13:23:46 +1200
committerGitHub <noreply@github.com>2020-04-27 13:23:46 +1200
commit570d84f7d3642b85f96906ceab6402678177949e (patch)
treee16c2693b8ec69bb95163fc389f4939ecc9150dc /caddytest/integration/sni_test.go
parenta6761153cbbf4547b9c0a76656d74f1401067205 (diff)
refactored caddytest helpers (#3285)
* refactored caddytest helpers * added cookie jar support. Added support for more http verbs
Diffstat (limited to 'caddytest/integration/sni_test.go')
-rw-r--r--caddytest/integration/sni_test.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/caddytest/integration/sni_test.go b/caddytest/integration/sni_test.go
index f26131e..46f7c83 100644
--- a/caddytest/integration/sni_test.go
+++ b/caddytest/integration/sni_test.go
@@ -9,7 +9,8 @@ import (
func TestDefaultSNI(t *testing.T) {
// arrange
- caddytest.InitServer(t, `{
+ tester := caddytest.NewTester(t)
+ tester.InitServer(`{
"apps": {
"http": {
"http_port": 9080,
@@ -98,13 +99,14 @@ func TestDefaultSNI(t *testing.T) {
// act and assert
// makes a request with no sni
- caddytest.AssertGetResponse(t, "https://127.0.0.1:9443/version", 200, "hello from a")
+ tester.AssertGetResponse("https://127.0.0.1:9443/version", 200, "hello from a")
}
func TestDefaultSNIWithNamedHostAndExplicitIP(t *testing.T) {
// arrange
- caddytest.InitServer(t, `
+ tester := caddytest.NewTester(t)
+ tester.InitServer(`
{
"apps": {
"http": {
@@ -198,13 +200,14 @@ func TestDefaultSNIWithNamedHostAndExplicitIP(t *testing.T) {
// act and assert
// makes a request with no sni
- caddytest.AssertGetResponse(t, "https://127.0.0.1:9443/version", 200, "hello from a")
+ tester.AssertGetResponse("https://127.0.0.1:9443/version", 200, "hello from a")
}
func TestDefaultSNIWithPortMappingOnly(t *testing.T) {
// arrange
- caddytest.InitServer(t, `
+ tester := caddytest.NewTester(t)
+ tester.InitServer(`
{
"apps": {
"http": {
@@ -270,7 +273,7 @@ func TestDefaultSNIWithPortMappingOnly(t *testing.T) {
// act and assert
// makes a request with no sni
- caddytest.AssertGetResponse(t, "https://127.0.0.1:9443/version", 200, "hello from a")
+ tester.AssertGetResponse("https://127.0.0.1:9443/version", 200, "hello from a")
}
func TestHttpOnlyOnDomainWithSNI(t *testing.T) {