@@ -35,7 +35,6 @@ import (
3535 testdaemon "github.com/docker/docker/internal/test/daemon"
3636 "github.com/docker/docker/opts"
3737 "github.com/docker/docker/pkg/mount"
38- "github.com/docker/docker/pkg/stringid"
3938 units "github.com/docker/go-units"
4039 "github.com/docker/libnetwork/iptables"
4140 "github.com/docker/libtrust"
@@ -2672,84 +2671,6 @@ func (s *DockerDaemonSuite) TestDaemonRestartSaveContainerExitCode(c *check.C) {
26722671 c .Assert (out , checker .Equals , errMsg1 )
26732672}
26742673
2675- func (s * DockerDaemonSuite ) TestDaemonBackcompatPre17Volumes (c * check.C ) {
2676- testRequires (c , SameHostDaemon )
2677- d := s .d
2678- d .StartWithBusybox (c )
2679-
2680- // hack to be able to side-load a container config
2681- out , err := d .Cmd ("create" , "busybox:latest" )
2682- c .Assert (err , checker .IsNil , check .Commentf (out ))
2683- id := strings .TrimSpace (out )
2684-
2685- out , err = d .Cmd ("inspect" , "--type=image" , "--format={{.ID}}" , "busybox:latest" )
2686- c .Assert (err , checker .IsNil , check .Commentf (out ))
2687- d .Stop (c )
2688- <- d .Wait
2689-
2690- imageID := strings .TrimSpace (out )
2691- volumeID := stringid .GenerateNonCryptoID ()
2692- vfsPath := filepath .Join (d .Root , "vfs" , "dir" , volumeID )
2693- c .Assert (os .MkdirAll (vfsPath , 0755 ), checker .IsNil )
2694-
2695- config := []byte (`
2696- {
2697- "ID": "` + id + `",
2698- "Name": "hello",
2699- "Driver": "` + d .StorageDriver () + `",
2700- "Image": "` + imageID + `",
2701- "Config": {"Image": "busybox:latest"},
2702- "NetworkSettings": {},
2703- "Volumes": {
2704- "/bar":"/foo",
2705- "/foo": "` + vfsPath + `",
2706- "/quux":"/quux"
2707- },
2708- "VolumesRW": {
2709- "/bar": true,
2710- "/foo": true,
2711- "/quux": false
2712- }
2713- }
2714- ` )
2715-
2716- configPath := filepath .Join (d .Root , "containers" , id , "config.v2.json" )
2717- c .Assert (ioutil .WriteFile (configPath , config , 600 ), checker .IsNil )
2718- d .Start (c )
2719-
2720- out , err = d .Cmd ("inspect" , "--type=container" , "--format={{ json .Mounts }}" , id )
2721- c .Assert (err , checker .IsNil , check .Commentf (out ))
2722- type mount struct {
2723- Name string
2724- Source string
2725- Destination string
2726- Driver string
2727- RW bool
2728- }
2729-
2730- ls := []mount {}
2731- err = json .NewDecoder (strings .NewReader (out )).Decode (& ls )
2732- c .Assert (err , checker .IsNil )
2733-
2734- expected := []mount {
2735- {Source : "/foo" , Destination : "/bar" , RW : true },
2736- {Name : volumeID , Destination : "/foo" , RW : true },
2737- {Source : "/quux" , Destination : "/quux" , RW : false },
2738- }
2739- c .Assert (ls , checker .HasLen , len (expected ))
2740-
2741- for _ , m := range ls {
2742- var matched bool
2743- for _ , x := range expected {
2744- if m .Source == x .Source && m .Destination == x .Destination && m .RW == x .RW || m .Name != x .Name {
2745- matched = true
2746- break
2747- }
2748- }
2749- c .Assert (matched , checker .True , check .Commentf ("did find match for %+v" , m ))
2750- }
2751- }
2752-
27532674func (s * DockerDaemonSuite ) TestDaemonWithUserlandProxyPath (c * check.C ) {
27542675 testRequires (c , SameHostDaemon , DaemonIsLinux )
27552676
0 commit comments