diff options
| author | Arnaud Cogoluègnes <acogoluegnes@gmail.com> | 2016-10-12 15:37:27 +0200 |
|---|---|---|
| committer | Arnaud Cogoluègnes <acogoluegnes@gmail.com> | 2016-10-12 15:37:27 +0200 |
| commit | c5991c696f7a5751af1899729ff5a15b1f58950e (patch) | |
| tree | 871fffe343cf1e9c9a2eebc70f6acc38ef610de4 /test | |
| parent | 172c158b94b3f4bf4a9b1f7ed622f7b83164d5c1 (diff) | |
| download | rabbitmq-server-git-c5991c696f7a5751af1899729ff5a15b1f58950e.tar.gz | |
Add better message when decryption fails in config
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit_SUITE.erl | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/test/unit_SUITE.erl b/test/unit_SUITE.erl index e363fe6cb6..e79dfc46ad 100644 --- a/test/unit_SUITE.erl +++ b/test/unit_SUITE.erl @@ -72,7 +72,8 @@ groups() -> {sequential_tests, [], [ decrypt_start_app, decrypt_start_app_file, - decrypt_start_app_undefined + decrypt_start_app_undefined, + decrypt_start_app_wrong_passphrase ]} ]. @@ -410,6 +411,26 @@ decrypt_start_app_undefined(Config) -> _:_ -> exit(unexpected_exception) end. +decrypt_start_app_wrong_passphrase(Config) -> + %% Configure rabbit for decrypting configuration. + application:set_env(rabbit, decoder_config, [ + {cipher, aes_cbc256}, + {hash, sha512}, + {iterations, 1000}, + {passphrase, "wrong passphrase"} + ]), + %% Add the path to our test application. + code:add_path(?config(data_dir, Config) ++ "/lib/rabbit_shovel_test/ebin"), + %% Attempt to start our test application. + %% + %% We expect a failure during decryption because the passphrase is wrong. + try + rabbit:start_apps([rabbit_shovel_test]) + catch + exit:{decryption_error,_,_} -> ok; + _:_ -> exit(unexpected_exception) + end. + rabbitmqctl_encode(_Config) -> % list ciphers and hashes {ok, _} = rabbit_control_pbe:encode(true, false, undefined, undefined, undefined, undefined, undefined), |
