1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #41989 from alexisries/docker-dind-integration-test-fix-subnet-missmatch

Update TestDaemonRestartWithLiveRestore: fix docker0 subnet missmatch
This commit is contained in:
Brian Goff 2021-02-17 10:35:50 -08:00 committed by GitHub
commit 546c33cede
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,19 +33,25 @@ func TestDaemonRestartWithLiveRestore(t *testing.T) {
d := daemon.New(t) d := daemon.New(t)
defer d.Stop(t) defer d.Stop(t)
d.Start(t) d.Start(t)
c := d.NewClientT(t)
defer c.Close()
// Verify bridge network's subnet
out, err := c.NetworkInspect(context.Background(), "bridge", types.NetworkInspectOptions{})
assert.NilError(t, err)
subnet := out.IPAM.Config[0].Subnet
d.Restart(t, d.Restart(t,
"--live-restore=true", "--live-restore=true",
"--default-address-pool", "base=175.30.0.0/16,size=16", "--default-address-pool", "base=175.30.0.0/16,size=16",
"--default-address-pool", "base=175.33.0.0/16,size=24", "--default-address-pool", "base=175.33.0.0/16,size=24",
) )
// Verify bridge network's subnet out1, err := c.NetworkInspect(context.Background(), "bridge", types.NetworkInspectOptions{})
c := d.NewClientT(t)
defer c.Close()
out, err := c.NetworkInspect(context.Background(), "bridge", types.NetworkInspectOptions{})
assert.NilError(t, err) assert.NilError(t, err)
// Make sure docker0 doesn't get override with new IP in live restore case // Make sure docker0 doesn't get override with new IP in live restore case
assert.Equal(t, out.IPAM.Config[0].Subnet, "172.18.0.0/16") assert.Equal(t, out1.IPAM.Config[0].Subnet, subnet)
} }
func TestDaemonDefaultNetworkPools(t *testing.T) { func TestDaemonDefaultNetworkPools(t *testing.T) {