Skip to content

Commit

Permalink
Add delete_unknown_table and delete_table_twice testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
arcusfelis committed Sep 14, 2023
1 parent ca6ca36 commit 7281810
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/cets_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ cases() ->
test_multinode_auto_discovery,
test_disco_add_table,
test_disco_delete_table,
test_disco_delete_unknown_table,
test_disco_delete_table_twice,
test_disco_file_appears,
test_disco_handles_bad_node,
cets_discovery_fun_backend_works,
Expand Down Expand Up @@ -822,6 +824,23 @@ test_disco_delete_table(Config) ->
cets_discovery:delete_table(Disco, Tab),
#{tables := []} = cets_discovery:system_info(Disco).

test_disco_delete_unknown_table(Config) ->
F = fun(State) -> {{ok, []}, State} end,
{ok, Disco} = cets_discovery:start(#{backend_module => cets_discovery_fun, get_nodes_fn => F}),
Tab = make_name(Config),
cets_discovery:delete_table(Disco, Tab),
#{tables := []} = cets_discovery:system_info(Disco).

test_disco_delete_table_twice(Config) ->
F = fun(State) -> {{ok, []}, State} end,
{ok, Disco} = cets_discovery:start(#{backend_module => cets_discovery_fun, get_nodes_fn => F}),
Tab = make_name(Config),
cets_discovery:add_table(Disco, Tab),
#{tables := [Tab]} = cets_discovery:system_info(Disco),
cets_discovery:delete_table(Disco, Tab),
cets_discovery:delete_table(Disco, Tab),
#{tables := []} = cets_discovery:system_info(Disco).

test_disco_file_appears(Config) ->
Node1 = node(),
#{ct2 := Node2} = proplists:get_value(nodes, Config),
Expand Down

0 comments on commit 7281810

Please sign in to comment.