integration-cli: TestInspectAPIMultipleNetworks: use current version

This test was added in f301c5765a 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>
(cherry picked from commit a0466ca8e1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2024-01-21 20:34:16 +01:00
parent 05267e9e8c
commit cdf3611cff
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -1022,15 +1022,16 @@ func (s *DockerCLINetworkSuite) TestInspectAPIMultipleNetworks(c *testing.T) {
versionedIP := inspect120.NetworkSettings.IPAddress
body = getInspectBody(c, "v1.21", id)
var inspect121 types.ContainerJSON
err = json.Unmarshal(body, &inspect121)
// Current API version (API v1.21 and up)
body = getInspectBody(c, "", id)
var inspectCurrent types.ContainerJSON
err = json.Unmarshal(body, &inspectCurrent)
assert.NilError(c, err)
assert.Equal(c, len(inspect121.NetworkSettings.Networks), 3)
assert.Equal(c, len(inspectCurrent.NetworkSettings.Networks), 3)
bridge := inspect121.NetworkSettings.Networks["bridge"]
bridge := inspectCurrent.NetworkSettings.Networks["bridge"]
assert.Equal(c, bridge.IPAddress, versionedIP)
assert.Equal(c, bridge.IPAddress, inspect121.NetworkSettings.IPAddress)
assert.Equal(c, bridge.IPAddress, inspectCurrent.NetworkSettings.IPAddress)
}
func connectContainerToNetworks(c *testing.T, d *daemon.Daemon, cName string, nws []string) {