summaryrefslogtreecommitdiff
path: root/volume/testutils
Commit message (Collapse)AuthorAgeFilesLines
* linting: gosec: fix or suppress G112, G114 in test codeSebastiaan van Stijn2022-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updating test-code only; set ReadHeaderTimeout for some, or suppress the linter error for others. contrib/httpserver/server.go:11:12: G114: Use of net/http serve function that has no support for setting timeouts (gosec) log.Panic(http.ListenAndServe(":80", nil)) ^ integration/plugin/logging/cmd/close_on_start/main.go:42:12: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec) server := http.Server{ Addr: l.Addr().String(), Handler: mux, } integration/plugin/logging/cmd/discard/main.go:17:12: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec) server := http.Server{ Addr: l.Addr().String(), Handler: mux, } integration/plugin/logging/cmd/dummy/main.go:14:12: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec) server := http.Server{ Addr: l.Addr().String(), Handler: http.NewServeMux(), } integration/plugin/volumes/cmd/dummy/main.go:14:12: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec) server := http.Server{ Addr: l.Addr().String(), Handler: http.NewServeMux(), } testutil/fixtures/plugin/basic/basic.go:25:12: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec) server := http.Server{ Addr: l.Addr().String(), Handler: http.NewServeMux(), } volume/testutils/testutils.go:170:5: G114: Use of net/http serve function that has no support for setting timeouts (gosec) go http.Serve(l, mux) ^ Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Fix flaky test TestServiceGetCatalin Pirvu2018-06-201-2/+5
| | | | Signed-off-by: Catalin Pirvu <pirvu.catalin94@gmail.com>
* Extract volume interaction to a volumes serviceBrian Goff2018-05-251-1/+3
| | | | | | | This cleans up some of the package API's used for interacting with volumes, and simplifies management. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* Merge pull request #35829 from cpuguy83/no_private_mount_for_pluginsSebastiaan van Stijn2018-02-211-2/+2
|\ | | | | Perform plugin mounts in the runtime
| * Ensure plugin returns correctly scoped pathsBrian Goff2018-02-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, volume management was relying on the fact that everything the plugin mounts is visible on the host within the plugin's rootfs. In practice this caused some issues with mount leaks, so we changed the behavior such that mounts are not visible on the plugin's rootfs, but available outside of it, which breaks volume management. To fix the issue, allow the plugin to scope the path correctly rather than assuming that everything is visible in `p.Rootfs`. In practice this is just scoping the `PropagatedMount` paths to the correct host path. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* | Add canonical import commentDaniel Nephin2018-02-051-1/+1
|/ | | | Signed-off-by: Daniel Nephin <dnephin@docker.com>
* Replace vol plugin integration test w/ unit testBrian Goff2017-11-151-0/+102
| | | | Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* Spelling fixesJosh Soref2017-07-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * additional * ambiguous * anonymous * anything * application * because * before * building * capabilities * circumstances * commit * committer * compresses * concatenated * config * container * container's * current * definition * delimiter * disassociates * discovery * distributed * doesnotexist * downloads * duplicates * either * enhancing * enumerate * escapable * exactly * expect * expectations * expected * explicitly * false * filesystem * following * forbidden * git with * healthcheck * ignore * independent * inheritance * investigating * irrelevant * it * logging * looking * membership * mimic * minimum * modify * mountpoint * multiline * notifier * outputting * outside * overridden * override * parsable * plugins * precedence * propagation * provided * provides * registries * repositories * returning * settings * should * signals * someone * something * specifically * successfully * synchronize * they've * thinking * uninitialized * unintentionally * unmarshaling * unnamed * unreferenced * verify Signed-off-by: Josh Soref <jsoref@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Add CreatedAt filed to volume. Display when volume is inspected.Marianna2017-05-261-0/+7
| | | | | | | | | | | | | | Closes #32663 by adding CreatedAt field when volume is created. Displaying CreatedAt value when volume is inspected Adding tests to verfiy the new field is correctly populated Signed-off-by: Marianna <mtesselh@gmail.com> Moving CreatedAt tests from the CLI Moving the tests added for the newly added CreatedAt field for Volume, from CLI to API tests Signed-off-by: Marianna <mtesselh@gmail.com>
* test: fix trivial code convention noncomplianceAkihiro Suda2016-09-121-1/+1
| | | | | | | daemon/events/testutils: rename eventstestutils to testutils volume/testutils: rename volumetestutils to testutils Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
* Add support for volume scopesBrian Goff2016-06-051-0/+5
| | | | | | | | This is similar to network scopes where a volume can either be `local` or `global`. A `global` volume is one that exists across the entire cluster where as a `local` volume exists on a single engine. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* When calling volume driver Mount, send opaque IDBrian Goff2016-04-291-4/+4
| | | | | | | This generates an ID string for calls to Mount/Unmount, allowing drivers to differentiate between two callers of `Mount` and `Unmount`. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* Allow volume drivers to provide a `Status` fieldBrian Goff2016-04-151-0/+6
| | | | | | | The `Status` field is a `map[string]interface{}` which allows the driver to pass back low-level details about the underlying volume. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* fix race condition between list and remove volumeViktor Stanchev2016-03-241-5/+6
| | | | | | | | This was done by making List not populate the cache. fixes #21403 Signed-off-by: Viktor Stanchev <me@viktorstanchev.com>
* Move responsibility of ls/inspect to volume driverBrian Goff2016-01-051-5/+41
| | | | | | | | | | | | | | | | | | | | | Makes `docker volume ls` and `docker volume inspect` ask the volume drivers rather than only using what is cached locally. Previously in order to use a volume from an external driver, one would either have to use `docker volume create` or have a container that is already using that volume for it to be visible to the other volume API's. For keeping uniqueness of volume names in the daemon, names are bound to a driver on a first come first serve basis. If two drivers have a volume with the same name, the first one is chosen, and a warning is logged about the second one. Adds 2 new methods to the plugin API, `List` and `Get`. If a plugin does not implement these endpoints, a user will not be able to find the specified volumes as well requests go through the drivers. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
* Move volume ref counting store to a package.David Calavera2015-09-211-0/+68
- Add unit tests to make sure the functionality is correct. - Add FilterByDriver to allow filtering volumes by driver, for future `volume ls` filtering and whatnot. Signed-off-by: David Calavera <david.calavera@gmail.com>