(t *testing.T)
| 336 | } |
| 337 | |
| 338 | func TestMinSupportedVersion(t *testing.T) { |
| 339 | testutil.BeforeTest(t) |
| 340 | tests := []struct { |
| 341 | name string |
| 342 | currentVersion semver.Version |
| 343 | minSupportedVersion semver.Version |
| 344 | }{ |
| 345 | { |
| 346 | name: "v3.6 client should accept v3.5", |
| 347 | currentVersion: version.V3_6, |
| 348 | minSupportedVersion: version.V3_5, |
| 349 | }, |
| 350 | { |
| 351 | name: "v3.7 client should accept v3.6", |
| 352 | currentVersion: version.V3_7, |
| 353 | minSupportedVersion: version.V3_6, |
| 354 | }, |
| 355 | { |
| 356 | name: "first minor version should accept its previous version", |
| 357 | currentVersion: version.V4_0, |
| 358 | minSupportedVersion: version.V3_7, |
| 359 | }, |
| 360 | { |
| 361 | name: "first version in list should not accept previous versions", |
| 362 | currentVersion: version.V3_0, |
| 363 | minSupportedVersion: version.V3_0, |
| 364 | }, |
| 365 | } |
| 366 | |
| 367 | versionBackup := version.Version |
| 368 | t.Cleanup(func() { |
| 369 | version.Version = versionBackup |
| 370 | }) |
| 371 | for _, tt := range tests { |
| 372 | t.Run(tt.name, func(t *testing.T) { |
| 373 | version.Version = tt.currentVersion.String() |
| 374 | require.True(t, minSupportedVersion().Equal(tt.minSupportedVersion)) |
| 375 | }) |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | func TestClientRejectOldCluster(t *testing.T) { |
| 380 | testutil.BeforeTest(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…