Skip to content

Commit

Permalink
fix server log messages and rearrange ut
Browse files Browse the repository at this point in the history
  • Loading branch information
fairclothjm committed Apr 29, 2022
1 parent d303b8f commit afb1659
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,13 @@ func Serve(opts *ServeConfig) {

certPEM, keyPEM, err := generateCert()
if err != nil {
logger.Error("failed to generate client certificate", "error", err)
logger.Error("failed to generate server certificate", "error", err)
panic(err)
}

cert, err := tls.X509KeyPair(certPEM, keyPEM)
if err != nil {
logger.Error("failed to parse client certificate", "error", err)
logger.Error("failed to parse server certificate", "error", err)
panic(err)
}

Expand Down
10 changes: 5 additions & 5 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ func TestServer_testMode_AutoMTLS(t *testing.T) {
t.Fatalf("err: %s", err)
}

// Pinging should work
if err := client.Ping(); err != nil {
t.Fatalf("should not err: %s", err)
}

// Grab the impl
raw, err := client.Dispense("test")
if err != nil {
Expand All @@ -140,11 +145,6 @@ func TestServer_testMode_AutoMTLS(t *testing.T) {
t.Fatal("invalid response", err)
}

// Pinging should work
if err := client.Ping(); err != nil {
t.Fatalf("should not err: %s", err)
}

c.Kill()
// Canceling should cause an exit
cancel()
Expand Down

0 comments on commit afb1659

Please sign in to comment.