Skip to content

Commit

Permalink
test(server): use ECDSA as testing algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
streambinder committed Oct 11, 2022
1 parent 56e0ec8 commit 3999016
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion server/crt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestServerCrt(t *testing.T) {
)

response, err := app.Test(
httptest.NewRequest("GET", "/"+testingCADomain, nil),
httptest.NewRequest("GET", "/"+testingCADomain+"?algo="+testingCAAlgorithm, nil),
)
test.NoErr(err)
test.Equal(response.StatusCode, fiber.StatusOK)
Expand Down
2 changes: 1 addition & 1 deletion server/enum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestServerEnum(t *testing.T) {
)

response, err := app.Test(
httptest.NewRequest("GET", "/"+testingCADomain, nil),
httptest.NewRequest("GET", "/"+testingCADomain+"?algo="+testingCAAlgorithm, nil),
)
test.NoErr(err)
test.Equal(response.StatusCode, fiber.StatusOK)
Expand Down
11 changes: 6 additions & 5 deletions server/inca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import (
)

const (
testingCADomain = "domain.tld"
testingConfigPath = ".testServerInca.yml"
testingCACrtPath = ".testServerInca.crt.pem"
testingCAKeyPath = ".testServerInca.key.pem"
testingConfig = `bind: :65535
testingCADomain = "domain.tld"
testingCAAlgorithm = "ecdsa"
testingConfigPath = ".testServerInca.yml"
testingCACrtPath = ".testServerInca.crt.pem"
testingCAKeyPath = ".testServerInca.key.pem"
testingConfig = `bind: :65535
templates_path: ./views
environment: production
storage:
Expand Down
2 changes: 1 addition & 1 deletion server/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestServerKey(t *testing.T) {
)

response, err := app.Test(
httptest.NewRequest("GET", "/"+testingCADomain, nil),
httptest.NewRequest("GET", "/"+testingCADomain+"?algo="+testingCAAlgorithm, nil),
)
test.NoErr(err)
test.Equal(response.StatusCode, fiber.StatusOK)
Expand Down
2 changes: 1 addition & 1 deletion server/revoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestServerRevoke(t *testing.T) {
)

response, err := app.Test(
httptest.NewRequest("GET", "/"+testingCADomain, nil),
httptest.NewRequest("GET", "/"+testingCADomain+"?algo="+testingCAAlgorithm, nil),
)
test.NoErr(err)
test.Equal(response.StatusCode, fiber.StatusOK)
Expand Down
2 changes: 1 addition & 1 deletion server/show_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestServerShow(t *testing.T) {
)

response, err := app.Test(
httptest.NewRequest("GET", "/"+testingCADomain, nil),
httptest.NewRequest("GET", "/"+testingCADomain+"?algo="+testingCAAlgorithm, nil),
)
test.NoErr(err)
test.Equal(response.StatusCode, fiber.StatusOK)
Expand Down
2 changes: 1 addition & 1 deletion server/web_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestServerWebDelete(t *testing.T) {
test.True(strings.Contains(string(body), "not found"))

response, err = app.Test(
httptest.NewRequest("GET", "/"+testingCADomain, nil),
httptest.NewRequest("GET", "/"+testingCADomain+"?algo="+testingCAAlgorithm, nil),
)
test.NoErr(err)
test.Equal(response.StatusCode, fiber.StatusOK)
Expand Down
1 change: 1 addition & 0 deletions server/web_issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func TestServerWebIssue(t *testing.T) {

form := url.Values{}
form.Add("alt", testDomain)
form.Add("algo", testingCAAlgorithm)
request := httptest.NewRequest("POST", "/web/issue", strings.NewReader(form.Encode()))
request.Header.Add("Content-Type", "application/x-www-form-urlencoded")
response, err := app.Test(request)
Expand Down
2 changes: 1 addition & 1 deletion server/web_view_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestServerWebView(t *testing.T) {
)

response, err := app.Test(
httptest.NewRequest("GET", "/"+testingCADomain, nil),
httptest.NewRequest("GET", "/"+testingCADomain+"?algo="+testingCAAlgorithm, nil),
)
test.NoErr(err)
test.Equal(response.StatusCode, fiber.StatusOK)
Expand Down

0 comments on commit 3999016

Please sign in to comment.