Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(e2e): extend TestNoErrorLogsDuringNormalOperations with different TLS configs #18819

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 46 additions & 11 deletions tests/e2e/logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,55 @@ import (
func TestNoErrorLogsDuringNormalOperations(t *testing.T) {
tests := []struct {
name string
clusterSize int
options []e2e.EPClusterOption
allowedErrors map[string]bool
}{
{
name: "single node cluster",
clusterSize: 1,
name: "single node cluster",
options: []e2e.EPClusterOption{
e2e.WithClusterSize(1),
e2e.WithLogLevel("debug"),
},
allowedErrors: map[string]bool{"setting up serving from embedded etcd failed.": true},
},
{
name: "three node cluster",
options: []e2e.EPClusterOption{
e2e.WithClusterSize(3),
e2e.WithLogLevel("debug"),
},
allowedErrors: map[string]bool{"setting up serving from embedded etcd failed.": true},
},
{
name: "three node cluster",
clusterSize: 3,
name: "three node cluster with auto tls (all)",
options: []e2e.EPClusterOption{
e2e.WithClusterSize(3),
e2e.WithLogLevel("debug"),
e2e.WithIsPeerTLS(true),
e2e.WithIsPeerAutoTLS(true),
e2e.WithClientAutoTLS(true),
e2e.WithClientConnType(e2e.ClientTLS),
},
allowedErrors: map[string]bool{"setting up serving from embedded etcd failed.": true},
},
{
name: "three node cluster with auto tls (peers)",
options: []e2e.EPClusterOption{
e2e.WithClusterSize(3),
e2e.WithLogLevel("debug"),
e2e.WithIsPeerTLS(true),
e2e.WithIsPeerAutoTLS(true),
},
allowedErrors: map[string]bool{"setting up serving from embedded etcd failed.": true},
},
{
name: "three node cluster with auto tls (client)",
options: []e2e.EPClusterOption{
e2e.WithClusterSize(3),
e2e.WithLogLevel("debug"),
e2e.WithClientAutoTLS(true),
e2e.WithClientConnType(e2e.ClientTLS),
},
allowedErrors: map[string]bool{"setting up serving from embedded etcd failed.": true},
},
}
Expand All @@ -48,18 +86,15 @@ func TestNoErrorLogsDuringNormalOperations(t *testing.T) {
e2e.BeforeTest(t)
ctx := context.TODO()

epc, err := e2e.NewEtcdProcessCluster(ctx, t,
e2e.WithClusterSize(tc.clusterSize),
e2e.WithLogLevel("debug"),
)
epc, err := e2e.NewEtcdProcessCluster(ctx, t, tc.options...)
require.NoError(t, err)
defer epc.Close()

require.Lenf(t, epc.Procs, tc.clusterSize, "embedded etcd cluster process count is not as expected")
require.Lenf(t, epc.Procs, epc.Cfg.ClusterSize, "embedded etcd cluster process count is not as expected")

// Collect the handle of logs before closing the processes.
var logHandles []e2e.LogsExpect
for i := range tc.clusterSize {
for i := range epc.Cfg.ClusterSize {
logHandles = append(logHandles, epc.Procs[i].Logs())
}

Expand Down