Commit Graph

562 Commits

Author SHA1 Message Date
Michael Klishin 8757b7e64f Introduce more alarm related broker helpers
Inspired by rabbitmq/rabbitmq-management#844.
2020-10-06 15:22:16 +03:00
Arnaud Cogoluègnes 34e5781eb9 Add stream TCP port to start broker 2020-09-30 16:33:28 +01:00
Michael Klishin 25cb487b5e Make it easy to close all connections on a node
from a test. HTTP API test suites would greatly benefit
from this.
2020-09-24 11:41:11 +03:00
Michael Klishin b6830f968d Introduce set_policy_in_vhost/{7,8} 2020-09-11 17:35:33 +03:00
Michael Klishin 4c15e493c1 Introduce rabbit_ct_helpers:await_condition/1 2020-08-30 18:13:18 +03:00
Ayanda-D c1fbc0b70d Add set_user_limits/{3,4} and clear_user_limits/{3,4} helpers 2020-08-30 18:11:16 +03:00
Ayanda-D 243255b8ab Add forget_cluster_node/{3,4} broker helper 2020-08-30 18:11:15 +03:00
Luke Bakken 48e448ce2e Update rabbitmq-components.mk 2020-08-04 08:41:47 -07:00
Jean-Sébastien Pédron 7903a69836 Update rabbitmq-components.mk 2020-07-30 12:06:52 +02:00
Luke Bakken c34dab4a38 Update rabbitmq-components.mk 2020-07-29 10:02:02 -07:00
Jean-Sébastien Pédron e97357c8f4 tools/terraform: Use Debian package for Erlang 23
We don't need to compile it from sources anymore.
2020-07-24 19:42:36 +02:00
Jean-Sébastien Pédron e73523d456 tools/terraform: Switch to m5.large instance type by default
The m4.large could build Erlang and the testsuite could run in 28
minutes. That's an improvment, but we are still close to the limit.

Rather than bump the limit, try with an m5.large. It's also a bit
cheaper to my surprise.
2020-07-23 11:26:13 +02:00
Jean-Sébastien Pédron 7cfca2e57b rabbit_ct_broker_helpers: Remove trailing whitespaces 2020-07-23 10:34:18 +02:00
Jean-Sébastien Pédron aae024f958 tools/terraform: Switch to m4.large instance type by default
The previous default of t2.micro was insufficient to compile Erlang from
sources in under 30 minutes. This caused the integration testsuite to
timeout.

Hopefully an m4.large instance type will be enough.
2020-07-23 10:34:03 +02:00
Michael Klishin 769a24cfa5 Merge branch 'rabbitmq-server-2321' 2020-07-21 23:46:52 +03:00
Luke Bakken 5df63198b4 Explicitly add `master` to work around ninenines/erlang.mk#898 2020-07-21 09:13:39 -07:00
dcorbacho 44a8f953bb Update erlang.mk 2020-07-21 14:32:14 +01:00
Michael Klishin 4730b6d933 Update rabbitmq-components.mk 2020-07-21 13:12:46 +03:00
Michael Klishin 52b8a3f909 Update rabbitmq-components.mk 2020-07-21 03:42:52 +03:00
dcorbacho 809741f367 Revert drop of Exhibit B on MPL 2.0 2020-07-20 16:58:33 +01:00
Michael Klishin 33bb90bccc Update MPL2 license file, drop Exhibit B
and add a VMware copyright notice.

We did not mean to make this code Incompatible with Secondary Licenses
as defined in [1].

1. https://www.mozilla.org/en-US/MPL/2.0/FAQ/
2020-07-17 14:53:07 +03:00
Gerhard Lazu 639a2e76ef Add more logging and verify inet_tcp_proxy_dist return values
This is sometimes failing in GitHub Actions and we don't know why:
https://github.com/rabbitmq/rabbitmq-server/runs/877118328?check_suite_focus=true#step:6:6099

We confirmed in the logs that only 1 out of 3 nodes get unblocked. The
CT suite hits the 15 minute time trap and fails. We don't know whether
this rpc call doesn't make it through to the first or second node, or if
it does and the rpc call simply doesn't return within the time window.
We can't address this if we don't know where the problem lies, so this
will give us more insight when it fails again.

Signed-off-by: Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com>
2020-07-16 17:44:47 +01:00
dcorbacho 3c9ce68ef8 Switch to Mozilla Public License 2.0 (MPL 2.0) 2020-07-11 19:56:11 +01:00
Michael Klishin 55529859eb More maintenance mode helpers 2020-07-09 09:57:10 +03:00
Michael Klishin 56a87dcd5a A typo 2020-07-09 09:57:10 +03:00
Michael Klishin b30e86b93d More maintenance mode-related functions 2020-07-09 09:57:09 +03:00
Michael Klishin dbfd401668 Node maintenance mode helpers for rabbitmq/rabbitmq-server#2321 2020-07-09 09:57:09 +03:00
Philip Kuryloski 0236c64ace Reduce chances of variable capture in ?awaitMatch
Attempt to name all of the variables in the macro such that they are less
likely to collide with any existing bindings.
2020-07-06 12:08:23 +02:00
Philip Kuryloski 9479c2e9cc Add ?awaitMatch macro
awaitMatch(Guard, Expr, Timeout) reevaluates Expr until it matches
Guard up to Timeout milliseconds from now. It returns the matched
value, in the event said value is useful later in a test.

