diff options
| author | Diana Corbacho <diana.corbacho@erlang-solutions.com> | 2015-10-30 13:34:31 +0000 |
|---|---|---|
| committer | Diana Corbacho <diana.corbacho@erlang-solutions.com> | 2015-10-30 13:39:53 +0000 |
| commit | 84dec3da91283e3a0bb153ac4437e2600ea1a96d (patch) | |
| tree | bfb81d00c722313499c3fe14ffce6c778f472d38 /test | |
| parent | 6581968166c18937807d39078e0690759d0e566f (diff) | |
| download | rabbitmq-server-git-84dec3da91283e3a0bb153ac4437e2600ea1a96d.tar.gz | |
Test failure to start disk monitor in unsupported platforms
Diffstat (limited to 'test')
| -rw-r--r-- | test/src/rabbit_tests.erl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/src/rabbit_tests.erl b/test/src/rabbit_tests.erl index 0997478b66..e85cf98864 100644 --- a/test/src/rabbit_tests.erl +++ b/test/src/rabbit_tests.erl @@ -90,6 +90,13 @@ all_tests0() -> passed = test_memory_high_watermark(), passed = on_disk_store_tunable_parameter_validation_test:test_msg_store_parameter_validation(), passed = credit_flow_test:test_credit_flow_settings(), + passed = + do_if_meck_enabled( + fun disk_monitor_test/0, + fun () -> + io:format("Skipping meck dependent tests ~n"), + passed + end), passed. @@ -101,6 +108,12 @@ do_if_secondary_node(Up, Down) -> pang -> Down(SecondaryNode) end. +do_if_meck_enabled(Enabled, Disabled) -> + case code:which(meck) of + non_existing -> Disabled(); + _ -> Enabled() + end. + setup_cluster() -> do_if_secondary_node( fun (SecondaryNode) -> @@ -3060,3 +3073,14 @@ test_memory_high_watermark() -> ok = control_action(set_vm_memory_high_watermark, [float_to_list(HWM)]), passed. + +disk_monitor_test() -> + %% Issue: rabbitmq-server #91 + %% os module could be mocked using 'unstick', however it may have undesired + %% side effects in following tests. Thus, we mock at rabbit_misc level + ok = meck:new(rabbit_misc, [passthrough]), + ok = meck:expect(rabbit_misc, os_cmd, fun(_) -> "\n" end), + ok = rabbit_sup:stop_child(rabbit_disk_monitor_sup), + ok = rabbit_sup:start_delayed_restartable_child(rabbit_disk_monitor, [1000]), + meck:unload(rabbit_misc), + passed. |
