Commit Graph

20 Commits

Author SHA1 Message Date
Sam Whited b37c214e3c testutil: make testing packages public
This was done with something along the lines of:

```
mv internal/test testutil
pushd testutil/; grep -IRl "package test" | xargs -I '{}' sed -i -e 's|package test|package testutil|g' {}; popd
mv internal/testutil/*.go testutil/ && rm -rf internal/
grep -IRl "github.com\/docker\/docker\/internal\/test" | xargs -I '{}' sed -i -e 's|github.com/docker/docker/internal/test|github.com/docker/docker/test|g' {}
goimports .
```

I also modified the basic plugin path in testutil/fixtures/plugin.

Signed-off-by: Sam Whited <sam@samwhited.com>
2019-09-11 07:47:23 -05:00
Sebastiaan van Stijn 422067ba7b
Return "invalid parameter" when linking to non-existing container
Trying to link to a non-existing container is not valid, and should return an
"invalid parameter" (400) error. Returning a "not found" error in this situation
would make the client report the container's image could not be found.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-10 23:06:56 +02:00
Sebastiaan van Stijn ae875d4069
Update more tests to use new errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-16 00:41:02 +01:00
Olli Janatuinen 80d7bfd54d Capabilities refactor
- Add support for exact list of capabilities, support only OCI model
- Support OCI model on CapAdd and CapDrop but remain backward compatibility
- Create variable locally instead of declaring it at the top
- Use const for magic "ALL" value
- Rename `cap` variable as it overlaps with `cap()` built-in
- Normalize and validate capabilities before use
- Move validation for conflicting options to validateHostConfig()
- TweakCapabilities: simplify logic to calculate capabilities

Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-22 21:50:41 +02:00
Sebastiaan van Stijn 0de62d9bbc
Integration: use testenv.APIClient()
A client is already created in testenv.New(), so we can just
as well use that one, instead of creating a new client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-03 11:53:41 +01:00
Vincent Demeester d3cc071bb9 Windows: Start of enabling tests under integration/
- Add windows CI entrypoint script.

Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-09-26 12:28:22 -07:00
Arash Deshmeh cd4d1cfc10 migrate integration tests from integration-cli/docker_api_create_test.go to integration/container
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-07-18 13:15:04 -04:00
Vincent Demeester 3845728524
Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-13 09:04:30 +02:00
Jess Frazelle 3694c1e34e
api: add configurable MaskedPaths and ReadOnlyPaths to the API
This adds MaskedPaths and ReadOnlyPaths options to HostConfig for containers so
that a user can override the default values.

When the value sent through the API is nil the default is used.
Otherwise the default is overridden.

Adds integration tests for MaskedPaths and ReadonlyPaths.

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-05 12:33:14 -04:00
Sebastiaan van Stijn 55bebbaecf
Replace deprecated testutil.ErrorContains()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-21 00:13:04 +02:00
Vincent Demeester 42f6fdf059
Move integration-cli/request to internal/test/request…
… and change a bit the method signature

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-17 16:25:59 +02:00
Yong Tang ab9bb47b05 Some enhancement in integration tests
This fix converts some `client.ContainerCreate` to `container.Create`,
and removes some unneeded `name` fields when test containers are created.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-04-14 16:52:02 +00:00
Vincent Demeester af306d149e
Rename integration/util to integration/internal
Both names have no real sense, but one allows to make sure these packages
aren't used outside of `integration`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-10 09:16:32 +01:00
Yong Tang 15001f83bd
Merge pull request #36241 from yongtang/02072018-create-tests
Migrate TestCreateTmpfsMountsTarget test to api test
2018-02-08 14:58:06 -08:00
Yong Tang f601bc16d5 Migrate TestCreateTmpfsMountsTarget test to api test
This fix migrates TestCreateTmpfsMountsTarget test to api test,
and removed integration-cli/docker_cli_create_unix_test.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-08 15:59:12 +00:00
Daniel Nephin 4f0d95fa6e Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-05 16:51:57 -05:00
Daniel Nephin e62b2d410c Move ErrorContains to an internal package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-25 12:04:58 -04:00
Daniel Nephin c66c0447ef move api test client setup to a package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 11:02:57 -04:00
Daniel Nephin 5fa134b906 Protect images in the integration/ suite
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 11:02:57 -04:00
Vincent Demeester 6b025a8b66 Introduce `test-integration` target (and deprecate/freeze `test-integration-cli`)
This adds a new package `integration` where `engine` integration tests
should live. Those integration tests should not depends on any `cli`
components (except from the `dockerd` daemon for now — to actually
start a daemon).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-08-09 11:02:57 -04:00