| 1 | package e2escip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/ |
| 2 | |
| 3 | import ( |
| 4 | "contextscip-go gomod github.com/golang/go/src go1.18 context/" |
| 5 | "fmtscip-go gomod github.com/golang/go/src go1.18 fmt/" |
| 6 | "osscip-go gomod github.com/golang/go/src go1.18 os/" |
| 7 | "stringsscip-go gomod github.com/golang/go/src go1.18 strings/" |
| 8 | "testingscip-go gomod github.com/golang/go/src go1.18 testing/" |
| 9 | "timescip-go gomod github.com/golang/go/src go1.18 time/" |
| 10 | |
| 11 | logs2scip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/internal/maintnotifications/logs`/ "github.com/redis/go-redis/v9/internal/maintnotifications/logsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/internal/maintnotifications/logs`/" |
| 12 | "github.com/redis/go-redis/v9/loggingscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/logging`/" |
| 13 | "github.com/redis/go-redis/v9/maintnotificationsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/" |
| 14 | ) |
| 15 | |
| 16 | // TODO ADD TLS CONFIGS |
| 17 | // TestTLSConfigurationsPushNotifications tests push notifications with different TLS configurations |
| 18 | func ТestTLSConfigurationsPushNotificationsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/`ТestTLSConfigurationsPushNotifications`().(t *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#) { |
| 19 | if osscip-go gomod github.com/golang/go/src go1.18 os/.Getenvscip-go gomod github.com/golang/go/src go1.18 os/Getenv().("E2E_SCENARIO_TESTS") != "true" { |
| 20 | t.Skipscip-go gomod github.com/golang/go/src go1.18 testing/common#Skip().("Scenario tests require E2E_SCENARIO_TESTS=true") |
| 21 | } |
| 22 | |
| 23 | ctx, cancel := contextscip-go gomod github.com/golang/go/src go1.18 context/.WithTimeoutscip-go gomod github.com/golang/go/src go1.18 context/WithTimeout().(contextscip-go gomod github.com/golang/go/src go1.18 context/.Backgroundscip-go gomod github.com/golang/go/src go1.18 context/Background().(), defaultTestTimeoutscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/defaultTestTimeout.) |
| 24 | defer cancel() |
| 25 | |
| 26 | var dump = true |
| 27 | var errorsDetected = false |
| 28 | var p = func(format string, args ...interface{}) { |
| 29 | printLogscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/printLog().("TLS-CONFIGS", false, format, args...) |
| 30 | } |
| 31 | |
| 32 | var e = func(format string, args ...interface{}) { |
| 33 | errorsDetected = true |
| 34 | printLogscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/printLog().("TLS-CONFIGS", true, format, args...) |
| 35 | } |
| 36 | |
| 37 | // Test different TLS configurations |
| 38 | // Note: TLS configuration is typically handled at the Redis connection config level |
| 39 | // This scenario demonstrates the testing pattern for different TLS setups |
| 40 | tlsConfigs := []struct { |
| 41 | name string |
| 42 | description string |
| 43 | skipReason string |
| 44 | }{ |
| 45 | { |
| 46 | name: "NoTLS", |
| 47 | description: "No TLS encryption (plain text)", |
| 48 | }, |
| 49 | { |
| 50 | name: "TLSInsecure", |
| 51 | description: "TLS with insecure skip verify (testing only)", |
| 52 | }, |
| 53 | { |
| 54 | name: "TLSSecure", |
| 55 | description: "Secure TLS with certificate verification", |
| 56 | skipReason: "Requires valid certificates in test environment", |
| 57 | }, |
| 58 | { |
| 59 | name: "TLSMinimal", |
| 60 | description: "TLS with minimal version requirements", |
| 61 | }, |
| 62 | { |
| 63 | name: "TLSStrict", |
| 64 | description: "Strict TLS with TLS 1.3 and specific cipher suites", |
| 65 | }, |
| 66 | } |
| 67 | |
| 68 | logCollectorscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/logCollector..ClearLogsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/TestLogCollector#ClearLogs().() |
| 69 | defer func() { |
| 70 | logCollectorscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/logCollector..Clearscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/TestLogCollector#Clear().() |
| 71 | }() |
| 72 | |
| 73 | // Test each TLS configuration with its own fresh database |
| 74 | for _, tlsTest := range tlsConfigs { |
| 75 | t.Runscip-go gomod github.com/golang/go/src go1.18 testing/T#Run().(tlsTest.name, func(t *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#) { |
| 76 | // Setup: Create fresh database and client factory for THIS TLS config test |
| 77 | bdbID, factory, cleanup := SetupTestDatabaseAndFactoryscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/SetupTestDatabaseAndFactory().(t, ctx, "standalone") |
| 78 | defer cleanup() |
| 79 | t.Logfscip-go gomod github.com/golang/go/src go1.18 testing/common#Logf().("[TLS-CONFIGS-%s] Created test database with bdb_id: %d", tlsTest.name, bdbID) |
| 80 | |
| 81 | // Get endpoint config from factory (now connected to new database) |
| 82 | endpointConfig := factory.GetConfigscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/ClientFactory#GetConfig().() |
| 83 | |
| 84 | // Create fault injector |
| 85 | faultInjector, err := CreateTestFaultInjectorscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CreateTestFaultInjector().() |
| 86 | if err != nil { |
| 87 | t.Fatalfscip-go gomod github.com/golang/go/src go1.18 testing/common#Fatalf().("[ERROR] Failed to create fault injector: %v", err) |
| 88 | } |
| 89 | |
| 90 | defer func() { |
| 91 | if dump { |
| 92 | p("Pool stats:") |
| 93 | factory.PrintPoolStatsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/ClientFactory#PrintPoolStats().(t) |
| 94 | } |
| 95 | }() |
| 96 | |
| 97 | errorsDetected = false |
| 98 | var ef = func(format string, args ...interface{}) { |
| 99 | printLogscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/printLog().("TLS-CONFIGS", true, format, args...) |
| 100 | t.FailNowscip-go gomod github.com/golang/go/src go1.18 testing/common#FailNow().() |
| 101 | } |
| 102 | |
| 103 | if tlsTest.skipReason != "" { |
| 104 | t.Skipfscip-go gomod github.com/golang/go/src go1.18 testing/common#Skipf().("Skipping %s: %s", tlsTest.name, tlsTest.skipReason) |
| 105 | } |
| 106 | |
| 107 | p("Testing TLS configuration: %s - %s", tlsTest.name, tlsTest.description) |
| 108 | |
| 109 | minIdleConns := 3 |
| 110 | poolSize := 8 |
| 111 | maxConnections := 12 |
| 112 | |
| 113 | // Create Redis client with specific TLS configuration |
| 114 | // Note: TLS configuration is handled at the factory/connection level |
| 115 | client, err := factory.Createscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/ClientFactory#Create().(fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.18 fmt/Sprintf().("tls-test-%s", tlsTest.name), &CreateClientOptionsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CreateClientOptions#{ |
| 116 | Protocolscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CreateClientOptions#Protocol.: 3, // RESP3 required for push notifications |
| 117 | PoolSizescip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CreateClientOptions#PoolSize.: poolSize, |
| 118 | MinIdleConnsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CreateClientOptions#MinIdleConns.: minIdleConns, |
| 119 | MaxActiveConnsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CreateClientOptions#MaxActiveConns.: maxConnections, |
| 120 | MaintNotificationsConfigscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CreateClientOptions#MaintNotificationsConfig.: &maintnotificationsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/.Configscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/Config#{ |
| 121 | Modescip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/Config#Mode.: maintnotificationsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/.ModeEnabledscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/ModeEnabled., |
| 122 | HandoffTimeoutscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/Config#HandoffTimeout.: 30 * timescip-go gomod github.com/golang/go/src go1.18 time/.Secondscip-go gomod github.com/golang/go/src go1.18 time/Second., |
| 123 | RelaxedTimeoutscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/Config#RelaxedTimeout.: 10 * timescip-go gomod github.com/golang/go/src go1.18 time/.Secondscip-go gomod github.com/golang/go/src go1.18 time/Second., |
| 124 | PostHandoffRelaxedDurationscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/Config#PostHandoffRelaxedDuration.: 2 * timescip-go gomod github.com/golang/go/src go1.18 time/.Secondscip-go gomod github.com/golang/go/src go1.18 time/Second., |
| 125 | MaxWorkersscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/Config#MaxWorkers.: 15, |
| 126 | EndpointTypescip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/Config#EndpointType.: maintnotificationsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/.EndpointTypeExternalIPscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/EndpointTypeExternalIP., |
| 127 | }, |
| 128 | ClientNamescip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CreateClientOptions#ClientName.: fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.18 fmt/Sprintf().("tls-test-%s", tlsTest.name), |
| 129 | }) |
| 130 | if err != nil { |
| 131 | // Some TLS configurations might fail in test environments |
| 132 | if tlsTest.name == "TLSSecure" || tlsTest.name == "TLSStrict" { |
| 133 | t.Skipfscip-go gomod github.com/golang/go/src go1.18 testing/common#Skipf().("TLS configuration %s failed (expected in test environment): %v", tlsTest.name, err) |
| 134 | } |
| 135 | ef("Failed to create client for %s: %v", tlsTest.name, err) |
| 136 | } |
| 137 | |
| 138 | // Create timeout tracker |
| 139 | tracker := NewTrackingNotificationsHookscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/NewTrackingNotificationsHook().() |
| 140 | logger := maintnotificationsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/.NewLoggingHookscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications`/NewLoggingHook().(int(loggingscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/logging`/.LogLevelDebugscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/logging`/LogLevelDebug.)) |
| 141 | setupNotificationHooksscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/setupNotificationHooks().(client, tracker, logger) |
| 142 | defer func() { |
| 143 | tracker.Clearscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/TrackingNotificationsHook#Clear().() |
| 144 | }() |
| 145 | |
| 146 | // Verify initial connectivity |
| 147 | err = client.Pingscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9`/Cmdable#Ping.(ctx).Errscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9`/baseCmd#Err().() |
| 148 | if err != nil { |
| 149 | if tlsTest.name == "TLSSecure" || tlsTest.name == "TLSStrict" { |
| 150 | t.Skipfscip-go gomod github.com/golang/go/src go1.18 testing/common#Skipf().("TLS configuration %s ping failed (expected in test environment): %v", tlsTest.name, err) |
| 151 | } |
| 152 | ef("Failed to ping Redis with %s TLS config: %v", tlsTest.name, err) |
| 153 | } |
| 154 | |
| 155 | p("Client connected successfully with %s TLS configuration", tlsTest.name) |
| 156 | |
| 157 | commandsRunner, _ := NewCommandRunnerscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/NewCommandRunner().(client) |
| 158 | defer func() { |
| 159 | if dump { |
| 160 | stats := commandsRunner.GetStatsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunner#GetStats().() |
| 161 | p("%s TLS config stats: Operations: %d, Errors: %d, Timeout Errors: %d", |
| 162 | tlsTest.name, stats.Operationsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunnerStats#Operations., stats.Errorsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunnerStats#Errors., stats.TimeoutErrorsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunnerStats#TimeoutErrors.) |
| 163 | } |
| 164 | commandsRunner.Stopscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunner#Stop().() |
| 165 | }() |
| 166 | |
| 167 | // Start command traffic |
| 168 | go func() { |
| 169 | commandsRunner.FireCommandsUntilStopscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunner#FireCommandsUntilStop().(ctx) |
| 170 | }() |
| 171 | |
| 172 | // Test migration with this TLS configuration |
| 173 | p("Testing migration with %s TLS configuration...", tlsTest.name) |
| 174 | migrateResp, err := faultInjector.TriggerActionscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/FaultInjectorClient#TriggerAction().(ctx, ActionRequestscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/ActionRequest#{ |
| 175 | Typescip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/ActionRequest#Type.: "migrate", |
| 176 | Parametersscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/ActionRequest#Parameters.: map[string]interface{}{ |
| 177 | "bdb_id": endpointConfig.BdbIDscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/RedisConnectionConfig#BdbID., |
| 178 | }, |
| 179 | }) |
| 180 | if err != nil { |
| 181 | ef("Failed to trigger migrate action for %s: %v", tlsTest.name, err) |
| 182 | } |
| 183 | |
| 184 | // Wait for MIGRATING notification |
| 185 | match, found := logCollectorscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/logCollector..MatchOrWaitForLogMatchFuncscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/TestLogCollector#MatchOrWaitForLogMatchFunc().(func(s string) bool { |
| 186 | return stringsscip-go gomod github.com/golang/go/src go1.18 strings/.Containsscip-go gomod github.com/golang/go/src go1.18 strings/Contains().(s, logs2scip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/internal/maintnotifications/logs`/.ProcessingNotificationMessagescip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/internal/maintnotifications/logs`/ProcessingNotificationMessage.) && stringsscip-go gomod github.com/golang/go/src go1.18 strings/.Containsscip-go gomod github.com/golang/go/src go1.18 strings/Contains().(s, "MIGRATING") |
| 187 | }, 60*timescip-go gomod github.com/golang/go/src go1.18 time/.Secondscip-go gomod github.com/golang/go/src go1.18 time/Second.) |
| 188 | if !found { |
| 189 | ef("MIGRATING notification was not received for %s TLS config", tlsTest.name) |
| 190 | } |
| 191 | migrateData := logs2scip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/internal/maintnotifications/logs`/.ExtractDataFromLogMessagescip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/internal/maintnotifications/logs`/ExtractDataFromLogMessage().(match) |
| 192 | p("MIGRATING notification received for %s: %v", tlsTest.name, migrateData) |
| 193 | |
| 194 | // Wait for migration to complete |
| 195 | status, err := faultInjector.WaitForActionscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/FaultInjectorClient#WaitForAction().(ctx, migrateResp.ActionIDscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/ActionResponse#ActionID., |
| 196 | WithMaxWaitTimescip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/WithMaxWaitTime().(240*timescip-go gomod github.com/golang/go/src go1.18 time/.Secondscip-go gomod github.com/golang/go/src go1.18 time/Second.), |
| 197 | WithPollIntervalscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/WithPollInterval().(2*timescip-go gomod github.com/golang/go/src go1.18 time/.Secondscip-go gomod github.com/golang/go/src go1.18 time/Second.), |
| 198 | ) |
| 199 | if err != nil { |
| 200 | ef("[FI] Migrate action failed for %s: %v", tlsTest.name, err) |
| 201 | } |
| 202 | p("[FI] Migrate action completed for %s: %s %s", tlsTest.name, status.Statusscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/ActionStatusResponse#Status., actionOutputIfFailedscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/actionOutputIfFailed().(status)) |
| 203 | |
| 204 | // Continue traffic for a bit to observe TLS behavior |
| 205 | timescip-go gomod github.com/golang/go/src go1.18 time/.Sleepscip-go gomod github.com/golang/go/src go1.18 time/Sleep().(5 * timescip-go gomod github.com/golang/go/src go1.18 time/.Secondscip-go gomod github.com/golang/go/src go1.18 time/Second.) |
| 206 | commandsRunner.Stopscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunner#Stop().() |
| 207 | |
| 208 | // Analyze results for this TLS configuration |
| 209 | trackerAnalysis := tracker.GetAnalysisscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/TrackingNotificationsHook#GetAnalysis().() |
| 210 | if trackerAnalysis.NotificationProcessingErrorsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/DiagnosticsAnalysis#NotificationProcessingErrors. > 0 { |
| 211 | e("Notification processing errors with %s TLS config: %d", tlsTest.name, trackerAnalysis.NotificationProcessingErrorsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/DiagnosticsAnalysis#NotificationProcessingErrors.) |
| 212 | } |
| 213 | |
| 214 | if trackerAnalysis.UnexpectedNotificationCountscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/DiagnosticsAnalysis#UnexpectedNotificationCount. > 0 { |
| 215 | e("Unexpected notifications with %s TLS config: %d", tlsTest.name, trackerAnalysis.UnexpectedNotificationCountscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/DiagnosticsAnalysis#UnexpectedNotificationCount.) |
| 216 | } |
| 217 | |
| 218 | // Validate we received expected notifications |
| 219 | if trackerAnalysis.FailingOverCountscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/DiagnosticsAnalysis#FailingOverCount. == 0 { |
| 220 | e("Expected FAILING_OVER notifications with %s TLS config, got none", tlsTest.name) |
| 221 | } |
| 222 | if trackerAnalysis.FailedOverCountscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/DiagnosticsAnalysis#FailedOverCount. == 0 { |
| 223 | e("Expected FAILED_OVER notifications with %s TLS config, got none", tlsTest.name) |
| 224 | } |
| 225 | if trackerAnalysis.MigratingCountscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/DiagnosticsAnalysis#MigratingCount. == 0 { |
| 226 | e("Expected MIGRATING notifications with %s TLS config, got none", tlsTest.name) |
| 227 | } |
| 228 | |
| 229 | if errorsDetected { |
| 230 | logCollectorscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/logCollector..DumpLogsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/TestLogCollector#DumpLogs().() |
| 231 | trackerAnalysis.Printscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/DiagnosticsAnalysis#Print().(t) |
| 232 | logCollectorscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/logCollector..Clearscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/TestLogCollector#Clear().() |
| 233 | tracker.Clearscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/TrackingNotificationsHook#Clear().() |
| 234 | ef("[FAIL] Errors detected with %s TLS config", tlsTest.name) |
| 235 | } |
| 236 | // TLS-specific validations |
| 237 | stats := commandsRunner.GetStatsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunner#GetStats().() |
| 238 | switch tlsTest.name { |
| 239 | case "NoTLS": |
| 240 | // Plain text should work fine |
| 241 | p("Plain text connection processed %d operations", stats.Operationsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunnerStats#Operations.) |
| 242 | case "TLSInsecure", "TLSMinimal": |
| 243 | // Insecure TLS should work in test environments |
| 244 | p("Insecure TLS connection processed %d operations", stats.Operationsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunnerStats#Operations.) |
| 245 | if stats.Operationsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunnerStats#Operations. == 0 { |
| 246 | e("Expected operations with %s TLS config, got none", tlsTest.name) |
| 247 | } |
| 248 | case "TLSStrict": |
| 249 | // Strict TLS might have different performance characteristics |
| 250 | p("Strict TLS connection processed %d operations", stats.Operationsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/CommandRunnerStats#Operations.) |
| 251 | } |
| 252 | |
| 253 | p("TLS configuration %s test completed successfully", tlsTest.name) |
| 254 | }) |
| 255 | |
| 256 | // Clear logs between TLS configuration tests |
| 257 | logCollectorscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/logCollector..ClearLogsscip-go gomod github.com/redis/go-redis/v9 . `github.com/redis/go-redis/v9/maintnotifications/e2e`/TestLogCollector#ClearLogs().() |
| 258 | } |
| 259 | |
| 260 | p("All TLS configurations tested successfully") |
| 261 | } |