Browse code

client: update some tests using obsolete API versions

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2025/10/07 17:38:47
Showing 1 changed files
... ...
@@ -253,11 +253,11 @@ func TestNegotiateAPIVersionEmpty(t *testing.T) {
253 253
 	assert.NilError(t, err)
254 254
 
255 255
 	// set our version to something new
256
-	client.version = "1.25"
256
+	client.version = "1.51"
257 257
 
258 258
 	// if no version from server, expect the earliest
259 259
 	// version before APIVersion was implemented
260
-	const expected = "1.24"
260
+	const expected = fallbackAPIVersion
261 261
 
262 262
 	// test downgrade
263 263
 	client.NegotiateAPIVersionPing(types.Ping{})
... ...
@@ -276,16 +276,16 @@ func TestNegotiateAPIVersion(t *testing.T) {
276 276
 		{
277 277
 			// client should downgrade to the version reported by the daemon.
278 278
 			doc:             "downgrade from default",
279
-			pingVersion:     "1.21",
280
-			expectedVersion: "1.21",
279
+			pingVersion:     "1.50",
280
+			expectedVersion: "1.50",
281 281
 		},
282 282
 		{
283 283
 			// client should not downgrade to the version reported by the
284 284
 			// daemon if a custom version was set.
285 285
 			doc:             "no downgrade from custom version",
286
-			clientVersion:   "1.25",
287
-			pingVersion:     "1.21",
288
-			expectedVersion: "1.25",
286
+			clientVersion:   "1.51",
287
+			pingVersion:     "1.50",
288
+			expectedVersion: "1.51",
289 289
 		},
290 290
 		{
291 291
 			// client should downgrade to the last version before version
... ...
@@ -293,7 +293,7 @@ func TestNegotiateAPIVersion(t *testing.T) {
293 293
 			// a version.
294 294
 			doc:             "downgrade legacy",
295 295
 			pingVersion:     "",
296
-			expectedVersion: "1.24",
296
+			expectedVersion: fallbackAPIVersion,
297 297
 		},
298 298
 		{
299 299
 			// client should downgrade to the version reported by the daemon.
... ...
@@ -308,9 +308,9 @@ func TestNegotiateAPIVersion(t *testing.T) {
308 308
 			// client should not upgrade to a newer version if a version was set,
309 309
 			// even if both the daemon and the client support it.
310 310
 			doc:             "no upgrade",
311
-			clientVersion:   "1.20",
312
-			pingVersion:     "1.21",
313
-			expectedVersion: "1.20",
311
+			clientVersion:   "1.50",
312
+			pingVersion:     "1.51",
313
+			expectedVersion: "1.50",
314 314
 		},
315 315
 	}
316 316
 
... ...
@@ -380,14 +380,14 @@ func TestNegotiateAPIVersionAutomatic(t *testing.T) {
380 380
 	assert.Check(t, is.Equal(client.ClientVersion(), expected))
381 381
 
382 382
 	// First request should trigger negotiation
383
-	pingVersion = "1.35"
384
-	expected = "1.35"
383
+	pingVersion = "1.50"
384
+	expected = "1.50"
385 385
 	_, _ = client.Info(ctx)
386 386
 	assert.Check(t, is.Equal(client.ClientVersion(), expected))
387 387
 
388 388
 	// Once successfully negotiated, subsequent requests should not re-negotiate
389
-	pingVersion = "1.25"
390
-	expected = "1.35"
389
+	pingVersion = "1.49"
390
+	expected = "1.50"
391 391
 	_, _ = client.Info(ctx)
392 392
 	assert.Check(t, is.Equal(client.ClientVersion(), expected))
393 393
 }