~ubuntu-branches/ubuntu/saucy/rabbitmq-server/saucy

« back to all changes in this revision

Viewing changes to plugins-src/rabbitmq-management/test/src/rabbit_mgmt_test_clustering.erl

  • Committer: Package Import Robot
  • Author(s): Emile Joubert
  • Date: 2012-11-19 11:42:31 UTC
  • mfrom: (0.2.18) (0.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20121119114231-hvapkn4akng09etr
Tags: 3.0.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
                     " OTHER_PORT=" ++ integer_to_list(Port) ++
41
41
                     " start-other-node ; echo $?"),
42
42
    LastLine = hd(lists:reverse(string:tokens(Res, "\n"))),
43
 
    ?assertEqual("0", LastLine).
 
43
    case LastLine of
 
44
        "0" -> ok;
 
45
        _   -> ?debugVal(Res),
 
46
               ?assertEqual("0", LastLine)
 
47
    end.
44
48
 
45
49
cluster_other_node(Name) ->
46
50
    ?assertCmd("make -C " ++ plugin_dir() ++ " OTHER_NODE=" ++
64
68
    {timeout, 60, fun ha/0}.
65
69
 
66
70
ha() ->
67
 
    QArgs = [{node,      <<"hare">>},
68
 
             {arguments, [{'x-ha-policy', all}]}],
 
71
    Policy = [{pattern,    <<".*">>},
 
72
              {definition, [{'ha-mode', <<"all">>}]}],
 
73
    http_put("/policies/%2f/HA", Policy, ?NO_CONTENT),
 
74
    QArgs = [{node, <<"hare">>}],
69
75
    http_put("/queues/%2f/ha-queue", QArgs, ?NO_CONTENT),
70
76
    Q = wait_for("/queues/%2f/ha-queue"),
71
77
    assert_node(hare, pget(node, Q)),
77
83
    assert_single_node(hare, pget(slave_nodes, Q2)),
78
84
    assert_single_node(hare, pget(synchronised_slave_nodes, Q2)),
79
85
    http_delete("/queues/%2f/ha-queue", ?NO_CONTENT),
 
86
    http_delete("/policies/%2f/HA", ?NO_CONTENT),
80
87
    ok.
81
88
 
82
89
%%----------------------------------------------------------------------------