Browse code

integration-cli: TestInspectAPIMultipleNetworks: use current version

This test was added in f301c5765a0d7f4b6866cedfdface6f87874ff53 to test
inspect output for API > v1.21, however, it was pinned to API v1.21,
which is now deprecated.

Remove the fixed version, as the intent was to test "current" API versions
(API v1.21 and up),

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

Sebastiaan van Stijn authored on 2024/01/22 04:34:16
Showing 1 changed files
... ...
@@ -1022,15 +1022,16 @@ func (s *DockerCLINetworkSuite) TestInspectAPIMultipleNetworks(c *testing.T) {
1022 1022
 
1023 1023
 	versionedIP := inspect120.NetworkSettings.IPAddress
1024 1024
 
1025
-	body = getInspectBody(c, "v1.21", id)
1026
-	var inspect121 types.ContainerJSON
1027
-	err = json.Unmarshal(body, &inspect121)
1025
+	// Current API version (API v1.21 and up)
1026
+	body = getInspectBody(c, "", id)
1027
+	var inspectCurrent types.ContainerJSON
1028
+	err = json.Unmarshal(body, &inspectCurrent)
1028 1029
 	assert.NilError(c, err)
1029
-	assert.Equal(c, len(inspect121.NetworkSettings.Networks), 3)
1030
+	assert.Equal(c, len(inspectCurrent.NetworkSettings.Networks), 3)
1030 1031
 
1031
-	bridge := inspect121.NetworkSettings.Networks["bridge"]
1032
+	bridge := inspectCurrent.NetworkSettings.Networks["bridge"]
1032 1033
 	assert.Equal(c, bridge.IPAddress, versionedIP)
1033
-	assert.Equal(c, bridge.IPAddress, inspect121.NetworkSettings.IPAddress)
1034
+	assert.Equal(c, bridge.IPAddress, inspectCurrent.NetworkSettings.IPAddress)
1034 1035
 }
1035 1036
 
1036 1037
 func connectContainerToNetworks(c *testing.T, d *daemon.Daemon, cName string, nws []string) {