Commit Graph

93 Commits

Author SHA1 Message Date
Alex Dadgar
a9e3a41407 Enable more linters 2017-09-26 15:26:33 -07:00
Armon Dadgar
3fc9dce13b Address @dadgar feedback 2017-09-11 10:30:59 -07:00
Chelsea Holland Komlo
ef4aef0223 fix up travis test failure via race condition 2017-09-05 15:04:59 +00:00
Chelsea Holland Komlo
681a3f337a fixups from code review 2017-09-05 14:13:34 +00:00
Chelsea Holland Komlo
3c0710074c labels depend on full setup of client beforehand 2017-09-05 14:13:34 +00:00
Armon Dadgar
33f640dc38 client: fixing policy resolution after ACL endpoint enforcement 2017-09-04 13:05:53 -07:00
Michael Schurter
85b9dd9cce Move migrating state into prevAllocWatcher 2017-08-14 16:02:28 -07:00
Michael Schurter
8253439de2 Update tests for new blocking/migrating code 2017-08-11 16:21:57 -07:00
Alex Dadgar
08c2ba9bc6 Parallel client tests (#2890)
* alloc_runner

* Random tests

* parallel task_runner and no exec compatible check

* Parallel client

* Fail fast and use random ports

* Fix docker port mapping

* Make concurrent pull less timing dependant

* up parallel

* Fixes

* don't build chroots in parallel on travis

* Reduce parallelism on travis with lxc/rkt

* make java test app not run forever

* drop parallelism a little

* use docker ports that are out of the os's ephemeral port range

* Limit even more on travis

* rkt deadline
2017-07-22 19:04:36 -07:00
Mark Mickan
e418b3e468 Add tests for migrating symlinks in alloc and local directories 2017-06-04 15:56:22 +09:30
Michael Schurter
10cb924b2c Refactor Consul Syncer into new ServiceClient
Fixes #2478 #2474 #1995 #2294

The new client only handles agent and task service advertisement. Server
discovery is mostly unchanged.

The Nomad client agent now handles all Consul operations instead of the
executor handling task related operations. When upgrading from an
earlier version of Nomad existing executors will be told to deregister
from Consul so that the Nomad agent can re-register the task's services
and checks.

Drivers - other than qemu - now support an Exec method for executing
abritrary commands in a task's environment. This is used to implement
script checks.

Interfaces are used extensively to avoid interacting with Consul in
tests that don't assert any Consul related behavior.
2017-04-19 12:42:47 -07:00
Michael Schurter
df30a110fb Create AssertUntil helper func 2017-04-06 17:05:09 -07:00
Michael Schurter
985bde83d6 Improve test timings
1234ms was far longer than needed and not sleeping between iterations
was just mean.
2017-04-06 11:10:36 -07:00
Michael Schurter
11206c7c3e Require TLS for server RPC when enabled
Fixes #2525

We used to be checking a RequireTLS field that was never set. Instead we
can just check the TLSConfig.EnableRPC field and require TLS if it's
enabled.

Added a few unfortunately slow integration tests to assert the intended
behavior of misconfigured RPC TLS.

Also disable a lot of noisy test logging when -v isn't specified.
2017-04-06 09:34:36 -07:00
Alex Dadgar
07f7e19578 Fix vet script and fix vet problems
This PR fixes our vet script and fixes all the missed vet changes.

It also fixes pointers being printed in `nomad stop <job>` and `nomad
node-status <node>`.
2017-02-27 16:00:19 -08:00
Alex Dadgar
6effacbf12 Docs 2017-02-17 10:16:15 -08:00
Alex Dadgar
43ab32f96c Tests compile 2017-02-07 21:30:57 -08:00
Alex Dadgar
8573ab9db0 fix test build 2017-01-23 11:26:34 -08:00
Alex Dadgar
8214cf08c9 Fix fingerprint tests 2017-01-08 13:53:27 -08:00
Alex Dadgar
bfc1d9c45f use helper 2017-01-05 13:19:01 -08:00
Alex Dadgar
de832069eb Fix TestClient_BlockedAllocations 2017-01-05 13:15:08 -08:00
Alex Dadgar
a44f7266c2 Fix SaveRestoreState 2017-01-05 12:32:44 -08:00
Diptanu Choudhury
9903a8c6df Fixed a test 2016-12-20 11:53:37 -08:00
Diptanu Choudhury
33e7d12d70 Setting the appropriate file permissions which un-archiving compressed alloc dir 2016-12-05 17:04:43 -08:00
Calle Pettersson
0be1a1fbf4 Add blacklisting of drivers 2016-11-08 18:30:07 +01:00
Calle Pettersson
2f2c5adb86 Add blacklisting of fingerprinters 2016-11-08 18:29:44 +01:00
Alex Dadgar
7daa4706a6 Tests 2016-10-11 13:28:18 -07:00
Diptanu Choudhury
612a16abc3 Fixing alloc runner tests 2016-09-04 19:09:08 -07:00
Alex Dadgar
4bae54741e Secret dir materialized in alloc/task directory 2016-09-02 12:44:05 -07:00
Alex Dadgar
335cababe1 Revert "Introduce a Secret/ directory" 2016-09-01 17:23:15 -07:00
Alex Dadgar
7f18d94976 Merge pull request #1671 from hashicorp/f-secret-dir2
Introduce a Secret/ directory
2016-09-01 09:56:17 -07:00
Alex Dadgar
0c050bd62b Symlink on windows 2016-08-31 21:41:44 -07:00
Alex Dadgar
0b07ef93c1 Address comments and reserve 2016-08-31 18:11:02 -07:00
vishalnayak
6b83d07070 VaultClient for Nomad Client 2016-08-24 09:43:45 -04:00
Diptanu Choudhury
025f3b424a blocking chained allocations until previous allocation hasn't terminated 2016-08-22 11:34:24 -05:00
Alex Dadgar
ba51037fd6 Nodes generate Secret ID and used for retrieving allocations and registering 2016-08-17 16:31:47 -07:00
vishalnayak
b3a1b98599 Disable Vault instead of supplying test token 2016-08-17 16:25:38 -07:00
vishalnayak
047310eb46 Fix a few client tests 2016-08-17 16:25:38 -07:00
Diptanu Choudhury
03c6692f98 Fixed some bugs 2016-07-25 17:26:38 -07:00
Sean Chittenden
572925a5fa Fix test for non-Linux platforms.
The following tests now check a whitelist for whether or not their
driver is present or not, or if the OS is supported or not.

* `TestAllocDir_MountSharedAlloc`
* `TestClient_Drivers_InWhitelist` (`exec` driver)
* `TestClient_Drivers` (`exec` driver)
* `TestJavaDriver_Fingerprint` (`java` driver)
2016-07-10 15:19:49 -07:00
Sean Chittenden
451c685f1c Provide nomad.Config with a default LogOutput of os.StdErr 2016-06-17 06:44:10 -07:00
Sean Chittenden
bcf0929c95 Pass a logger arg to NewClient and NewServer 2016-06-16 23:29:23 -07:00
Sean Chittenden
277592dd88 conf -> config 2016-06-16 17:05:29 -07:00
Sean Chittenden
3d32d20af8 Fix tests for NewServer() in client mode.
Pointy-hat: sean-

I'm positive I've done this before.
2016-06-16 16:34:22 -07:00
Sean Chittenden
54838b9eba Rename structs.Task's Service attribute to ConsulService 2016-06-10 15:54:39 -04:00
Sean Chittenden
57c2c819e8 Move package client/consul/sync to command/agent/consul.
This has been done to allow the Server and Client to reuse the same
Syncer because the Agent may be running Client, Server, or both
simultaneously and we only want one Syncer object alive in the agent.
2016-06-10 15:54:39 -04:00
Sean Chittenden
1352f7f0e6 Change client/consul.NewSyncer() to accept a shutdown channel
In addition to the API changing, consul.Syncer can now be signaled
to shutdown via the Shutdown() method, which will call the Run()'ing
sync task to exit gracefully.
2016-06-10 15:54:39 -04:00
Sean Chittenden
66dc946852 Don't clobber the default consul config in tests 2016-06-10 15:50:11 -04:00
Sean Chittenden
453a7556b6 Pick the right DefaultConfig from the right package.
Overly zealous search && replace at work here.
2016-06-10 15:50:11 -04:00
Sean Chittenden
ac174dbb6b Fix building tests that used DefaultConfig() but didn't pickup the package move. 2016-06-10 15:50:11 -04:00