Commit Graph

234 Commits

Author SHA1 Message Date
0d1c1d0efa cleanup/fix integration-cli for overlay in overlay
Signed-off-by: Jessica Frazelle <jess@docker.com>
Upstream-commit: 255b84444a86201995d8f688d71b83822f146c3e
Component: engine
2015-04-08 16:59:36 -07:00
2f18e59567 Test case for network mode chain container -> container -> host
Issue #12130

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: ce69dafe4d0424ddb5df53d9aee7728f0734cce7
Component: engine
2015-04-07 15:20:42 -07:00
ab9a366f0e Remove stripTrailingCharacters from tests
This was just an alias to `strings.TrimSpace`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 475c65319b4663d630711519e18d0b134c42c7f1
Component: engine
2015-04-06 09:21:18 -04:00
e8ab23fa21 Increase timeout on TestRunOOMExitCode test
I can never get it to work for me when its just 3 seconds.
With this change it generates the OOM message around 17 seconds, but
I increased the timeout to 30 for people with slower machines

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 8d1455d88b66011713da67098dc3464b897af9cd
Component: engine
2015-03-31 16:57:43 -07:00
1541e9c937 Merge pull request #11934 from cpuguy83/fix_volume_symlink_check
Fix volume symlink check
Upstream-commit: 749a117267c4c0f74b0162af9ed42c3307737dde
Component: engine
2015-03-31 13:56:23 -07:00
419d6ae6f9 Use getResourcePath instead
Also cleans up tests to not shell out for file creation.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 63708dca8a633d68f9342eebd4f7a616e8c48234
Component: engine
2015-03-31 15:10:30 -04:00
3cecae722e Fix create volume in a directory which is a symbolic link
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 7583b491250beac9caeeac13b7b68c4e0f03eb60
Component: engine
2015-03-29 13:35:36 +08:00
0544f5e034 Fix error from daemon no such image even when the image exist
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 013fb87543a47524efba3c371a1d22afe151287c
Component: engine
2015-03-28 09:07:20 +08:00
3495bd3522 Merge pull request #11848 from duglin/CleanupIntTests
Clean up integration-cli tests
Upstream-commit: 240f3e14c78f34102672b121a43b612989856d0d
Component: engine
2015-03-27 14:11:56 -07:00
5897cb3c81 Clean up integration-cli tests
My AR couldn't take it any more:
- one logDone per test
- PASSED lines don't wrap

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 9a9d23dbc40c9b650bd1f9f98a421b7ff2312f36
Component: engine
2015-03-26 17:25:50 -07:00
0913f2905d Changed snake case naming to camelCase
Signed-off-by: Peter Choi <phkchoi89@gmail.com>
Upstream-commit: ae907e7af16136225417242ef5d55d3f6062fb3b
Component: engine
2015-03-26 15:05:45 -06:00
0b6cf588fa Merge pull request #11791 from moo-mou/11768-vetwarning
Fix vet warning
Upstream-commit: a196cc943ccb02a857c8509b6badb12e8e2071ac
Component: engine
2015-03-26 10:52:07 -07:00
35acd2c3eb Add fixes for integration-cli tests w/ --net none
Adds network to integration tests that were failing without network.

Fixes #10964
Fixes #10968

