Commit Graph

33 Commits

Author SHA1 Message Date
hashicorp-copywrite[bot] 005636afa0 [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
Lance Haig e89c3d3b36
Update ioutil library references to os and io respectively for e2e helper nomad (#16332)
No user facing changes so I assume no change log is required
2023-03-08 09:39:03 -06:00
Seth Hoenig 7214e21402
ci: swap freeport for portal in packages (#15661) 2023-01-03 11:25:20 -06:00
Seth Hoenig fc58f4972c cli: correctly use and validate job with vault token set
This PR fixes `job validate` to respect '-vault-token', '$VAULT_TOKEN',
'-vault-namespace' if set.
2022-05-19 12:13:34 -05:00
Charlie Voiselle 0473f35003
Fixup uses of `sanity` (#10187)
* Fixup uses of `sanity`
* Remove unnecessary comments.

These checks are better explained by earlier comments about
the context of the test. Per @tgross, moved the tests together
to better reinforce the overall shared context.

* Update nomad/fsm_test.go
2021-03-16 18:05:08 -04:00
Mahmood Ali 2ab54fe060 gracefully shutdown test server 2020-05-27 08:59:06 -04:00
Seth Hoenig f0c3dca49c tests: swap lib/freeport for tweaked helper/freeport
Copy the updated version of freeport (sdk/freeport), and tweak it for use
in Nomad tests. This means staying below port 10000 to avoid conflicts with
the lib/freeport that is still transitively used by the old version of
consul that we vendor. Also provide implementations to find ephemeral ports
of macOS and Windows environments.

Ports acquired through freeport are supposed to be returned to freeport,
which this change now also introduces. Many tests are modified to include
calls to a cleanup function for Server objects.

This should help quite a bit with some flakey tests, but not all of them.
Our port problems will not go away completely until we upgrade our vendor
version of consul. With Go modules, we'll probably do a 'replace' to swap
out other copies of freeport with the one now in 'nomad/helper/freeport'.
2019-12-09 08:37:32 -06:00
Michael Schurter d3650fb2cd test: build with mock_driver by default
`make release` and `make prerelease` set a `release` tag to disable
enabling the `mock_driver`
2018-04-18 14:45:33 -07:00
Oz Katz 1b3eaf70ae
Support custom Consul config for TestServer
Adds a Consul field to the TestServerConfig that allows passing in non-default values for e.g. consul address.
This will allow the TestServer to integrate with Consul's testutil/TestServer.
2018-04-04 01:40:11 +03:00
Alex Dadgar d498fa950a Remove fake advertise address and fix TestAPI_OperatorAutopilotServerHealth 2018-03-19 15:49:12 -07:00
Kyle Havlovitz 1c07066064 Add autopilot functionality based on Consul's autopilot 2017-12-18 14:29:41 -08:00
Alex Dadgar cb0d0ef009 move to consul freeport implementation 2017-10-23 16:51:40 -07:00
Chelsea Holland Komlo 09d340be23 fix access for health check 2017-09-15 22:57:31 +00:00
Armon Dadgar 1062637abd testutil: Allow enabling ACLs 2017-09-04 13:07:44 -07:00
Michael Schurter 5f1f91a46c Use go-testing-interface instead of testing
This drops the testings stdlib pkg from our dependencies. Saves a
whopping 46kb on our binary (was really hoping for more of a win there),
but also avoids potential ugliness with how testing sets flags.
2017-07-25 15:35:19 -07:00
Alex Dadgar 789751d84e Parallel 2017-07-21 16:33:04 -07:00
Alex Dadgar 7a958bdfdd Change testserver binary lookup 2017-04-04 14:45:29 -07:00
Michael Schurter a0d39ddd48 Advertise a non-loopback ip in tests 2016-11-14 14:42:59 -08:00
Alex Dadgar 416ed7692e Fix command tests that wait for client to be registered 2016-08-23 11:17:31 -07:00
Alex Dadgar 4bfdd40948 test fixes 2016-08-18 10:30:47 -07:00
Chris Hines 118d5f048d Make testutil.TestServer work correctly on Windows. 2015-12-01 12:16:21 -05:00
Chris Hines de3aa95511 Make golint happy. 2015-12-01 12:14:39 -05:00
Jeff Mitchell 959c175ca1 Update the location of cleanhttp 2015-10-22 14:21:07 -04:00
Jeff Mitchell cea5fd9081 Use cleanhttp for truly clean clients and transports. 2015-10-22 10:58:23 -04:00
Jeff Mitchell 50c2955f54 Remove usage of http.DefaultClient 2015-10-16 16:56:43 -04:00
Ryan Uber 041828f23e testutil: fix boostrap mode after flag change 2015-09-24 21:16:52 -07:00
Ryan Uber 8be2546b77 testutil: fix bootstrap on test server 2015-09-14 13:52:19 -07:00
Ryan Uber 086e1d9daa testutil: enable dev mode using a config flag.
This flag is not normally supported in Nomad, but we really need
to use it for testing to lower the timing values for registration
retries et. al. Instead of just enabling it on all tests, we
provide a bool flag in the config, which just makes the test
server pass the extra CLI arg when true.
2015-09-11 21:25:46 -07:00
Ryan Uber 6e10bd8af4 testutil: re-enable dev mode for short timing values 2015-09-11 20:50:08 -07:00
Ryan Uber 9ce9552a6b agent: test listener from config 2015-09-11 11:10:55 -07:00
Ryan Uber 02564caa70 testutil: test server uses offset ports 2015-09-10 18:57:53 -07:00
Ryan Uber 79b4db11e0 testutil: server uses dynamic ports 2015-09-09 21:43:11 -07:00
Armon Dadgar f91d735634 api: Adding basic skeleton 2015-09-06 13:29:51 -07:00