Commit graph

231 commits

Author SHA1 Message Date
Doug Davis
8d1455d88b 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>
2015-03-31 16:57:43 -07:00
Jessie Frazelle
749a117267 Merge pull request #11934 from cpuguy83/fix_volume_symlink_check
Fix volume symlink check
2015-03-31 13:56:23 -07:00
Brian Goff
63708dca8a Use getResourcePath instead
Also cleans up tests to not shell out for file creation.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-03-31 15:10:30 -04:00
Lei Jitang
7583b49125 Fix create volume in a directory which is a symbolic link
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-29 13:35:36 +08:00
Lei Jitang
013fb87543 Fix error from daemon no such image even when the image exist
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-28 09:07:20 +08:00
Alexander Morozov
240f3e14c7 Merge pull request #11848 from duglin/CleanupIntTests
Clean up integration-cli tests
2015-03-27 14:11:56 -07:00
Doug Davis
9a9d23dbc4 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>
2015-03-26 17:25:50 -07:00
Peter Choi
ae907e7af1 Changed snake case naming to camelCase
Signed-off-by: Peter Choi <phkchoi89@gmail.com>
2015-03-26 15:05:45 -06:00
Michael Crosby
a196cc943c Merge pull request #11791 from moo-mou/11768-vetwarning
Fix vet warning
2015-03-26 10:52:07 -07:00
Jake Champlin
c2fe262439 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>
2015-03-25 23:46:04 -04:00
paul
c5bf2145f1 Fix vet warning
Signed-off-by: Paul Mou <ppymou@gmail.com>
2015-03-25 20:31:02 -07:00
Jessica Frazelle
c959d26d2f fix 2 integration tests on lxc
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-03-24 21:12:16 -07:00
Jessie Frazelle
d5eea4e8b0 Merge pull request #11636 from robertabbott/refactor_networkfs
Refactor pkg/networkfs
2015-03-23 16:58:29 -07:00
Antonio Murdaca
d124197cc7 Remove container if --rm flag is passed and container cannot be started
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-23 13:03:31 +01:00
bobby abbott
a91b2431a3 Refactor pkg/networkfs
Solves #11591

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-03-22 23:53:47 -07:00
Lei Jitang
74664dabff Fix hostname missing when a container's net mode is contaienr mode
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-19 17:03:40 +08:00
Arnaud Porterie
cb77ad4757 Merge pull request #11369 from coolljt0725/fix_link
Fix --link to a container which net mode is container
2015-03-17 08:36:33 -07:00
Lei Jitang
82e2e1a11a Fix --link to a container which net mode is container mode
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-17 07:50:12 -07:00
s00318865
173642c866 verify MaximumRetryCount for container restart policy
Signed-off-by: s00318865 <sunyuan3@huawei.com>
2015-03-17 13:20:25 +08:00
Arnaud Porterie
bc7d1d6ef3 Merge pull request #10298 from hqhq/hq_move_resource_to_hostconfig
move resource options from Config to hostConfig
2015-03-15 17:30:46 -07:00
Ahmet Alp Balkan
004ac85aa2 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>
2015-03-11 14:27:11 -07:00
Qiang Huang
837eec064d 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>
2015-03-11 09:31:18 +08:00
Jessie Frazelle
7e47bb6eff Merge pull request #11235 from coolljt0725/fix_default_restart_name
Set default restart policy name to `no` Closes #10874
2015-03-10 12:12:40 -07:00
Phil Estes
afa92a9af0 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)
2015-03-10 14:43:17 -04:00
Lei Jitang
311a600f19 Set default restart policy name to 'no' Closes #10874
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-03-10 10:09:12 +08:00
Ahmet Alp Balkan
d18689dff7 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>
2015-03-07 01:09:01 -08:00
Ahmet Alp Balkan
3a70f9d422 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>
2015-03-06 08:52:40 -08:00
Phil Estes
b5036ad5c6 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)
2015-03-05 09:41:56 -05:00
Phil Estes
9057ca2541 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)
2015-03-05 00:22:01 -05:00
Phil Estes
2380004d30 Merge pull request #10713 from swagiaal/pickup-created-resolvconf
Update resolv.conf in containers on file creation.
2015-03-04 10:21:36 -05:00
Jessica Frazelle
321874f376 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)
2015-03-04 06:04:25 -08:00
Jessie Frazelle
314a678da7 Merge pull request #11037 from coolljt0725/add_parse_mac
Add validate the input mac address on docker run command
2015-02-27 12:03:25 -08:00
Lei Jitang
2ba0fbb0ae Add validate the input mac address on docker run command
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-02-27 07:27:12 -08:00
Jessie Frazelle
21811f0786 Merge pull request #11001 from ahmetalpbalkan/win-cli/TestRunNoDupVolumes-fix
integ-cli: pass unix paths to TestRunNoDupVolumes
2015-02-25 09:47:30 -08:00
Ahmet Alp Balkan
26444e5e9a 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>
2015-02-24 21:04:47 -08:00
Ahmet Alp Balkan
db1f8f7481 integ-cli: pass unix paths to TestRunNoDupVolumes
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-24 18:50:55 -08:00
Ahmet Alp Balkan
b686b65c9b 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>
2015-02-23 14:08:05 -08:00
Jessie Frazelle
b062ef05e5 Merge pull request #10909 from ahmetalpbalkan/run_test-defer
integration-cli: Better test cleanup with defer
2015-02-20 17:28:08 -08:00
Ahmet Alp Balkan
70407ce40c 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>
2015-02-20 14:04:36 -08:00
Sami Wagiaalla
11c7c9710a 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>
2015-02-20 11:27:08 -05:00
Ahmet Alp Balkan
6062838756 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>
2015-02-20 00:58:44 -08:00
Jessie Frazelle
1402937347 Merge pull request #10856 from coolljt0725/fix_expose
Fix docker run --expose with an invalid port does not error out
2015-02-19 16:01:15 -08:00
Lei Jitang
34b7c10e3e Add a test for expose a invalid port
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-02-19 15:18:13 -08:00
Steve Francia
ac7bef5e66 Merge pull request #10852 from Snorch/check-docker-port-is-not-empty 2015-02-19 17:18:36 -05:00
Ahmet Alp Balkan
c1a54048e2 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>
2015-02-17 23:24:36 -08:00
Pavel Tikhomirov
cad770f992 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>
2015-02-17 16:01:34 +03:00
Jessie Frazelle
110ce4f6cd Merge pull request #10804 from ahmetalpbalkan/win-cli/TestRunSlowStdoutConsume-fix
integration-cli: remove bash dependency of TestRunSlowStdoutConsumer
2015-02-16 11:58:55 -08:00
Michael Crosby
c2effb259d Merge pull request #10615 from coolljt0725/fix_mount
Fix create volume /etc cover /etc/{hosts,resolv.conf,hostname} Fixes # 10604
2015-02-16 10:53:26 -08:00
Michael Crosby
73665ff5f2 Merge pull request #10633 from hqhq/hq_fix_memoryswap
fix the problem that memory-swap=-1 is not working for docker command
2015-02-16 10:49:01 -08:00
Ahmet Alp Balkan
ae8f1fa712 integration-cli: remove bash dependency of TestRunSlowStdoutConsumer
This makes this test case run on msys bash on windows or
cmd.exe.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-16 10:18:27 -08:00