Additionally simplify an instance of ?assertEqual(true, ... to ?assert(
2020-07-02 11:33:17 +02:00
Jean-Sébastien Pédron d930d0ea84 Update erlang.mk 2020-06-23 17:13:47 +02:00
Michael Klishin b455417b48 Bump Recon to 2.5.1
for Erlang 23 compatibility of 'rabbitmq-diagnostics observer'

References zhongwencool/observer_cli#68.
2020-06-09 08:22:14 +03:00
Jean-Sébastien Pédron d6fd834e91 tools/terraform: Add support for Erlang 24 (Git master) 2020-05-15 14:37:30 +02:00
Jean-Sébastien Pédron 1804aff244 rabbit_ct_helpers: `fail_if_no_peer_cert` must be false if `verify` set to `verify_none`
Erlang Git master started to report the combination of
verify=none/fail_if_no_peer_cert=true as incompatible options.
2020-05-15 11:49:36 +02:00
Jean-Sébastien Pédron 5cdfb280de rabbit_ct_broker_helpers: Override node name in stop_rabbitmq_node()
... if it changed compared to the one passed to start-background-broker.
2020-05-06 17:55:24 +02:00
Jean-Sébastien Pédron 9b2be8340d rabbit_ct_broker_helpers: Use same make(1) vars for node start & stop
This fixes an issue when a node was starting from the secondary
Umbrella, but stopped from the primary one.
2020-05-06 16:35:35 +02:00
Jean-Sébastien Pédron 3469b98d25 rabbit_ct_broker_helpers: Skip build only if starting node from cwd
`make test-dist` was already executed for project being tested,
therefore we can skip the build to save time when a RabbitMQ node is
started from there.

However, if the node is to be started from another place (i.e. `rabbit`
when plugins are disabled), we must not skip the build because the
project might have no .ez. files created at this point.
2020-05-04 18:35:46 +02:00
Gerhard Lazu edbdd2229f Revert nodes clustering in parallel
This reverts part of
dc5a04a503
because tests started failing in GitHub Actions with:

    2020-04-30 16:38:32.238 [error] <0.228.0> Supervisor inet_tcp_proxy_dist_conn_sup had child
                                              {undefined,false,#Ref<0.301488671.524812289.157484>}
                                              started with
                                              {inet_tcp_proxy_dist,dist_proc_start_link,undefined} at <0.776.0>
                                              exit with reason net_tick_timeout in context child_terminated

We suspect that this is due to CPU contention on GitHub Actions shared runners.
When 5 Erlang VM nodes with 2 schedulers each start at the same time on a
host with 2 CPUs and then try to cluster via rabbitmqctl (which starts
5 more Erlang VMs), the 5 second net_tick_time is not long enough.
Rather than increasing the net_tick_time, we are choosing to put less
pressure on the host by clustering nodes one-by-one rather than all at
once.

Pair @dumbbell

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-04-30 18:39:50 +01:00
Philip Kuryloski 4b4dd1b212 Add the option for a timeout in rabbit_ct_helpers:exec
So now there is exec/3 with an infinite default timeout, and exec/4 with a millisecond timeout. Also applies to rabbit_ct_broker_helpers:rabbitmqctl.
2020-04-29 16:23:05 +02:00
dcorbacho a57b3a8561 Increase vhost failure retries
It should solve the flaky tests where vhosts cannot be made to fail
2020-04-27 17:22:34 +01:00
Jean-Sébastien Pédron 8e8dd045e5 Update erlang.mk 2020-04-21 16:18:07 +02:00
Jean-Sébastien Pédron 8bf8640695 rabbit_ct_broker_helpers: Call `make stop-node` directly
I don't remember why I used `stop-rabbit-on-node` then `stop-node`. But
this was two CLI runs which costed a lot in time.

Now, `stop-node` does not use the CLI anymore and getting rid of
`stop-rabbit-on-node` reduces the number of CLI runs to 0, improving the
time it takes to stop RabbitMQ significantly: it shaved about 1 second,
giving a stop time of about 3 seconds now on my laptop.
2020-04-21 15:36:05 +02:00
Jean-Sébastien Pédron dc5a04a503 rabbit_ct_broker_helpers: nodes clustering in parallel
We were already starting nodes in parallel, but they were clustered one
by one. Now, clustering happens in parallel as well to speed things up a
bit.
2020-04-21 15:34:48 +02:00
Jean-Sébastien Pédron 4e7d737bd1 rabbit_ct_broker_helpers: Use new inet_tcp_proxy_dist API
See rabbitmq/inet_tcp_proxy#3.
2020-04-15 13:19:56 +02:00
Jean-Sébastien Pédron 5c0003e5a4 tools/terraform: Fix warnings reported by Terraform 0.12.x 2020-04-14 12:47:03 +02:00
Michael Klishin 5b7c20fa7d Add more minors to erlang_version_to_system
we list all 23.x minors for forward compatibility.
When a release is missing from this map,
test suites that start VMs for their test begin
failing.
2020-04-13 10:25:07 +03:00
Michael Klishin 3fedafc797 Introduce rabbit_ct_helpers:await_condition/2 and await_condition_with_retries/2
For cases where a condition can materialize eventually but
we do not know when exactly since we have to observe it from
the outside.

E.g. a cluster of nodes can be formed in a second or two, there's
a randomized delay on startup involved by design.
2020-03-31 19:10:48 +03:00
Jean-Sébastien Pédron b3caf2daff rabbit_ct_broker_helpers: Stop node if start-background-broker failed
If the `start-background-broker` recipe fails, it is possible that the
node was started but the follow-up wait/status failed.

To not let a, unused node around, we try to stop it in case of a failure
and ignore the result of that stop recipe.

This situation happened in CI where Elixir seems to crash (one of the
two CLI commands we run after starting the node):

    Logger - error: {removed_failing_handler,'Elixir.Logger'}
    Logger - error: {removed_failing_handler,'Elixir.Logger'}
    Logger - error: {removed_failing_handler,'Elixir.Logger'}
    escript: exception error: undefined function 'Elixir.Exception':blame/3
      in function  'Elixir.Kernel.CLI':format_error/3 (lib/kernel/cli.ex, line 82)
      in call from 'Elixir.Kernel.CLI':print_error/3 (lib/kernel/cli.ex, line 173)
      in call from 'Elixir.Kernel.CLI':exec_fun/2 (lib/kernel/cli.ex, line 150)
      in call from 'Elixir.Kernel.CLI':run/1 (lib/kernel/cli.ex, line 47)
      in call from escript:run/2 (escript.erl, line 758)
      in call from escript:start/1 (escript.erl, line 277)
      in call from init:start_em/1
    .../rabbit_common/mk/rabbitmq-run.mk:323: recipe for target 'start-background-broker' failed

In this case, rabbit_ct_broker_helpers tried again to start the node and
it worked. But it affected an unrelated testcase later because it tried
to use a TCP port already used by that left-over node.
2020-03-25 11:14:56 +01:00
Jean-Sébastien Pédron f1d31c9620 rabbit_ct_broker_helpers: Fix indentation 2020-03-25 11:14:38 +01:00
Jean-Sébastien Pédron 78c0bfcce4 rabbit_ct_broker_helpers: Do not rebuild RabbitMQ when starting a node
rabbitmq_ct_helpers ensures everything is built earlier, so no need to
try again. This saves a bit of time and hopefully fixes a few
situations where RabbitMQ is recompiled without test code.
2020-03-23 14:50:07 +01:00
Michael Klishin 19feb846ea rabbit_ct_broker_helpers: introduce reset_node/2, force_reset_node/2
Pair: @dumbbell.
2020-03-16 12:20:54 +03:00
Michael Klishin 925fbfb42f Introduce rabbit_ct_broker_helpers:cluster_members_online/2 2020-03-13 19:21:40 +03:00
Jean-Sébastien Pédron f5803765bd Update copyright (year 2020) 2020-03-10 16:08:50 +01:00
Gerhard Lazu d88ce08b16 Update rabbitmq-components.mk 2020-03-06 09:19:15 +00:00
Gerhard Lazu 54d5aa3f55 Update erlang.mk 2020-03-06 09:17:34 +00:00
Gerhard Lazu 55f75ecd14 Update rabbitmq-components.mk 2020-02-11 15:31:43 +00:00
Luke Bakken 86b9260b02 Add function head to get static content
By specifying `get_static` as the `Type` the `api/` part of the URI will not be added.

Part of rabbitmq/rabbitmq-management#767
2020-01-31 22:28:52 +00:00
Michael Klishin 400ee90e6e Introduce rabbit_ct_broker_helpers:set_vhost_limit/5 2020-01-15 03:58:16 +03:00
Michael Klishin ad24f90093 (c) bump 2019-12-29 05:50:27 +03:00
Jean-Sébastien Pédron bab1b180c7 Git: Ignore copied CLI 2019-12-12 13:28:27 +01:00
Jean-Sébastien Pédron faef528b59 Update rabbitmq-components.mk 2019-12-12 13:14:53 +01:00
Jean-Sébastien Pédron 60e1bd59ff Set `$RABBITMQ_SCRIPTS_DIR` when calling CLI
This helps in situations where rabbitmq-env guesses it wrong. I saw this
situation in the `feature_flags_SUITE` testsuite of rabbitmq-server, but
couldn't really explain why the guess was wrong.
2019-12-05 15:55:29 +01:00
Jean-Sébastien Pédron e2924bd76c rabbit_ct_broker_helpers: Run `make test-dist` first
It needs to happen before we check for the CLI scripts: they are now
"built" with make(1).
2019-12-04 17:55:35 +01:00
Jean-Sébastien Pédron 762f4bc497 rabbit_ct_broker_helpers: Bump node start wait timeout to 3 minutes 2019-12-04 17:55:35 +01:00
Jean-Sébastien Pédron 821e8d646a rabbit_ct_broker_helpers: Set `$RABBITMQ_KEEP_PID_FILE_ON_EXIT`
... if requested.
2019-12-04 17:55:35 +01:00
Jean-Sébastien Pédron fbabb45ec6 rabbit_ct_broker_helpers: Enable debug logging for rabbitmq_prelaunch 2019-12-04 17:55:34 +01:00
Jean-Sébastien Pédron cbfb11efe6 rabbit_ct_config_schema: Use rabbitmq_prelaunch_conf to generate conf
The generated config is not written to disk anymore. Likewise, schema
files are not copied.
2019-12-04 17:55:34 +01:00
Jean-Sébastien Pédron a1b30b63b2 rabbit_ct_helpers, rabbit_ct_broker_helpers: Scripts are in the plugin being tested
No need to look up the `rabbit` app, no more special cases.
2019-12-04 17:55:34 +01:00
Jean-Sébastien Pédron 96ed917aad rabbit_ct_broker_helpers: Use PowerShell to kill a process on Windows
At least on the Windows Server 2019 AWS EC2 image, the `taskkill`
command is unavailable.

If that's the case, we fallback to using a PowerShell oneliner. It's not
the default, just in case PowerShell is unavailable.
2019-12-04 17:55:34 +01:00
Jean-Sébastien Pédron b98db3de14 rabbit_ct_helpers: Find Elixir in the module
... instead of relying on a pre-populated `$ERL_LIBS` variable.
2019-12-02 18:55:17 +01:00
Jean-Sébastien Pédron e354b1e95d rabbit_ct_broker_helpers: Prepend regular plugins dir to `rmq_plugins_dir`
`rmp_plugins_dir` is set by testsuites to indicate an extra plugins
directory now (instead of the full value of `$RABBITMQ_PLUGINS_DIR`).

This helps when we are using a secondary Umbrella: the testsuite does
not have to mess with the computation of the regular plugins directory.
2019-11-27 19:38:54 +01:00
Jean-Sébastien Pédron b7f4134066 rabbit_ct_broker_helpers: Use rabbit_channel:start_link/11 again
It was restored in rabbitmq-server's master branch to allow backward
compatibility. Therefore now, the same call works with the master branch
and supported release branches (v3.7.x, v3.8.x).
2019-11-26 12:20:20 +01:00
Michael Klishin b143134ad8 Adapt test_channel/0 to rabbitmq/rabbitmq-server#2169
Part of rabbitmq/rabbitmq-server#2168.
2019-11-26 04:40:35 +03:00
Luke Bakken a278ef4659 Allow setting content-type header
If the passed-in headers includes `content-type`, use that for the request

Fixes rabbitmq/rabbitmq-management#739
2019-10-01 09:52:58 -07:00
Luke Bakken b28ca7019e Do not use deprecated configuration value
`listener` is deprecated, use `tcp_config` instead.

See rabbitmq/rabbitmq-management-exchange#8 as well
2019-09-26 16:43:31 -07:00
Jean-Sébastien Pédron ee153868df tools/terraform: Erlang 22 is available on Debian Stretch 2019-09-19 14:41:12 +02:00
Jean-Sébastien Pédron 3e75fe17f2 rabbit_ct_helpers: Attempt at supporting Unicode command output 2019-09-16 11:04:40 +02:00
Jean-Sébastien Pédron de6b7ab2e7 rabbit_ct_broker_helpers: Remove debug log message 2019-09-16 11:04:17 +02:00
kjnilsson 3114de12f9 Update rabbitmq-components.mk 2019-09-13 10:24:18 +01:00
Jean-Sébastien Pédron 1fc32d3408 rabbit_ct_broker_helpers: Support Windows in kill_node()
We use `taskkill.exe` there.
2019-09-10 13:31:32 +02:00
kjnilsson d3451c7734 Update rabbitmq-components.mk 2019-09-04 10:30:55 +01:00
Jean-Sébastien Pédron a96bc7424c rabbit_ct_broker_helpers: Ensure the generated config file is Unicode
This is in case it contains Unicode paths.
2019-09-02 10:20:33 +02:00
Jean-Sébastien Pédron e00e96370d rabbit_ct_helpers: Convert command to exec & its args to Unicode binary
... instead of keeping it as strings. It helps when the path of the
command or an argument contain non-US-ASCII characters.
2019-09-02 10:19:24 +02:00
Jean-Sébastien Pédron cb8799d8c8 rabbit_ct_helpers: Don't create symlink on Windows
NTFS supports symlinks, but not FAT32. Anyway, this is not the most
useful feature, so let's go the easy path and just disable it on
Windows.
2019-08-30 15:17:44 +02:00
Jean-Sébastien Pédron cb815f357b Update erlang.mk 2019-08-29 20:45:02 +02:00
Michael Klishin b0746aae8c assert_item/2: use ?assertEqual instead of matching 2019-08-15 16:54:08 +10:00
Michael Klishin df9a700c8e Config snippet tests: log output file paths 2019-08-11 13:30:10 +10:00
Michael Klishin fe063a2a1f Update rabbitmq-components.mk 2019-08-11 01:47:52 +10:00
Gerhard Lazu e22fd7d546 Add helper function that doesn't send an authentication header 2019-08-08 18:19:24 +01:00
Jean-Sébastien Pédron 01bf8da0f8 Update erlang.mk 2019-08-02 09:53:45 +02:00
Michael Klishin f1a0daa319 Update rabbitmq-components.mk 2019-08-01 17:13:13 +03:00
Arnaud Cogoluègnes db935a1261 Update rabbitmq-components.mk 2019-07-09 16:05:54 +02:00
Jean-Sébastien Pédron 903254c35d Update rabbitmq-components.mk 2019-06-28 16:05:28 +02:00
Jean-Sébastien Pédron 250de8fdfd Update erlang.mk 2019-06-28 16:01:56 +02:00
Jean-Sébastien Pédron dbcd95aed7 tools/terraform: Use Debian Stretch to test against Erlang 23 2019-06-11 13:36:18 +02:00
Jean-Sébastien Pédron f1115f8d37 tools/terraform: Adapt lists to Terraform 0.12.x, take #2
The definition of the `security_groups` variable in the `direct-vms`
module was incorrect. This may explain the error seen in CI. No idea why
the same error didn't appear locally though.
2019-06-11 10:12:00 +02:00
Jean-Sébastien Pédron fc081f7ca9 tools/terraform: Use our own Erlang packages
Erlang Solutions repository appears to be broken again at the time of
this commit.
2019-06-06 16:54:57 +02:00
Jean-Sébastien Pédron 1ffd59f877 tools/terraform: Fix missing `erlang_git_ref` variable definition 2019-06-06 16:54:22 +02:00
Jean-Sébastien Pédron f7ff8d61a4 rabbit_ct_vm_helpers: Update Terraform map parsing
... to be compatible with Terraform 0.12.x.
2019-06-06 16:53:40 +02:00
Jean-Sébastien Pédron bbd058f12a tools/terraform: Adapt to Terraform 0.12.x 2019-06-06 15:09:07 +02:00
Gerhard Lazu 28a344a7f8 Update rabbitmq-components.mk 2019-06-03 02:23:35 +01:00
Jean-Sébastien Pédron 25b8bffff2 Update rabbitmq-components.mk 2019-05-17 15:17:16 +02:00
Michael Klishin 46fddefd46 Update rabbitmq-components.mk 2019-05-17 08:36:33 +03:00
Michael Klishin e62d58f2e8 Update rabbitmq-components.mk 2019-05-16 23:22:47 +03:00
Michael Klishin 135c73e8be tools/terraform: provision Erlang 22 via Debian packages (now that it is GA) 2019-05-16 20:01:41 +03:00
Michael Klishin 12ac29b394 Update rabbitmq-components.mk 2019-05-14 11:50:44 +03:00
Michael Klishin 4581dec00b Update rabbitmq-components.mk 2019-05-13 16:40:29 +03:00
Gerhard Lazu 85edc8fce3 Update rabbitmq-components.mk 2019-05-01 13:18:11 +01:00
Luke Bakken 1ecf48ab80 Update rabbitmq-components.mk 2019-04-30 16:20:55 -07:00
Jean-Sébastien Pédron 799268257e Update rabbitmq-components.mk 2019-04-30 14:47:28 +02:00
Gerhard Lazu 6eb1f78d79 Update rabbitmq-components.mk 2019-04-22 21:55:02 +01:00
Jean-Sébastien Pédron 6c5707865a tools/terraform: Use precompiled Elixir when using Erlang 22
With Erlang 22, Elixir fails to compile, so use the precompiled archive.
2019-04-15 15:54:09 +02:00
Jean-Sébastien Pédron d486037e73 tools/terraform: Fix use of `$elixir_version` in setup-erlang.sh
The variable is declared as read-only, but we overwrite it erroneously
in `kiex_install_elixir`. In this function, we didn't intend to use the
global variable, so let's rename the local variable to
`$latest_elixir_version`.
2019-04-15 13:53:40 +02:00
Jean-Sébastien Pédron 1835cfc02b rabbit_ct_vm_helpers: Bump CT peers wait from 20 to 40 minutes
Let's give more time for Erlang to compile from source.
2019-04-15 13:13:34 +02:00
Michael Klishin eee5aaf522 Merge pull request #31 from spring-operator/polish-urls-apache-license-master
URL Cleanup
2019-03-29 02:16:51 +03:00
Michael Klishin 1b60f69aa4 Start integration test nodes with 24 I/O threads
instead of the default 128.
2019-03-28 20:04:19 +03:00
Jean-Sébastien Pédron 7467846dee rabbit_ct_broker_helpers: Limit Erlang VM to two schedulers
The idea is to reduce the load when testing RabbitMQ. It is especially
useful in CI where we might run multiple testsuites in parallel in
different containers.

The value of "2" is currently hard-coded.

At the same time, we change the "scheduler busy wait time" parameter to
"very_short" so thay unused schedulers are put to sleep quickly.

Discussed with: @michaelklishin @gerhard
2019-03-28 14:50:50 +01:00
Spring Operator 28a156a72e URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 1 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-21 02:54:27 -05:00
Jean-Sébastien Pédron ec92c3ead3 Revert part of "URL Cleanup"
* `rabbit_ct_vm_helpers.erl`: Switching to HTTPS broke the test
  framework. We don't setup the remote HTTP server with certificates and
  we totally do not care at all about making this connection secure.
* `erlang.mk` is a generated file: there is no point in changing URLs
  because that change will be lost with the next update of the file.
  Furthermore, it makes it more difficult to track changes compared to
  upstream.

This reverts part of commit 70428fb0d0.
2019-03-20 14:12:37 +01:00
Jean-Sébastien Pédron 052f90175c tools/terraform: Add Erlang 21.3 support 2019-03-20 11:48:26 +01:00
Spring Operator 70428fb0d0 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://blog.listincomprehension.com/search/label/procket (200) with 1 occurrences could not be migrated:
   ([https](https://blog.listincomprehension.com/search/label/procket) result ClosedChannelException).
* http://dozzie.jarowit.net/trac/wiki/TOML (200) with 1 occurrences could not be migrated:
   ([https](https://dozzie.jarowit.net/trac/wiki/TOML) result SSLHandshakeException).
* http://dozzie.jarowit.net/trac/wiki/subproc (200) with 1 occurrences could not be migrated:
   ([https](https://dozzie.jarowit.net/trac/wiki/subproc) result SSLHandshakeException).
* http://e2project.org (200) with 1 occurrences could not be migrated:
   ([https](https://e2project.org) result AnnotatedConnectException).
* http://nitrogenproject.com/ (200) with 2 occurrences could not be migrated:
   ([https](https://nitrogenproject.com/) result ConnectTimeoutException).
* http://proper.softlab.ntua.gr (200) with 1 occurrences could not be migrated:
   ([https](https://proper.softlab.ntua.gr) result SSLHandshakeException).
* http://yaws.hyber.org (200) with 1 occurrences could not be migrated:
   ([https](https://yaws.hyber.org) result AnnotatedConnectException).
* http://choven.ca (503) with 1 occurrences could not be migrated:
   ([https](https://choven.ca) result ConnectTimeoutException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* http://fixprotocol.org/ (301) with 1 occurrences migrated to:
  https://fixtrading.org ([https](https://fixprotocol.org/) result SSLHandshakeException).
* http://erldb.org (UnknownHostException) with 1 occurrences migrated to:
  https://erldb.org ([https](https://erldb.org) result UnknownHostException).
* http://~s:~b/~s (UnknownHostException) with 1 occurrences migrated to:
  https://~s:~b/~s ([https](https://~s:~b/~s) result UnknownHostException).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://cloudi.org/ with 27 occurrences migrated to:
  https://cloudi.org/ ([https](https://cloudi.org/) result 200).
* http://erlware.org/ with 1 occurrences migrated to:
  https://erlware.org/ ([https](https://erlware.org/) result 200).
* http://inaka.github.io/cowboy-trails/ with 1 occurrences migrated to:
  https://inaka.github.io/cowboy-trails/ ([https](https://inaka.github.io/cowboy-trails/) result 200).
* http://ninenines.eu with 6 occurrences migrated to:
  https://ninenines.eu ([https](https://ninenines.eu) result 200).
* http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html with 1 occurrences migrated to:
  https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html ([https](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) result 200).
* http://www.actordb.com/ with 2 occurrences migrated to:
  https://www.actordb.com/ ([https](https://www.actordb.com/) result 200).
* http://www.cs.kent.ac.uk/projects/wrangler/Home.html with 1 occurrences migrated to:
  https://www.cs.kent.ac.uk/projects/wrangler/Home.html ([https](https://www.cs.kent.ac.uk/projects/wrangler/Home.html) result 200).
* http://www.rebar3.org with 1 occurrences migrated to:
  https://www.rebar3.org ([https](https://www.rebar3.org) result 200).
* http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* http://inaka.github.com/apns4erl with 1 occurrences migrated to:
  https://inaka.github.com/apns4erl ([https](https://inaka.github.com/apns4erl) result 301).
* http://inaka.github.com/edis/ with 1 occurrences migrated to:
  https://inaka.github.com/edis/ ([https](https://inaka.github.com/edis/) result 301).
* http://lasp-lang.org/ with 1 occurrences migrated to:
  https://lasp-lang.org/ ([https](https://lasp-lang.org/) result 301).
* http://saleyn.github.com/erlexec with 1 occurrences migrated to:
  https://saleyn.github.com/erlexec ([https](https://saleyn.github.com/erlexec) result 301).
* http://www.mozilla.org/MPL/ with 9 occurrences migrated to:
  https://www.mozilla.org/MPL/ ([https](https://www.mozilla.org/MPL/) result 301).
* http://zhongwencool.github.io/observer_cli with 1 occurrences migrated to:
  https://zhongwencool.github.io/observer_cli ([https](https://zhongwencool.github.io/observer_cli) result 301).

# Ignored
These URLs were intentionally ignored.

* http://localhost:~w~s/~s with 1 occurrences
2019-03-20 03:14:12 -05:00
Michael Klishin db8b114b2a exec: trim command name/path
PATH discovery and some callers seem to be appending a trailing
newline character.
2019-03-17 05:45:52 +03:00
Michael Klishin 588405e0a4 Update rabbitmq-components.mk 2019-03-15 05:32:52 +03:00
Michael Klishin 6223b0117a Update rabbitmq-components.mk 2019-03-15 05:05:41 +03:00
Jean-Sébastien Pédron 2852931834 rabbit_ct_broker_helpers: Allow to set `$RABBITMQ_PLUGINS_DIR`
... and to start a broker with plugins disabled.
2019-03-01 15:57:52 +01:00
Jean-Sébastien Pédron b9657e4f8e rabbit_ct_broker_helpers: Don't set secondary Umbrella env. if it's not configured
Before this patch, we were always setting the secondary
Umbrella-specific environment variables (like `DEPS_DIR` and paths to
`rabbitmq*` scripts) based on the number of the node, regardless of the
fact that a secondary Umbrella was configured or not.

This was fine when used inside an Umbrella becase the computed paths
were working by chance. However, when using a standalone clone of
rabbitmq-server, the computed paths to `rabbitmq*` paths were incorrect,
leading to the odd-numbered nodes to fail to start.

The fix is easy: do not set the secondary Umbrella-specific environment
variables when there is none configured.
2019-02-28 11:12:12 +01:00
Michael Klishin 9aea3400c1 Merge pull request #27 from rabbitmq/rabbitmq-queues-helpers
Helpers for rabbitmq-queues cli tool
2019-02-21 01:12:19 +03:00
Michael Klishin fbc45aad27 Log exec failures with regular importance; a typo 2019-02-21 01:08:09 +03:00
kjnilsson f249924d79 Helpers for rabbitmq-queues cli tool
[#162782801]
2019-02-20 11:35:30 +00:00
Ayanda Dube f11fb09e97 rabbit_ct_broker_helpers: export test_writer/1 and user/1
reference: rabbitmq-server#1886
2019-02-18 11:37:21 +01:00
Jean-Sébastien Pédron adddca136a rabbit_ct_broker_helpers: Add helpers to manage feature flags
It's now possible to chec kif a feature flag is supported from a
testsuite and enable it.
2019-02-13 15:16:38 +01:00
Michael Klishin 5e65005531 Update rabbitmq-components.mk 2019-02-12 23:23:51 +03:00
Jean-Sébastien Pédron bbe32a859d rabbit_ct_broker_helpers: Don't expect to get a path to `enabled_feature_flags_file`
... from a RabbitMQ 3.7.x node.

So if we get an `undef` exception from the queried node, we assume there
is no feature flag file and we don't set it in `rabbitmqctl` commands
targetting that node.
2019-02-07 16:34:20 +01:00
Jean-Sébastien Pédron 86fec76ff5 rabbit_ct_broker_helpers: Only push specific paths to the remote node
... when we want to execute code on the RabbitMQ node (as opposed to the
Common Test node).

The accepted paths are the one in `rabbitmq_ct_helpers` and
`rabbitmq_ct_client_helpers`, as well as the `test` directory (if the
module is inside a testsuite).

This should fix the situation where we push the path to
`deps/rabbit/ebin` from the main Umbrella to a node running from the
secondary Umbrella.
2019-02-07 16:31:37 +01:00
Jean-Sébastien Pédron fe6cc14e5f rabbit_ct_broker_helpers: Set `$RABBITMQ_FEATURE_FLAGS_FILE` when running rabbitmqctl(8)
Otherwise the tool might not find the actual list of enabled feature
flags and thus, the command might not run as expected.

[#160169569]
2019-02-02 01:32:18 +01:00
Jean-Sébastien Pédron 9ceb0e32b0 rabbit_ct_broker_helpers: Override paths to RabbitMQ scripts
... for the secondary Umbrella.

I couldn't find a way with GNU Make to undefined variables on the
command line, so that the internal default values are used. Therefore,
we need to explicitely set their value so that the one from the parent
make(1) instance is not passed to the child instance.
2019-01-28 13:39:32 +01:00
Jean-Sébastien Pédron 6ddb5ffc2e rabbit_ct_broker_helpers: Pass secondary Umbrella variables as make(1) vars
... not environment variables.

The latter does not work in if the parent make(1) instance already has
those variables (e.g. `$DEPS_DIR`) as make variables on the command
because they are passed to children as make variables which have
precedence over environment variables.
2019-01-28 11:44:24 +01:00
Jean-Sébastien Pédron 8a43cf71a2 rabbit_ct_broker_helpers: Move `get_queue_sup_pid()` to rabbitmq-server
This is the only place this function is used and this removes a
dependency cycle: rabbit_ct_broker_helpers can't depend on the broker:
the broker already depends on it as a test dependency.

[#159298729]
2019-01-24 14:15:37 +01:00
Luke Bakken 13703da5c0 Update rabbitmq-components.mk 2019-01-09 12:55:00 -08:00
Luke Bakken 4892fcc1f6 Update rabbitmq-components.mk 2019-01-08 11:58:26 -08:00
Jean-Sébastien Pédron 6f319cde89 rabbit_ct_helpers: Put a space between application name and "source"
Otherwise, we end up with a malformed error message like:
  "rabbitsource directory required"
... instead of:
  "rabbit source directory required"
2019-01-02 12:45:46 +01:00
Jean-Sébastien Pédron 107584f7c0 rabbit_ct_helpers: Always use primary app path when there is no secondary Umbrella
Before, we were relying on the `secondary_erlang_mk_depsdir` config key
value to compute the secondary path of an application. When there is no
secondary Umbrella configured, the computed value was based on the
primary `deps` dir.

However, when the caller asks for the currently tested app, we might not
be in an Umbrella at all: it's perfectly fine to e.g. clone the
application alone and test it. In this case, the computed value would
point to a non-existing directory (e.g. rabbitmq-server/deps/rabbit).

So instead of relying on the default secondary Umbrella when there is
none configured, we directly check if there is one configured. If there
is none, the secondary path for the application is set to the primary
path. This way, we are sure the directory exists and is correct, no
matter how the project was cloned.

Fixes #24.
2019-01-02 12:40:22 +01:00
Michael Klishin ecdb3e4da7 Use ESL packages for Erlang 21.1 and 21.2 2018-12-24 20:30:10 +03:00
Michael Klishin e180f545c1 Terraform variables: list Erlang 21.1 and 21.2 2018-12-24 20:27:49 +03:00
Michael Klishin 762d7c5e4d Snippet verification: print pre-sorted values, too 2018-12-11 21:57:36 +03:00
Michael Klishin dbab537fdf Update rabbitmq-components.mk 2018-12-06 18:28:44 +03:00
Michael Klishin 07b03948fc Update rabbitmq-components.mk 2018-12-06 03:15:10 +03:00
kjnilsson 994a7d9178 Remove inet_tcp_proxy modules
And replace them with a dependency on inet_tcp_proxy
2018-12-05 13:53:55 +00:00
kjnilsson 52812fbb31 license files 2018-12-05 13:02:04 +00:00
Jean-Sébastien Pédron 1a97b8a2c6 Update rabbitmq-components.mk 2018-11-30 14:56:48 +01:00
Jean-Sébastien Pédron 63e0cf5b96 Update rabbitmq-components.mk 2018-11-22 09:19:33 +01:00
kjnilsson 6bcf66fdc6 Update rabbitmq-components.mk 2018-10-29 12:43:17 +00:00
Jean-Sébastien Pédron 56547be336 rabbit_ct_broker_helpers: Add ability to use a secondary Umbrella
... to start two different versions of RabbitMQ.

The codebase where the testsuite is executed is used to start even
RabbitMQ nodes (counting from 0) and the secondary Umbrella is used to
start odd RabbitMQ nodes.

This should help us test mixed-version clusters.

[#160169569]
2018-10-26 14:24:54 +02:00
Jean-Sébastien Pédron e31cb94acb Update rabbitmq-components.mk 2018-09-19 10:38:13 +02:00
Jean-Sébastien Pédron 4a24676650 rabbit_ct_broker_helpers: Bump Lager flood limit from 200 to 10000
Without that, we miss many logging messages because Lager drops them.
Obviously this makes debugging a bit more complicated.
2018-09-19 10:34:05 +02:00
Jean-Sébastien Pédron d849af9d82 Update rabbitmq-components.mk 2018-09-11 14:22:27 +02:00
Gerhard Lazu 483c66ac47 Add test helper for asserting permanent redirects
Linked to rabbitmq/rabbitmq-management#607
2018-09-07 23:51:51 +01:00
Luke Bakken 15e39f2d3c Use sed to set DNS.1 in SAN since LibreSSL does not do env vars correctly 2018-08-27 08:22:05 -07:00
Luke Bakken 52b6a0a2f5 Ensure HOSTNAME is exported 2018-08-27 07:56:59 -07:00
Luke Bakken 0f4ef6fbdb Add HOSTNAME as DNS.1 in server_alt_names 2018-08-27 07:41:41 -07:00
Arnaud Cogoluègnes 465780e2f1 Add localhost as SAN to server certificate
This helps for Java client hostname verification tests on CI: the CI
containers resolve the hostname to an external IP address and the broker
doesn't accept the connection for guest because it's not from localhost.
By using localhost in the server certificate SAN, hostname verification
is enforced and the connection is from localhost.
2018-08-27 15:06:46 +02:00
Jean-Sébastien Pédron dd0ea26787 rabbit_ct_vm_helpers, tools/terraform: Pin Elixir version
... if one is specified.

Out-of-the box, rabbit_ct_vm_helpers will take the version of the
Elixir installed on the host starting the testsuite.
2018-08-27 13:09:45 +02:00
Jean-Sébastien Pédron 06d3fe205a Update rabbitmq-components.mk 2018-08-09 17:44:13 +02:00
Jean-Sébastien Pédron 43d7e4c8b4 Update rabbitmq-components.mk 2018-08-09 12:16:59 +02:00
Jean-Sébastien Pédron d3343e3cc3 tools/terraform/direct-vms/templates/setup-erlang.sh: Use packages for Erlang 21.0
We were still building Erlang 21.0 from sources. Elixir was also
compiled from sources, but 1.7.0-rc.1 was automatically selected and the
build fails.

Instead of trying to fix this issue with Elixir, let's just install
Erlang 21.0 and Elixir from Debian packages and be done with it.
2018-07-20 18:12:28 +02:00
Jean-Sébastien Pédron 64298fea88 rabbit_ct_vm_helpers, tools/terraform: Add Erlang app version in VM names
This helps to identify which VM belongs to which CI pipeline.
2018-06-22 16:12:35 +02:00
Michael Klishin 6b5f3d343f Use OTP 21 GA, pin OTP 22 to a recent master commit
For now, maybe we will build the tip every time eventually.
2018-06-22 14:31:06 +03:00
Michael Klishin 253f5f0182 Erlang/OTP in master is now 22.0 2018-06-22 14:23:15 +03:00
Jean-Sébastien Pédron 8834a13a79 rabbit_ct_helpers: Don't stop testsuite monitor if it's not running
This could happen if the setup run steps failed before we start the
testsuite monitor. In this case, `?config()` was returning `undefined`
and we tried to use it as a PID.
2018-06-11 17:05:22 +02:00
Jean-Sébastien Pédron e307ea45b1 rabbit_ct_vm_helpers, tools/terraform: Support Erlang built from sources
... instead of installing Debian packages. To use this feature, the
caller has to specify an Erlang Git reference (a branch, a tag or a
plain commit hash).

This is useful now to test with Erlang 21.0 which is not released yet at
the time of this commit. In the case of Erlang 21.0, if no Git reference
is specified, it defaults to `OTP-21.0-rc2`.

The time we wait for VMs to be ready is bumped from 7 to 20 minutes
because compiling Erlang and Elixir takes time.

rabbit_ct_vm_helpers takes a look at the return value of
`erlang:system_info(system_version)` because it may contain the commit
hash of the running Erlang system (if it was built from sources). It
allows to use the same commit on the remote VMs.

[#157964874]
2018-06-11 15:47:30 +02:00
Michael Klishin 41e987ccb4 Merge pull request #19 from rabbitmq/erlang-otp-21-compatibility
Compile Erlang/OTP 21
2018-06-07 19:15:54 +03:00
Jean-Sébastien Pédron f95f92de47 Update rabbitmq-components.mk 2018-06-07 11:31:34 +02:00
Michael Klishin 5c2cfea62f Same as 2c2597e56e but for int_tcp_proxy 2018-06-06 18:47:09 +03:00
Michael Klishin 2c2597e56e Compile Erlang/OTP 21
OTP 21 deprecated erlang:get_stacktrace/0 in favor of a new
try/catch syntax. Unfortunately that's not realistic for projects
that support multiple Erlang versions (like us) until OTP 21 can be
the minimum version requirement. In order to compile we have to ignore
the warning. The broad compiler option seems to be the most common
way to support compilation on multiple OTP versions with warnings_as_errors.

[#157964874]
2018-06-06 18:41:19 +03:00
Jean-Sébastien Pédron 76fe82b525 rabbit_ct_config_schema: Remove debug message
generate_config() was logging a few variables which are already
available in the config logged earlier.

Furthermore, it used ctl:pal() from the RabbitMQ node, not from the
common_test controler node. Thus it didn't work as expected and another
warning was logged in addition to the debug message.
2018-06-04 19:36:57 +02:00
Jean-Sébastien Pédron 29fc4eb0df rabbit_ct_helpers: Use get_config() instead of ?config()
... when we don't know if the parameter is set.

?config() logs a warning when the parameter is undefined. So even though
it will return `undefined` when this is the case, it's better to use
when we expect the parameter to be set.

When we don't know, it's best to use rabbit_ct_helpers:get_config(). In
particular, it can handle a default value.

The code we replace in this function was doing exactly that: use a
default value if the parameter is undefined.
2018-06-04 17:37:29 +02:00
Michael Klishin 50e9cdb5bc Log exit code when the test rabbitmqctl invocation fails
Per discussion with @dumbbell.

This helped us find out the root cause of test suite failures on OTP 21.
References rabbitmq/rabbitmq-server#1616.

[#157964874]
2018-06-04 15:21:47 +03:00
Jean-Sébastien Pédron 8e85cc508f Update erlang.mk 2018-04-11 10:53:00 +02:00
Jean-Sébastien Pédron 20c669db65 Update rabbitmq-components.mk 2018-04-11 10:51:19 +02:00
Jean-Sébastien Pédron 59373d977d Update rabbitmq-components.mk 2018-04-11 10:10:01 +02:00
Jean-Sébastien Pédron d1829cd634 rabbit_ct_vm_helpers: Wait CT peers for 7 minutes
... instead of just 3. It appears that Erlang 20.3 VMs take up-to 2 more
minutes to finish setup. Thus we wait for 4 more minutes just to be
safe.
2018-04-09 10:56:50 +02:00
Jean-Sébastien Pédron 00d67f232c tools/terraform: Add support for Erlang 20.3 2018-04-09 09:56:28 +02:00
Jean-Sébastien Pédron f35ad674c7 Terraform/setup-erlang.sh: Install xz-utils
This package was lost when refactoring the template as a generic
template (i.e. not specific to a particular version of Erlang).

[#155984209]
2018-03-19 17:43:41 +01:00
Jean-Sébastien Pédron 0bdb1a10b1 Terraform/setup-erlang.sh: Reduce wget(1) output
Otherwise, it fills up the Amazon UI buffer when viewing the journal,
and the output is truncated.

[#155984209]
2018-03-19 17:42:12 +01:00
Jean-Sébastien Pédron 6fb8c11abd rabbit_ct_broker_helpers: Handle error from `rpc:call()`
... when we want to update the code path of a remote Erlang node. I.e.
if we fail to contact it, we must not try to use the return value of
`rpc:call()` in the code following.
2018-03-19 17:14:50 +01:00
Jean-Sébastien Pédron 6ffe3980fd Terraform: Define lifecycle for launch configuration + ASG
Hopefully, this should fix a bug we sometimes hit: the launch
configuration is destroyed before the autoscaling group.

Using lifecycle blocks is recommended by Terraform documentation:
https://www.terraform.io/docs/providers/aws/r/launch_configuration.html#using-with-autoscaling-groups

[#153749132]
2018-03-13 11:18:22 +01:00
Jean-Sébastien Pédron f27e31010c Terraform: Adapt `setup-vms.sh` to latest changes
[#153749132]
2018-03-13 11:17:24 +01:00
Jean-Sébastien Pédron 8d7e0f2707 Terraform: Set default value of `erlang_nodename`
... to "control".

[#153749132]
2018-03-13 11:16:35 +01:00
Jean-Sébastien Pédron fa30b062bc rabbit_ct_vm_helpers: Don't pass directories to `erl_tar`
If we pass directories to `erl_tar:create()`, it will recurse and
include all children of those directories. It causes the archive to be
included in itself, possibly causing an infinite archiving loop. That
loop is stopped when the disc is full.

Now, all directories are excluded from the list passed to
`erl_tar:create()`, effectively disabling recursion. This fixes the
ENOSPC errors we see sometimes.

[#153749132]
2018-03-13 10:58:02 +01:00
Luke Bakken 0d5b10b696 Terraform: Move to a single Erlang setup template
This greatly reduces code duplication. It also allows us to add Erlang
20.2 support easily, because it shares everything with Erlang 20.1
setup, except the package revision obviously.

The single setup template knows the relationship between a version of
Erlang and the corresponding revision of a Debian package.

The relationship between a version of Erlang and the system to use
(Debian Wheezy, Jessie or Stretch) is already recorded in a Terraform
variable. Thus now, we pass it to the template as a variable. The script
is responsible to install backports repositories and extra packages as
needed.

[#153749132]
2018-03-12 18:25:19 +01:00
Jean-Sébastien Pédron 9298f2806b Merge branch 'vm-framework' 2018-03-08 16:35:15 +01:00
Jean-Sébastien Pédron 205a9ac403 Initial version of the VM-based test framework
It allows one to run a common_test testsuite on Erlang nodes running on
remote Amazon EC2 VMs. It configures Erlang distribution so that remote
nodes can communicate with each other and also commmunicate with the
commont_test master node.

rabbit_ct_broker_helpers also offers new setup and teardown steps to
work with VMs: it allows to start RabbitMQ nodes on those VMS and
possible cluster them. The configuration is unchanged compared to local
nodes. The number of RabbitMQ nodes doesn't have to match the number of
VMs: they are spread using round-robin on the available VMs.

v2:  Add support to start RabbitMQ nodes spread on remote VMs.

v3:  Various improvements to allow parallel executions of testcases. I.e.
     several sets of VMs can be spawned in parallel without interference.

v4:  Support user-specified VM names. If the name is missing, use the
     unique ID generated for per-VM-set resources.

v5:  Use a unique local node name when trying to ping the remote ct-peer.
     While here use `rabbit_misc:random()` to create Terraform unique UI.
     The previous base64-encoded string didn't make a valid node name.

     Accept `$ERLANG_VERSION` environment/make variable to force the
     Erlang version to use on VMs.

     Add setup scripts for Erlang 19.3 and 20.1.

v6:  Use Amazon S3 to upload the directories archive. Configure a VPC to
     access it from the VMs.

     Use `user_data` to provide the setup script. The setup script itself
     is now a template.

     Those changes allow to get rid of all `exec` or `file` provisioners
     in the `aws_instance`. This means it can now be created using a
     launch configuration which is the way to create instances via an
     autoscaling group.

v7:  Export hostnames, nodenames and IP addresses from Terraform state,
     and generate `inetrc` in Erlang. This makes it possible to work with
     a "two-step Terraform manifest". For instance, with an autoscaling
     group, Terraform doesn't start instances. However, we can use a
     second manifest to query the created instances.

     Export `$HOME` in setup scripts. This fixes the use of `~/...` paths
     and the start of the remote Erlang node.

v8:  Add support to query Amazon EC2 VMs, based on tags, instead of
     relying on the outputs of the manifest. This will allow us to query
     VMs created with an autoscaling group for instance. This change is
     based on a new query-only manifest called `vms-query`.

     This new query-only manifest is used in a loop until we have enough
     VMs (compared to the requested numbers) or we reach a timeout of 5
     minutes.

v9:  Add an autoscaling-group-based module to deploy VMs. The testsuite
     is extended to use it, in addition to the `direct-vms` module.

     Fix the setup scripts to handle the case where there is no
     directories to upload (i.e. the archive is an empty file).

v10: Download log files from remote VMs before destroying them. This
     allows further debugging if something fails.

v11: Use a per-VPC CIDR block. This resolves a possible conflict when
     VMs in different VPCs gets the same private IP address: this breaks
     name resolution on the local common_test node.

     Use inet_db:add_host() to reconfigure name resolution, instead of
     calling inet_config:init(). We still write the `inetrc` files: they
     are used by sub-processes such as rabbitmqctl(8) and
     rabbitmq-plugins(8).

     Download each VM's common_test priv_dir before destroying the VMs.
     They are useful because they contain the RabbitMQ nodes logs for
     instance.

     Fix several concurrency bugs around global resources accessed or
     shared by several setups of rabbit_vm_helpers, in case of parallel
     testing.

     The upload dirs archive is now created by Erlang, not Terraform. It
     allows us to create a single archive per directories set, which
     saves time, I/O and CPU (for compression).

     Configure an EBS root block device for each VM because the default
     internal storage a `t2.micro` instance type is too small.

v12: Verify that terraform(1) is available and working before doing
     anything else.

v13: Guess the Erlang application name being tested (using the value of
     the `$DIALYZER_PLT` environment variable, lacking a better way). We
     use it now as the instance name prefix.

     Allow the caller to set the AWS EC2 region.

     Allow the caller to set the files suffix. Also, we record it in the
     instance and launch configuration tags. This allows the caller to
     do things based on a known instance tag.

     Install rsync, zip and vim-nox on VMs. They are useful when one
     needs to connect to the VMs and try things.

     Install Elixir on 19.3+ VMs. It's not used, but it silences a
     warnings from `rabbitmq-build.mk` which calls it to initialize
     `$ELIXIR_LIB_DIR`.

[#153749132]
2018-03-07 16:02:15 +01:00
Jean-Sébastien Pédron 619d8af4a6 rabbit_ct_helpers: Add delete_config() helper
This is mostly to complete the get/set API.

[#153749132]
2018-03-07 15:33:01 +01:00
Jean-Sébastien Pédron 06bed91e4d Check rabbitmqctl(1) and rabbitmq-plugins(1) in broker steps
... not in generic steps.

They are only useful in the context of the broker and require that
`rabbit` is a dependency.

[#153749132]
2018-03-07 15:33:01 +01:00
Jean-Sébastien Pédron 68dc1c315e Makefile: Load the rabbitmq-run.mk plugin
We need it because it exports `$MAKE`.

[#153749132]
2018-03-07 15:32:57 +01:00
Jean-Sébastien Pédron 56ee52c342 Update erlang.mk 2018-03-02 19:05:18 +01:00
Jean-Sébastien Pédron a421c87bfb Update erlang.mk 2018-03-02 18:30:43 +01:00
Jean-Sébastien Pédron aad66f2e57 Merge branch 'bump-copyright' 2018-02-15 17:19:09 +01:00
Jean-Sébastien Pédron 090b6d1844 Bump copyright year to 2018 2018-02-15 17:17:52 +01:00
Daniil Fedotov c53bcb4ed2 Use error_logger instead of rabbit_log for inet_tcp_proxy log messages.
In order to use inet_tcp_proxy in non-rabbitmq tests, it should use
error_logger.
2018-02-01 17:44:00 +00:00
Jean-Sébastien Pédron 01ae5d4faa Update rabbitmq-components.mk 2018-01-30 16:48:10 +01:00
Jean-Sébastien Pédron f9913ebaa2 Update rabbitmq-components.mk 2018-01-30 15:23:35 +01:00
Luke Bakken ff773bf6d2 Update rabbitmq-components.mk 2018-01-29 16:22:12 -08:00
Jean-Sébastien Pédron ea56cefe13 Update rabbitmq-components.mk 2018-01-23 17:21:26 +01:00
Jean-Sébastien Pédron 53288bca2e Update rabbitmq-components.mk 2018-01-23 15:31:15 +01:00
Jean-Sébastien Pédron 9a59f8c5ce Update rabbitmq-components.mk 2018-01-23 12:50:25 +01:00
Diana Corbacho 15f4a2192c Update rabbitmq-components.mk 2018-01-22 22:13:20 +00:00
Diana Corbacho 21c2fa9171 Update rabbitmq-components.mk 2018-01-22 21:54:02 +00:00
Jean-Sébastien Pédron a1ea1237f1 Update rabbitmq-components.mk 2017-12-14 14:38:46 +01:00
Luke Bakken bec69ae0f1 Merge branch 'stable' 2017-12-12 12:17:35 -08:00
Luke Bakken a4a62c0a1f Fix test syntax yet again for /bin/sh 2017-12-12 12:17:24 -08:00
Luke Bakken b953a0e9ce Merge branch 'stable' 2017-12-12 12:03:10 -08:00
Luke Bakken 05a4b6411a Fix test syntax for /bin/sh 2017-12-12 12:02:56 -08:00
Luke Bakken 99f4388de5 Merge branch 'stable' 2017-12-12 12:00:14 -08:00
Luke Bakken afb574705c hostname behaves differently between Darwin and Linux of course 2017-12-12 12:00:01 -08:00
Luke Bakken 0f90713221 Merge branch 'stable' 2017-12-12 11:35:44 -08:00
Luke Bakken 5cca751b5c Use "hostname -s" to drop domain part of DNS name 2017-12-12 11:35:06 -08:00
Luke Bakken 1e22a0c36e Tweak keyUsage field to make Erlang happy
Add defaults for some fields - https://bugs.erlang.org/browse/ERL-236
2017-12-05 13:30:20 -08:00
Jean-Sébastien Pédron 800d07b5de Update rabbitmq-components.mk 2017-12-01 17:11:26 +01:00
Jean-Sébastien Pédron 5166ff225f Update rabbitmq-components.mk 2017-12-01 11:06:25 +01:00
Jean-Sébastien Pédron 7e7fa6fe22 Update rabbitmq-components.mk 2017-11-28 14:00:46 +01:00
Jean-Sébastien Pédron e67e64feae rabbit_ct_broker_helpers: Handle failure of get_message_store_pid() in force_vhost_failure()
get_message_store_pid() might be called while the vhost is shutting
down. If this happens, we loop again to double-check it's actually gone.

This should fix races in the vhost_SUITE testsuite in rabbitmq-server
seen on Travis CI.
2017-11-24 15:20:11 +01:00
Jean-Sébastien Pédron 04d6bde6db rabbit_ct_broker_helpers: Do not use M:F() for local calls
Probably a left-over after moving some code around.
2017-11-24 11:25:15 +01:00
Michael Klishin adc58f3b5e Merge branch 'stable' 2017-10-31 01:18:55 +03:00
Michael Klishin 7a36ea9b17 Compile on OTP 20 from scratch 2017-10-30 22:22:51 +03:00
Luke Bakken db1c8101f0 Add support for rabbitmq_management path_prefix in tests 2017-10-25 13:07:37 -07:00
Daniil Fedotov 5fb9d66627 Add web-stomp TLS port. Add helper function to get app env. 2017-10-23 10:35:52 +01:00
Jean-Sébastien Pédron 75717d7ee0 Merge branch 'stable' 2017-10-13 15:07:27 +02:00
Jean-Sébastien Pédron cb59722054 Update rabbitmq-components.mk 2017-10-13 14:33:07 +02:00
Jean-Sébastien Pédron e8c932f206 Update rabbitmq-components.mk 2017-10-13 14:13:03 +02:00
Jean-Sébastien Pédron 9fde490648 Update rabbitmq-components.mk 2017-10-13 12:15:42 +02:00
Daniil Fedotov 89528dd6a3 Start elixir app to be able to call rabbitmqctl commands directly from tests 2017-09-26 11:32:21 +01:00
Michael Klishin 49ab6d470c Update rabbitmq-components.mk 2017-09-13 17:54:15 -04:00
Michael Klishin f0c487bbe4 Update rabbitmq-components.mk 2017-09-13 17:45:28 -04:00
Michael Klishin 1fa55df522 Update rabbitmq-components.mk 2017-09-12 19:53:07 -04:00
Michael Klishin 08d8c6d7e6 Update rabbitmq-components.mk 2017-09-12 12:41:49 -04:00
Daniil Fedotov 8a091fafe4 Merge branch 'stable' 2017-08-30 19:20:31 +01:00
Daniil Fedotov 550e5b3ce0 Update erlang.mk 2017-08-30 18:46:44 +01:00
Jean-Sébastien Pédron c8361a49a6 rabbit_ct_broker_helpers: Adapt rabbitmqctl_list() to new `list_queues` output
The new output, introduced in rabbitmq/rabbitmq-cli#218, starts with a
new line saying "Timeout: ...".
2017-08-10 15:29:54 +02:00
Luke Bakken a4463cb5fc Use nowarn_export_all 2017-08-01 12:16:21 -07:00
Luke Bakken bcc8cc52a7 Remove -Werror as it prevents build
These modules use export_all which halts the build due to `-Werror`. It
is useful to be able to build this project to add it to the code path
for debugging.
2017-08-01 09:59:31 -07:00
Daniil Fedotov b6fe8e1fe1 Change API for getting a vhost supervisor 2017-07-28 15:39:13 +01:00
Daniil Fedotov 3838845d13 Add the helper to bring vhost supervisor down 2017-07-26 14:20:32 +01:00
Michael Klishin c036bd435a Update rabbitmq-components.mk 2017-07-26 03:48:21 +03:00
Michael Klishin 7d33f4da57 Update rabbitmq-components.mk 2017-07-26 02:27:04 +03:00
Diana Corbacho 7b292e2635 HTTP DELETE with a body
Needed for rabbitmq-management#448
2017-07-25 17:58:20 +01:00
Jean-Sébastien Pédron fb91ddd0ca Merge branch 'stable' 2017-06-28 16:51:40 +02:00
Jean-Sébastien Pédron 96b62a3bb2 rabbit_ct_broker_helpers: Use rabbitmq-plugins(8) to play with plugins
... instead of calling rabbit_plugins_main module directly. This way we
are sure to test the same command as regular user. Moreover, this also
works with the new CLI where rabbit_plugins_main is gone.
2017-06-28 16:49:04 +02:00
Luke Bakken 3b2a07b110 Correctly find schema for rabbit application named "rabbitmq.schema"
Changes to support renaming rabbitmq.schema to rabbit.schema
2017-06-15 10:33:16 -07:00
Diana Corbacho 420da47e32 Revert commit 0dde05a6d
Rabbit application doesn't follow naming convention, this change breaks
the all dependent tests.
2017-06-15 11:25:07 +01:00
Luke Bakken 0dde05a6d8 Find the rabbitmq.schema in the same way as other schemas 2017-06-14 07:56:33 -07:00