Signed-off-by: Jake Champlin <jake.champlin.27@gmail.com>
Upstream-commit: c2fe26243906ad2641876e877d23a419bb4bdb75
Component: engine
2015-03-25 23:46:04 -04:00
8f2d65bf21 Fix vet warning
Signed-off-by: Paul Mou <ppymou@gmail.com>
Upstream-commit: c5bf2145f172a264d3d8fc63d6717826b95b5ee2
Component: engine
2015-03-25 20:31:02 -07:00
944966da9a fix 2 integration tests on lxc
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: c959d26d2f413fa93b60174c4e19111eff0a845d
Component: engine
2015-03-24 21:12:16 -07:00
7074731d32 Merge pull request #11636 from robertabbott/refactor_networkfs
Refactor pkg/networkfs
Upstream-commit: d5eea4e8b04074b709d1bbe19b5336504df44446
Component: engine
2015-03-23 16:58:29 -07:00
2d5a6d9e9b Remove container if --rm flag is passed and container cannot be started
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: d124197cc726a3b69cc3cde8c4d560f3f0e1af9c
Component: engine
2015-03-23 13:03:31 +01:00
4b8e196164 Refactor pkg/networkfs
Solves #11591

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
Upstream-commit: a91b2431a303f919b0737d95639d8e445124cb23
Component: engine
2015-03-22 23:53:47 -07:00
f2ad0ab09b Fix hostname missing when a container's net mode is contaienr mode
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 74664dabff906f42b9acfbad516eeae484b47af9
Component: engine
2015-03-19 17:03:40 +08:00
e296e8dc09 Merge pull request #11369 from coolljt0725/fix_link
Fix --link to a container which net mode is container
Upstream-commit: cb77ad4757947adcff7bf4cd95969e75a7018614
Component: engine
2015-03-17 08:36:33 -07:00
9e124c2aad Fix --link to a container which net mode is container mode
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 82e2e1a11af60a41100e2ced24f23cf2872e5604
Component: engine
2015-03-17 07:50:12 -07:00
3f595d22d6 verify MaximumRetryCount for container restart policy
Signed-off-by: s00318865 <sunyuan3@huawei.com>
Upstream-commit: 173642c8660adb39619ecfe725bd44b984d4c627
Component: engine
2015-03-17 13:20:25 +08:00
ed5523443d Merge pull request #10298 from hqhq/hq_move_resource_to_hostconfig
move resource options from Config to hostConfig
Upstream-commit: bc7d1d6ef307b05b0951f5c884620a87c5ac8f7d
Component: engine
2015-03-15 17:30:46 -07:00
4ae0ae0aee integ-cli: remove ICMP dependency from test, use nslookup
As we started running CI machines on Azure cloud and Azure
doesn't have ICMP stack implemented by replacing
`ping 8.8.8.8` with `nslookup google.com`.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 004ac85aa25f08e350465140ee7404ad31602d75
Component: engine
2015-03-11 14:27:11 -07:00
71f67ca560 move resources from Config to HostConfig
Cgroup resources are host dependent, they should be in hostConfig.

For backward compatibility, we just copy it to hostConfig, and leave it in
Config for now, so there is no regressions, but the right way to use this
throught json is to put it in HostConfig, like:
  {
      "Hostname": "",
      ...
      "HostConfig": {
	  "CpuShares": 512,
          "Memory": 314572800,
          ...
      }
  }

As we will add CpusetMems, CpusetCpus is definitely a better name, but some
users are already using Cpuset in their http APIs, we also make it compatible.

The main idea is keep using Cpuset in Config Struct, and make it has the same
value as CpusetCpus, but not always, some scenarios:
 - Users use --cpuset in docker command, it can setup cpuset.cpus and can
   get Cpuset field from docker inspect or other http API which will get
   config info.
 - Users use --cpuset-cpus in docker command, ditto.
 - Users use Cpuset field in their http APIs, ditto.
 - Users use CpusetCpus field in their http APIs, they won't get Cpuset field
   in Config info, because by then, they should already know what happens
   to Cpuset.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 837eec064d2d40a4d86acbc6f47fada8263e0d4c
Component: engine
2015-03-11 09:31:18 +08:00
993f8d5799 Merge pull request #11235 from coolljt0725/fix_default_restart_name
Set default restart policy name to `no` Closes #10874
Upstream-commit: 7e47bb6effd1f076a78827543c4b4ce399c0ad1b
Component: engine
2015-03-10 12:12:40 -07:00
53af0dd72f Add warning for --dns flag set to localhost addresses.
We should warn users who use the `--dns` command line option to point
DNS to a localhost address, either IPv4 or IPv6.  Unless they have
specifically set up the container as a DNS server or are using
--net=host (which is why this should be allowed, but warned on because
those are pretty unique cases) a localhost address as a resolver will
not reach what they might expect (e.g. expecting it will hit localhost
on the Docker daemon/host).

Added a test for the message, and fixed up tests to separate stdout and
stderr that were using `--dns=127.0.0.1` to test the options.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: afa92a9af0f1a77ef25aab73b11aa855a1823666
Component: engine
2015-03-10 14:43:17 -04:00
0199092cfa Set default restart policy name to 'no' Closes #10874
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 311a600f1912c0d2a30becffdecde6026ada2624
Component: engine
2015-03-10 10:09:12 +08:00
de1d7d8288 integ-cli: also preserve SystemRoot env var
Windows CI fails to dial remote test host over tcp in the test cases where
we clear environment variables during `exec(dockerBinary, ...)` in the
absence of `SystemRoot` environment variable (typically points to `c:\windows`).

