|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
package runtime |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"context" |
|
|
|
|
"reflect" |
|
|
|
|
"testing" |
|
|
|
|
"time" |
|
|
|
@ -56,7 +57,9 @@ func TestSingleRuntime_ShowCerts(t *testing.T) { |
|
|
|
|
t.Run(tt.name, func(t *testing.T) { |
|
|
|
|
haProxy.SetResponses(&tt.socketResponse) |
|
|
|
|
s := &SingleRuntime{} |
|
|
|
|
err := s.Init(tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Second)) |
|
|
|
|
defer cancel() |
|
|
|
|
err := s.Init(ctx, tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("SingleRuntime.Init() error = %v", err) |
|
|
|
|
return |
|
|
|
@ -145,7 +148,9 @@ func TestSingleRuntime_GetCert(t *testing.T) { |
|
|
|
|
t.Run(tt.name, func(t *testing.T) { |
|
|
|
|
haProxy.SetResponses(&tt.socketResponse) |
|
|
|
|
s := &SingleRuntime{} |
|
|
|
|
err := s.Init(tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Second)) |
|
|
|
|
defer cancel() |
|
|
|
|
err := s.Init(ctx, tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("SingleRuntime.Init() error = %v", err) |
|
|
|
|
return |
|
|
|
@ -229,7 +234,9 @@ func TestSingleRuntime_ShowCertEntry(t *testing.T) { |
|
|
|
|
t.Run(tt.name, func(t *testing.T) { |
|
|
|
|
haProxy.SetResponses(&tt.socketResponse) |
|
|
|
|
s := &SingleRuntime{} |
|
|
|
|
err := s.Init(tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Second)) |
|
|
|
|
defer cancel() |
|
|
|
|
err := s.Init(ctx, tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("SingleRuntime.Init() error = %v", err) |
|
|
|
|
return |
|
|
|
@ -305,7 +312,9 @@ func TestSingleRuntime_NewCertEntry(t *testing.T) { |
|
|
|
|
t.Run(tt.name, func(t *testing.T) { |
|
|
|
|
haProxy.SetResponses(&tt.socketResponse) |
|
|
|
|
s := &SingleRuntime{} |
|
|
|
|
err := s.Init(tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Second)) |
|
|
|
|
defer cancel() |
|
|
|
|
err := s.Init(ctx, tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("SingleRuntime.Init() error = %v", err) |
|
|
|
|
return |
|
|
|
@ -392,7 +401,9 @@ func TestSingleRuntime_SetCertEntry(t *testing.T) { |
|
|
|
|
t.Run(tt.name, func(t *testing.T) { |
|
|
|
|
haProxy.SetResponses(&tt.socketResponse) |
|
|
|
|
s := &SingleRuntime{} |
|
|
|
|
err := s.Init(tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Second)) |
|
|
|
|
defer cancel() |
|
|
|
|
err := s.Init(ctx, tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("SingleRuntime.Init() error = %v", err) |
|
|
|
|
return |
|
|
|
@ -465,7 +476,9 @@ func TestSingleRuntime_CommitCertEntry(t *testing.T) { |
|
|
|
|
t.Run(tt.name, func(t *testing.T) { |
|
|
|
|
haProxy.SetResponses(&tt.socketResponse) |
|
|
|
|
s := &SingleRuntime{} |
|
|
|
|
err := s.Init(tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Second)) |
|
|
|
|
defer cancel() |
|
|
|
|
err := s.Init(ctx, tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("SingleRuntime.Init() error = %v", err) |
|
|
|
|
return |
|
|
|
@ -536,7 +549,9 @@ func TestSingleRuntime_AbortCertEntry(t *testing.T) { |
|
|
|
|
t.Run(tt.name, func(t *testing.T) { |
|
|
|
|
haProxy.SetResponses(&tt.socketResponse) |
|
|
|
|
s := &SingleRuntime{} |
|
|
|
|
err := s.Init(tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Second)) |
|
|
|
|
defer cancel() |
|
|
|
|
err := s.Init(ctx, tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("SingleRuntime.Init() error = %v", err) |
|
|
|
|
return |
|
|
|
@ -607,7 +622,9 @@ func TestSingleRuntime_DeleteCertEntry(t *testing.T) { |
|
|
|
|
t.Run(tt.name, func(t *testing.T) { |
|
|
|
|
haProxy.SetResponses(&tt.socketResponse) |
|
|
|
|
s := &SingleRuntime{} |
|
|
|
|
err := s.Init(tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Second)) |
|
|
|
|
defer cancel() |
|
|
|
|
err := s.Init(ctx, tt.fields.socketPath, tt.fields.process, tt.fields.worker) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Errorf("SingleRuntime.Init() error = %v", err) |
|
|
|
|
return |
|
|
|
|