anchor.diff:  -module(single_node_failure_test_SUITE).
   -author("Michal Wrzeszcz").
   
  +-include("global_definitions.hrl").
   -include_lib("ctool/include/test/test_utils.hrl").
   
   %% API
  
positive.code:     failure_test
  ].
  
  %%%===================================================================
  %%% API
  %%%===================================================================
  
  failure_test(Config) ->
      [Worker] = test_config:get_all_op_worker_nodes(Config),
  
      % disable op_worker healthcheck in onepanel, so nodes are not started up automatically
      % TODO - delete when framework handles node stop properly
      onenv_test_utils:disable_panel_healthcheck(Config),
  
      ok = onenv_test_utils:kill_node(Config, Worker),
      ?assertEqual({badrpc, nodedown}, rpc:call(Worker, oneprovider, get_id, []), 10),
      ct:pal("Node killed"),
  
      ok = onenv_test_utils:start_node(Config, Worker),
      ?assertMatch({ok, _}, rpc:call(Worker, provider_auth, get_provider_id, []), 60),
  
      ok.
  
  %%%===================================================================
  %%% SetUp and TearDown functions
  
negative.code:         provider_onenv_test_utils:initialize(NewConfig)
      end,
      test_config:set_many(Config, [
          {set_onenv_scenario, ["2op"]}, % name of yaml file in test_distributed/onenv_scenarios
          {set_posthook, Posthook}
      ]).
  
  