This fixes tests:
- `TestRunEnvironmentErase`
- `TestRunEnvironmentOverride`

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: d18689dff71ccbc3b955a4416ae04077356fd5c9
Component: engine
2015-03-07 01:09:01 -08:00
ddfd7a9478 integ-cli: fix test requiring scratch
TestRunCidFileCleanupIfEmpty fails on windows/mac because the test runs
the command `docker run scratch` and it gives the following error:

	Unable to find image 'scratch:latest' locally
	Pulling repository scratch
	511136ea3c5a: Download complete
	FATA[0004] 'scratch' is a reserved name

I am not entirely sure if this is a test issue or not but I had a quick
workaround by creating another image using `FROM scratch` and using that.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 3a70f9d422e2d47dad0d8d5825832dd7f85f049a
Component: engine
2015-03-06 08:52:40 -08:00
9e58235829 Clarify/cleanup "/etc" volume overlays special /etc mounts test
Added link to original issue and clarified text so someone without any
background on the original issue can understand why the test exists.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: b5036ad5c64f19a52806df500b6a89d9c3294ac6
Component: engine
2015-03-05 09:41:56 -05:00
aa9b58cd0b Don't test resolv.conf updater on overlay filesystem
The overlay filesystem does not support inotify at this time. The
resolv.conf updater test was passing on overlay-based Jenkins because of
a fluke--because it was DIND, /etc/resolv.conf on the "host" was really
a bind-mounted resolv.conf from the outer container, which means a watch
directly on that file worked as it was not overlay backed.  The new test
(from #10703) unmounts the bind-mounted copy to test create and modify
code-paths, which caused us to hit the issue.

This PR also adds a note to the docs about the lack of auto-update when
using the overlay storage driver.

See https://lkml.org/lkml/2012/2/28/223 for more info on inotify and
overlay.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 9057ca2541582fc41eb7cb45edd332247a813bba
Component: engine
2015-03-05 00:22:01 -05:00
c154ff2dc2 Merge pull request #10713 from swagiaal/pickup-created-resolvconf
Update resolv.conf in containers on file creation.
Upstream-commit: 2380004d30769e9abc2a975dc9f89d83cc459d5f
Component: engine
2015-03-04 10:21:36 -05:00
55588c146b Last three tests skip on lxc.
Now we can scale lxc tests to all PRs.

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <hugs@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 321874f37672b2424a7609caa1aac616b3b23c6a
Component: engine
2015-03-04 06:04:25 -08:00
030e1d866f Merge pull request #11037 from coolljt0725/add_parse_mac
Add validate the input mac address on docker run command
Upstream-commit: 314a678da7f948548a7f5aae886b3089ce4a7c9b
Component: engine
2015-02-27 12:03:25 -08:00
b540023f69 Add validate the input mac address on docker run command
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 2ba0fbb0ae1701b638a4bb956187dd878385dc80
Component: engine
2015-02-27 07:27:12 -08:00
3541951109 Merge pull request #11001 from ahmetalpbalkan/win-cli/TestRunNoDupVolumes-fix
integ-cli: pass unix paths to TestRunNoDupVolumes
Upstream-commit: 21811f07861007da1481c7a1ad100720e09ffa98
Component: engine
2015-02-25 09:47:30 -08:00
8535caec3a integ-cli: skip TestRunBindMounts (same-host daemon requirement)
`TestRunBindMounts` requires daemon to be on the same host.
Running this cli test on Linux is fair enough coverage for
this functionality and we can skip this for platforms where
daemon cannot run side-by-side with the cli for now.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 26444e5e9ad3bc2babd62b76a9a4b46d82414738
Component: engine
2015-02-24 21:04:47 -08:00
53cee48083 integ-cli: pass unix paths to TestRunNoDupVolumes
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: db1f8f7481a825a921295adea36d2e56ee8703ae
Component: engine
2015-02-24 18:50:55 -08:00
f24c530c74 integ-cli: Skip tests assuming daemon/cli are on the same host
Some integration-cli tests assume daemon and cli are running
on the same machine and therefore they examine side effects
of executed docker commands on docker host by reading files
or running other sort of commands.

In case of windows/darwin CLI tests these provide little
or no value and should be OK to skip.

List of skipped tests:
- `TestContainerNetworkMode`
- `TestCpVolumePath`
- `TestCreateVolumesCreated`
- `TestBuildContextCleanup`
- `TestBuildContextCleanupFailedBuild`
- `TestLinksEtcHostsContentMatch`
- `TestRmContainerWithRemovedVolume`
- `TestRunModeIpcHost`
- `TestRunModeIpcContainer`
- `TestRunModePidHost`
- `TestRunNetHost`
- `TestRunDeallocatePortOnMissingIptablesRule`
- `TestRunPortInUse`
- `TestRunPortProxy`
- `TestRunMountOrdering`
- `TestRunModeHostname`
- `TestRunDnsDefaultOptions`
- `TestRunDnsOptionsBasedOnHostResolvConf`
- `TestRunResolvconfUpdater`
- `TestRunVolumesNotRecreatedOnStart`

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: b686b65c9b5f5eabc7a618faf0055aff06e4c0c4
Component: engine
2015-02-23 14:08:05 -08:00
113975c3ee Merge pull request #10909 from ahmetalpbalkan/run_test-defer
integration-cli: Better test cleanup with defer
Upstream-commit: b062ef05e59ecfc0c08dccdea3d81c024c491350
Component: engine
2015-02-20 17:28:08 -08:00
0f72ec16db Better test cleanup with defer
This fixes a few misuses of `deleteAllContainers()` cleanup
method in integration-cli suite by moving call to the
beginning of the method and guaranteeing their execution
(including panics) with `defer`s.

Also added some forgotten cleanup calls while I'm at it.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 70407ce40ca98d763da8472e7ee94b6e8d66912d
Component: engine
2015-02-20 14:04:36 -08:00
83db4644ad Update resolve.conf in containers on file creation.
NetworkManager updates resolve.conf by replacing the current file
with an updated one. This change enables docker to listen for these
events.

Signed-off-by: Sami Wagiaalla <swagiaal@redhat.com>
Upstream-commit: 11c7c9710a670ad1f49de8f2814caa51d2f7adb6
Component: engine
2015-02-20 11:27:08 -05:00
1b9876efb2 integ-cli: fix volume test by passing unix path as volume
This fixes `TestVolumesNoCopyData` for test execution on
windows by passing a unix-style path as volume even though
it's running on windows.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 606283875616bf71af4814fc47ee5c2ca7b729c6
Component: engine
2015-02-20 00:58:44 -08:00
2c330e66cf Merge pull request #10856 from coolljt0725/fix_expose
Fix docker run --expose with an invalid port does not error out
Upstream-commit: 140293734736e9b7ab61bf4dbb25bc318d6d1c7f
Component: engine
2015-02-19 16:01:15 -08:00
a1eb08d949 Add a test for expose a invalid port
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 34b7c10e3eed8bd4d71b998d06ca10766ce4c754
Component: engine
2015-02-19 15:18:13 -08:00
320f4e4af1 Merge pull request #10852 from Snorch/check-docker-port-is-not-empty
Upstream-commit: ac7bef5e66aa55acc232826ab590149f8e162ad9
Component: engine
2015-02-19 17:18:36 -05:00
e5290f478d integration-cli: remove bash dependency from TestRunSetMacAddress
This change enables TestRunSetMacAddress to run on windows
without `bash` dependency. Also `defer`red call of cleanup
method.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: c1a54048e241bd565feabf274b79dfac61c396d4
Component: engine
2015-02-17 23:24:36 -08:00
1653e2237b integration-cli: check that docker port command output is not empty
Or else we can violate array range boundaries in:
	out = strings.Split(out, ":")[1]
and get runtime error.

We got this runtime error when run TestRunPortFromDockerRangeInUse
Somehow docker goes silently if it cannot publish port because
of no bridge.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@parallels.com>
Upstream-commit: cad770f992ee5837273a02edb28f73624898bee1
Component: engine
2015-02-17 16:01:34 +03:00
7dcc838aea Merge pull request #10804 from ahmetalpbalkan/win-cli/TestRunSlowStdoutConsume-fix
integration-cli: remove bash dependency of TestRunSlowStdoutConsumer
Upstream-commit: 110ce4f6cdf7c5a2409a6075d783f5af76ba190e
Component: engine
2015-02-16 11:58:55 -08:00