1
0
mirror of https://github.com/moby/moby.git synced 2025-11-22 19:42:45 +03:00

TestDockerNetworkValidateIP: relax string-matching errors

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-11-10 12:03:58 +01:00
parent 82a5eec1aa
commit 9b7452e903

View File

@@ -1739,9 +1739,9 @@ func (s *DockerNetworkSuite) TestDockerNetworkValidateIP(c *testing.T) {
verifyIPAddresses(c, "mynet0", "mynet", "172.28.99.88", "2001:db8:1234::9988")
_, _, err = dockerCmdWithError("run", "--net=mynet", "--ip", "mynet_ip", "--ip6", "2001:db8:1234::9999", "busybox", "top")
assert.ErrorContains(c, err, "unable to parse IP")
assert.ErrorContains(c, err, "parse IP") // failed to / unable to parse IP
_, _, err = dockerCmdWithError("run", "--net=mynet", "--ip", "172.28.99.99", "--ip6", "mynet_ip6", "busybox", "top")
assert.ErrorContains(c, err, "unable to parse IP")
assert.ErrorContains(c, err, "parse IP") // failed to / unable to parse IP
// This is a case of IPv4 address to `--ip6`
_, _, err = dockerCmdWithError("run", "--net=mynet", "--ip6", "172.28.99.99", "busybox", "top")