Commit Graph

30 Commits

Author SHA1 Message Date
cfd34d85d8 Remove SameHostDaemon, use testEnv.IsLocalDaemon instead
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 43b15e924ffb7790ae087feac7618308a9e4b75e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3304d91f1e69b53e92240fd3c604d178b0601dd5
Component: engine
2019-04-17 23:09:35 +02:00
0b5da3a767 integration-cli: error report improvements
1. After running d.Cmd(), in case an error is returned, it makes sense
to print command output, as its stderr may contain a clue about what
went wrong. This is by no means complete, just as far as I could go.

2. In case the comment in c.Assert is a constant string, it's better
to provide it as a comment which will be printed.

3. An arbitrary string should not be passed on to a function expecting
%-style formatting. Use %s to fix this.

4. Print the output string before transformation, not after.

5. Unify the output format (drop "out:" prefix").

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: ac038eab298eeecab55a62440de302e3bb3f4889
Component: engine
2018-08-14 12:52:30 +03:00
fe821da2fd integration: use %s for check.Commentf()
It is wrong to pass an arbitrary string to a function expecting
%-style formatting. One solution would be to replace any % with %%,
but it's easier to just do what this patch does.

Generated with:

for f in $(git grep -l 'check.Commentf(out)'); do \
	sed -i -e 's/check\.Commentf(out)/check.Commentf("%s", out)/g' $f; \
done

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 83363fb2d4d97d952a0052d079faa8ae39aa20b6
Component: engine
2018-08-14 10:45:39 +03:00
4cadaa03f8 Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 38457285242e57306c5b7ee652c7ccbb9fbd6713
Component: engine
2018-06-13 09:04:30 +02:00
a97e7a41c8 pkg/mount: implement/use filter for mountinfo parsing
Functions `GetMounts()` and `parseMountTable()` return all the entries
as read and parsed from /proc/self/mountinfo. In many cases the caller
is only interested only one or a few entries, not all of them.

One good example is `Mounted()` function, which looks for a specific
entry only. Another example is `RecursiveUnmount()` which is only
interested in mount under a specific path.

This commit adds `filter` argument to `GetMounts()` to implement
two things:
 1. filter out entries a caller is not interested in
 2. stop processing if a caller is found what it wanted

`nil` can be passed to get a backward-compatible behavior, i.e. return
all the entries.

A few filters are implemented:
 - `PrefixFilter`: filters out all entries not under `prefix`
 - `SingleEntryFilter`: looks for a specific entry

Finally, `Mounted()` is modified to use `SingleEntryFilter()`, and
`RecursiveUnmount()` is using `PrefixFilter()`.

Unit tests are added to check filters are working.

[v2: ditch NoFilter, use nil]
[v3: ditch GetMountsFiltered()]
[v4: add unit test for filters]
[v5: switch to gotestyourself]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: bb934c6aca3e77541dd4fd51b9ab2706294dadda
Component: engine
2018-04-19 14:48:09 -07:00
8348a70a7d Migrate test-integration-cli experimental plugin tests to integration
All `plugins` tests that require an `ExperimentalDaemon` are migrated
to `integration/plugin/*` and start an experimental daemon to test on
it.

The end goal being to remove the `experimental` build.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 69bab3832ce1d72dd1d3ed2f2b53143ec9ff102c
Component: engine
2018-04-19 11:57:28 +02:00
e0869be245 Cleanup volume plugin test with bad assumptions
Test made some bad assumptions about on-disk state of volume data.
This updates the test to only test based on what the volume API is
designed to provide.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 0df654f3d61d8691ee113a8429bcc8ef65786bc7
Component: engine
2018-02-20 16:57:20 -05:00
e8bff97a66 Update tests to use icmd
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 92427b3a8146e048c4b85e5ece1530da97d8472d
Component: engine
2017-08-25 12:07:30 -04:00
e95f4619cd [project] change syscall to /x/sys/unix|windows
Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>

[s390x] switch utsname from unsigned to signed

per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 069fdc8a083cb1663e4f86fe3fd9b9a1aebc3e54
Component: engine
2017-07-11 08:00:32 -04:00
d6f71ce6ed Add missing test for daemon kill with plugins running.
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
Upstream-commit: b748debb76110e577cfde7c5d5c362e69ddf86ce
Component: engine
2017-03-22 14:38:55 -07:00
528e9e6c7b [multi-arch] skip more plugin tests on non-x86
Until the plugins are multi-arch plugins, or built on runtime,
skip these tests like we do with the remainder of the plugin tests.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 362d082b6e67f2cd40d677b50b10fe76b3695279
Component: engine
2017-02-28 16:53:30 -05:00
b7000a9be6 Add capability filter to docker plugin ls
This fix adds `--filter capability=[volumedriver|authz]` to `docker plugin ls`.

The related docs has been updated.

An integration test has been added.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 99d91ada97334116b26b34a0fdcfa83cce73cda3
Component: engine
2017-01-27 07:32:22 -08:00
947241845a Add --filter enabled=true for docker plugin ls
This fix adds `--filter enabled=true` to `docker plugin ls`,
as was specified in 28624.

The related API and docs has been updated.

An integration test has been added.

This fix fixes 28624.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a66e0dc349dad2d45685846a95fe1d6da967a46d
Component: engine
2017-01-26 13:16:11 -08:00
78d1ff88be Update trustedCmd to be compatible with testutil/cmd
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 303b1d200af65ebb165602d0137f8b24b7c54d66
Component: engine
2017-01-09 11:07:05 +01:00
424f0925a7 Clean some runCommandWithOutput accross integration-cli code
There is still ways to go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 87e3fcfe1e059780c4ee57abb097296fd29e09af
Component: engine
2017-01-05 17:44:31 +01:00
2758f0996d Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 33968e6c7df164fff0a882c50ae7f4f7e6190e4b
Component: engine
2016-12-30 18:26:34 +01:00
f56b7023bb Merge pull request #28623 from cpuguy83/update_graphdriver_docs
Ensure graphdriver only loads with experimental flag
Upstream-commit: d3e3a97cb2b3d86587ae52e3d8247dc2ba4d2c4e
Component: engine
2016-12-24 11:59:24 +01:00
9eac558235 Enforce zero plugin refcount during disable.
When plugins have a positive refcount, they were not allowed to be
removed. However, plugins could still be disabled when volumes
referenced it and containers using them were running.

This change fixes that by enforcing plugin refcount during disable.
A "force" disable option is also added to ignore reference refcounting.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 8cb2229cd18c53bdbf36301f26db565a50027d6a
Component: engine
2016-12-22 13:26:53 -08:00
38849b2667 Moves graphdriver plugn docs out of experimental
Also updates some of the structures being sent so plugins are getting
all the new options.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 677fa03654886ee776ff478c30681d5376cfc196
Component: engine
2016-12-22 15:30:25 -05:00
cafaf16a79 Ensure test graphdriver plugin runs on test host
Sets a kernel requirement for for `TestGraphdriverPlugin` since the
graphdriver being used is overlay2.. and also makes sure to skip the
kernel check in the actual graphdriver since we may be able to detect
kernels with backported support for overlay2 style mounts a bit more
freely in the test code.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e4ebc92edc85d2f46cf41c4ad9514ba0fbafed06
Component: engine
2016-12-19 16:05:22 -05:00
343586bbdc Fix volume plugin refecounting on daemon restart
Ensures all known volumes (known b/c they are persisted to disk) have
their volume drivers refcounted properly.

In testing this, I found an issue with `--live-restore` (required since
currently the provided volume plugin doesn't keep state on restart)
where restorted plugins did not have a plugin client loaded causing a
panic when trying to use the plugin.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 6ef1060cd0acb847e06db890abb335faa837a9e2
Component: engine
2016-12-16 10:14:06 -05:00
b70f98ab3e Make graphdriver plugin use plugin BasePath
Also enables `PropagatedMount` for graphdrivers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 500210475f6d841b2eacb42fb495e90108db2733
Component: engine
2016-12-15 16:22:13 -05:00
2aa298ba4e Fix issues with plugin and --live-restore
Fixes an issue when starting the daemon with live-restore
where previously it was not set, plugins are not running.

Fixes an issue when starting the daemon with live-restore, the plugin
client (for interacting with the plugins HTTP interface) is not set,
causing a panic when the plugin is called.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: cb6633175c0de0a7ae155c4d378cd2379681554b
Component: engine
2016-12-13 16:11:59 -05:00
645f8e7ad5 [integration-cli] skip plugin tests on non-x86
Due to the test plugins being architecture specific, these
tests fail to start the plugin (even though they don't fail yet)

Temporary fix until we can build architecture specific test
plugins.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: ebff8c79a3b834c555f92e673c604f14fa0afa33
Component: engine
2016-12-12 17:17:45 -05:00
94e0a7d0c7 Use *check.C in StartWithBusybox, Start, Stop and Restart…
… to make sure it doesn't fail. It also introduce StartWithError,
StopWithError and RestartWithError in case we care about the
error (and want the error to happen).

This removes the need to check for error and make the intent more
clear : I want a deamon with busybox loaded on it — if an error occur
it should fail the test, but it's not the test code that has the
responsability to check that.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c502fb49dc7af89adfb2a9686354aa78c2c46002
Component: engine
2016-12-12 09:46:47 +01:00
71651385ac Extract daemon to its own package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 48de91a33f097d4c20515088af1f5bcb9a98c5c9
Component: engine
2016-12-09 22:26:42 +01:00
656f60dc73 plugins: container-rootfs-relative paths
Legacy plugins expect host-relative paths (such as for Volume.Mount).
However, a containerized plugin cannot respond with a host-relative
path. Therefore, this commit modifies new volume plugins' paths in Mount
and List to prepend the container's rootfs path.

This introduces a new PropagatedMount field in the Plugin Config.
When it is set for volume plugins, RootfsPropagation is set to rshared
and the path specified by PropagatedMount is bind-mounted with rshared
prior to launching the container. This is so that the daemon code can
access the paths returned by the plugin from the host mount namespace.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: c54b717caf1a55e525ce180bfcb42addd59c6633
Component: engine
2016-12-09 10:16:24 -08:00
f20a7bc47c plugins: fix some tests
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: a08ffa0e934e5f8b95855cc5bd0cc2a6b3cf4091
Component: engine
2016-11-21 16:34:10 -08:00
e5cb7de38d Skip plugin tests if not in amd64
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: e23e36f25cc55fd273fa04f2dd9d3772683ee381
Component: engine
2016-11-11 09:52:13 -08:00
fadae43674 move plugins out of experimental
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: c410222e42fb9195909390337bc129c6481e2453
Component: engine
2016-11-10 15:51:32 -08:00