anchor.diff:  -include_lib("eunit/include/eunit.hrl").
   
   -define(ASSERT_UP(Node), ?assertMatch({online, {available, _}}, ?NS:status(Node)) ).
  --define(ASSERT_DOWN(Node), ?assertMatch({online, {unavailable, _}}, ?NS:status(Node)) ).
  +-define(ASSERT_IDLE(Node), ?assertMatch({online, {unavailable, _}}, ?NS:status(Node)) ).
  +-define(ASSERT_DOWN(Node), ?assertMatch({offline, {unavailable, _}}, ?NS:status(Node)) ).
   
   basic_setup() ->
       test_util:start_apps(),
  
positive.code:               {"Start it up, send hb, sleep, check state until we drive it into 'up', then wait until it goes down",
                 fun() ->
                         ?NS:heartbeat(?NODE),
                         ?ASSERT_DOWN(?NODE),
                         timer:sleep(?HB_INTERVAL),
  
                         %% Drive it up
                         heartbeat_step(?NODE, ?HB_INTERVAL, 6),
                         ?NS:aborted(?NODE),
                         ?ASSERT_UP(?NODE),
  
  
negative.code:               {"Start it up, send hb, sleep, check state until we drive it into 'up'",
                 fun() ->
                         ?NS:heartbeat(?NODE),
                         ?ASSERT_IDLE(?NODE),
                         timer:sleep(?HB_INTERVAL),
  
                         %% Drive it up
                         heartbeat_step(?NODE, ?HB_INTERVAL, 3),
                         ?NS:aborted(?NODE),
                         ?ASSERT_UP(?NODE)
                 end}
  