diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2010-12-20 16:54:49 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-12-20 16:54:49 +0000 |
commit | 373b4d22fa8f712c96baed35af9805c8f5e097f2 (patch) | |
tree | 8ec8fe006038d983110d0f7b15d9a5fe7c324ff2 | |
parent | a66a81b61fa4ab5ef4b509743813901025d623ff (diff) | |
download | rabbitmq-server-373b4d22fa8f712c96baed35af9805c8f5e097f2.tar.gz |
Test the badnodes case
-rw-r--r-- | src/rabbit_tests.erl | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl index adf968cb..4f7a1e0c 100644 --- a/src/rabbit_tests.erl +++ b/src/rabbit_tests.erl @@ -1247,15 +1247,25 @@ test_delegates_sync(SecondaryNode) -> true = lists:all(fun ({_, response}) -> true end, GoodRes), GoodResPids = [Pid || {Pid, _} <- GoodRes], - Good = ordsets:from_list(LocalGoodPids ++ RemoteGoodPids), - Good = ordsets:from_list(GoodResPids), + Good = lists:usort(LocalGoodPids ++ RemoteGoodPids), + Good = lists:usort(GoodResPids), {[], BadRes} = delegate:invoke(LocalBadPids ++ RemoteBadPids, BadSender), true = lists:all(fun ({_, {exit, exception, _}}) -> true end, BadRes), BadResPids = [Pid || {Pid, _} <- BadRes], - Bad = ordsets:from_list(LocalBadPids ++ RemoteBadPids), - Bad = ordsets:from_list(BadResPids), + Bad = lists:usort(LocalBadPids ++ RemoteBadPids), + Bad = lists:usort(BadResPids), + + MagicalPids = [rabbit_misc:string_to_pid(Str) || + Str <- ["<nohost.1.0>", "<nohost.2.0>"]], + {[], BadNodes} = delegate:invoke(MagicalPids, Sender), + true = lists:all(fun ({_, {exit, {nodedown, nohost}, []}}) -> true end, + BadNodes), + BadNodesPids = [Pid || {Pid, _} <- BadNodes], + + Magical = lists:usort(MagicalPids), + Magical = lists:usort(BadNodesPids), passed. |