aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/wrap_log_reader_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel/test/wrap_log_reader_SUITE.erl')
-rw-r--r--lib/kernel/test/wrap_log_reader_SUITE.erl356
1 files changed, 178 insertions, 178 deletions
diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl
index 888695b1ec..c797354a3e 100644
--- a/lib/kernel/test/wrap_log_reader_SUITE.erl
+++ b/lib/kernel/test/wrap_log_reader_SUITE.erl
@@ -88,11 +88,11 @@ no_file(Conf) when is_list(Conf) ->
start(),
wlt ! {open, self(), File},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
+ rec({error, {index_file_not_found, File}}, ?LINE),
wlt ! {open, self(), File, 1},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
+ rec({error, {index_file_not_found, File}}, ?LINE),
wlt ! {open, self(), File, 4},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
+ rec({error, {index_file_not_found, File}}, ?LINE),
stop(),
delete_files(File),
@@ -106,19 +106,19 @@ one_empty(Conf) when is_list(Conf) ->
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
+ open(sune, File, ?LINE),
%% open
- ?line do_chunk([{open,File}, eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1}, eof], wlt, ?LINE),
+ do_chunk([{open,File}, eof], wlt, ?LINE),
+ do_chunk([{open,File,1}, eof], wlt, ?LINE),
wlt ! {open, self(), File, 2},
- ?line rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
- ?line close(sune),
+ rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
+ close(sune),
%% closed
- ?line do_chunk([{open,File}, eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1}, eof], wlt, ?LINE),
+ do_chunk([{open,File}, eof], wlt, ?LINE),
+ do_chunk([{open,File,1}, eof], wlt, ?LINE),
wlt ! {open, self(), File, 2},
- ?line rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
+ rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
stop(),
delete_files(File),
@@ -131,12 +131,12 @@ one_filled(Conf) when is_list(Conf) ->
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
- ?line log_terms(sune, ["first round, one", "first round, two"]),
- ?line sync(sune),
+ open(sune, File, ?LINE),
+ log_terms(sune, ["first round, one", "first round, two"]),
+ sync(sune),
%% open
test_one(File),
- ?line close(sune),
+ close(sune),
%% closed
test_one(File),
@@ -145,16 +145,16 @@ one_filled(Conf) when is_list(Conf) ->
ok.
test_one(File) ->
- ?line do_chunk([{open,File},
- {chunk, ["first round, one", "first round, two"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1},
- {chunk, ["first round, one", "first round, two"]},
- eof], wlt, ?LINE),
+ do_chunk([{open,File},
+ {chunk, ["first round, one", "first round, two"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,1},
+ {chunk, ["first round, one", "first round, two"]},
+ eof], wlt, ?LINE),
wlt ! {open, self(), File, 2},
- ?line rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
- ?line do_chunk([{open,File,1}, {chunk, 1, ["first round, one"]},
- {chunk, 1, ["first round, two"]}, eof], wlt, ?LINE),
+ rec({error, {file_not_found, add_ext(File, 2)}}, ?LINE),
+ do_chunk([{open,File,1}, {chunk, 1, ["first round, one"]},
+ {chunk, 1, ["first round, two"]}, eof], wlt, ?LINE),
ok.
@@ -165,13 +165,13 @@ two_filled(Conf) when is_list(Conf) ->
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
- ?line log_terms(sune, ["first round, 11", "first round, 12"]),
- ?line log_terms(sune, ["first round, 21", "first round, 22"]),
- ?line sync(sune),
+ open(sune, File, ?LINE),
+ log_terms(sune, ["first round, 11", "first round, 12"]),
+ log_terms(sune, ["first round, 21", "first round, 22"]),
+ sync(sune),
%% open
test_two(File),
- ?line close(sune),
+ close(sune),
%% closed
test_two(File),
@@ -180,20 +180,20 @@ two_filled(Conf) when is_list(Conf) ->
ok.
test_two(File) ->
- ?line do_chunk([{open,File},
- {chunk, infinity, ["first round, 11", "first round, 12"]},
- {chunk, ["first round, 21", "first round, 22"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1},
- {chunk, ["first round, 11", "first round, 12"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,2},
- {chunk, ["first round, 21", "first round, 22"]},
- eof], wlt, ?LINE),
+ do_chunk([{open,File},
+ {chunk, infinity, ["first round, 11", "first round, 12"]},
+ {chunk, ["first round, 21", "first round, 22"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,1},
+ {chunk, ["first round, 11", "first round, 12"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,2},
+ {chunk, ["first round, 21", "first round, 22"]},
+ eof], wlt, ?LINE),
wlt ! {open, self(), File, 3},
- ?line rec({error, {file_not_found, add_ext(File, 3)}}, ?LINE),
- ?line do_chunk([{open,File,1}, {chunk, 1, ["first round, 11"]},
- {chunk, 2, ["first round, 12"]}, eof], wlt, ?LINE),
+ rec({error, {file_not_found, add_ext(File, 3)}}, ?LINE),
+ do_chunk([{open,File,1}, {chunk, 1, ["first round, 11"]},
+ {chunk, 2, ["first round, 12"]}, eof], wlt, ?LINE),
ok.
@@ -204,12 +204,12 @@ four_filled(Conf) when is_list(Conf) ->
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
- ?line init_files(0),
- ?line sync(sune),
+ open(sune, File, ?LINE),
+ init_files(0),
+ sync(sune),
%% open
test_four(File),
- ?line close(sune),
+ close(sune),
%% closed
test_four(File),
@@ -218,24 +218,24 @@ four_filled(Conf) when is_list(Conf) ->
ok.
test_four(File) ->
- ?line do_chunk([{open,File},
- {chunk, ["first round, 11", "first round, 12"]},
- {chunk, ["first round, 21", "first round, 22"]},
- {chunk, ["first round, 31", "first round, 32"]},
- {chunk, ["first round, 41", "first round, 42"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1},
- {chunk, ["first round, 11", "first round, 12"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,4},
- {chunk, ["first round, 41", "first round, 42"]},
- eof], wlt, ?LINE),
+ do_chunk([{open,File},
+ {chunk, ["first round, 11", "first round, 12"]},
+ {chunk, ["first round, 21", "first round, 22"]},
+ {chunk, ["first round, 31", "first round, 32"]},
+ {chunk, ["first round, 41", "first round, 42"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,1},
+ {chunk, ["first round, 11", "first round, 12"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,4},
+ {chunk, ["first round, 41", "first round, 42"]},
+ eof], wlt, ?LINE),
wlt ! {open, self(), File, 5},
- ?line rec({error, {file_not_found, add_ext(File, 5)}}, ?LINE),
- ?line do_chunk([{open,File,1}, {chunk, 1, ["first round, 11"]},
- {chunk, 2, ["first round, 12"]}, eof], wlt, ?LINE),
- ?line do_chunk([{open,File,4}, {chunk, 1, ["first round, 41"]},
- {chunk, 2, ["first round, 42"]}, eof], wlt, ?LINE),
+ rec({error, {file_not_found, add_ext(File, 5)}}, ?LINE),
+ do_chunk([{open,File,1}, {chunk, 1, ["first round, 11"]},
+ {chunk, 2, ["first round, 12"]}, eof], wlt, ?LINE),
+ do_chunk([{open,File,4}, {chunk, 1, ["first round, 41"]},
+ {chunk, 2, ["first round, 42"]}, eof], wlt, ?LINE),
ok.
@@ -246,13 +246,13 @@ wrap_filled(Conf) when is_list(Conf) ->
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
- ?line init_files(0),
- ?line log_terms(sune, ["second round, 11", "second round, 12"]),
- ?line sync(sune),
+ open(sune, File, ?LINE),
+ init_files(0),
+ log_terms(sune, ["second round, 11", "second round, 12"]),
+ sync(sune),
%% open
test_wrap(File),
- ?line close(sune),
+ close(sune),
%% closed
test_wrap(File),
@@ -261,24 +261,24 @@ wrap_filled(Conf) when is_list(Conf) ->
ok.
test_wrap(File) ->
- ?line do_chunk([{open,File},
- {chunk, ["first round, 21", "first round, 22"]},
- {chunk, ["first round, 31", "first round, 32"]},
- {chunk, ["first round, 41", "first round, 42"]},
- {chunk, ["second round, 11", "second round, 12"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,1},
- {chunk, ["second round, 11", "second round, 12"]},
- eof], wlt, ?LINE),
- ?line do_chunk([{open,File,2},
- {chunk, ["first round, 21", "first round, 22"]},
- eof], wlt, ?LINE),
+ do_chunk([{open,File},
+ {chunk, ["first round, 21", "first round, 22"]},
+ {chunk, ["first round, 31", "first round, 32"]},
+ {chunk, ["first round, 41", "first round, 42"]},
+ {chunk, ["second round, 11", "second round, 12"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,1},
+ {chunk, ["second round, 11", "second round, 12"]},
+ eof], wlt, ?LINE),
+ do_chunk([{open,File,2},
+ {chunk, ["first round, 21", "first round, 22"]},
+ eof], wlt, ?LINE),
wlt ! {open, self(), File, 5},
- ?line rec({error, {file_not_found, add_ext(File, 5)}}, ?LINE),
- ?line do_chunk([{open,File,1}, {chunk, 1, ["second round, 11"]},
- {chunk, 2, ["second round, 12"]}, eof], wlt, ?LINE),
- ?line do_chunk([{open,File,4}, {chunk, 1, ["first round, 41"]},
- {chunk, 2, ["first round, 42"]}, eof], wlt, ?LINE),
+ rec({error, {file_not_found, add_ext(File, 5)}}, ?LINE),
+ do_chunk([{open,File,1}, {chunk, 1, ["second round, 11"]},
+ {chunk, 2, ["second round, 12"]}, eof], wlt, ?LINE),
+ do_chunk([{open,File,4}, {chunk, 1, ["first round, 41"]},
+ {chunk, 2, ["first round, 42"]}, eof], wlt, ?LINE),
ok.
%% Wrapping at the same time as reading.
@@ -288,48 +288,48 @@ wrapping(Conf) when is_list(Conf) ->
delete_files(File),
start(),
- ?line open(sune, File, ?LINE),
- ?line init_files(1100),
- ?line sync(sune),
- ?line C1 =
+ open(sune, File, ?LINE),
+ init_files(1100),
+ sync(sune),
+ C1 =
do_chunk([{open,File}, {chunk, 1, ["first round, 11"]}], wlt, ?LINE),
- ?line log_terms(sune, ["second round, 11", "second round, 12"]),
- ?line sync(sune),
- ?line do_chunk([{chunk, 1, ["first round, 12"]},
- %% Here two bad bytes are found.
- {chunk, ["first round, 21", "first round, 22"]},
- {chunk, ["first round, 31", "first round, 32"]},
- {chunk, ["first round, 41", "first round, 42"]}, eof],
- wlt, ?LINE, C1),
+ log_terms(sune, ["second round, 11", "second round, 12"]),
+ sync(sune),
+ do_chunk([{chunk, 1, ["first round, 12"]},
+ %% Here two bad bytes are found.
+ {chunk, ["first round, 21", "first round, 22"]},
+ {chunk, ["first round, 31", "first round, 32"]},
+ {chunk, ["first round, 41", "first round, 42"]}, eof],
+ wlt, ?LINE, C1),
start(),
delete_files(File),
- ?line open(sune, File, ?LINE),
- ?line init_files(1100),
- ?line sync(sune),
- ?line C2 =
+ open(sune, File, ?LINE),
+ init_files(1100),
+ sync(sune),
+ C2 =
do_chunk([{open,File}, {chunk, 1, ["first round, 11"]}], wlt, ?LINE),
- ?line log_terms(sune, ["second round, 11", "second round, 12"]),
- ?line close(sune),
- ?line do_chunk([{chunk, 1, ["first round, 12"]},
- %% Here two bad bytes are found.
- {chunk, ["first round, 21", "first round, 22"]},
- {chunk, ["first round, 31", "first round, 32"]},
- {chunk, ["first round, 41", "first round, 42"]}, eof],
- wlt, ?LINE, C2),
+ log_terms(sune, ["second round, 11", "second round, 12"]),
+ close(sune),
+ do_chunk([{chunk, 1, ["first round, 12"]},
+ %% Here two bad bytes are found.
+ {chunk, ["first round, 21", "first round, 22"]},
+ {chunk, ["first round, 31", "first round, 32"]},
+ {chunk, ["first round, 41", "first round, 42"]}, eof],
+ wlt, ?LINE, C2),
start(),
delete_files(File),
- ?line open(sune, File, ?LINE),
- ?line init_files(1100),
- ?line sync(sune),
- ?line C3 = do_chunk([{open,File}], wlt, ?LINE),
- ?line log_terms(sune, ["second round, 11"]),
- ?line sync(sune),
- ?line do_chunk([{chunk, 1, ["second round, 11"]},
- {chunk, 1, ["first round, 21"]},
- {chunk, 1, ["first round, 22"]},
- {chunk, ["first round, 31", "first round, 32"]},
- {chunk, ["first round, 41", "first round, 42"]}, eof],
- wlt, ?LINE, C3),
+ open(sune, File, ?LINE),
+ init_files(1100),
+ sync(sune),
+ C3 = do_chunk([{open,File}], wlt, ?LINE),
+ log_terms(sune, ["second round, 11"]),
+ sync(sune),
+ do_chunk([{chunk, 1, ["second round, 11"]},
+ {chunk, 1, ["first round, 21"]},
+ {chunk, 1, ["first round, 22"]},
+ {chunk, ["first round, 31", "first round, 32"]},
+ {chunk, ["first round, 41", "first round, 42"]}, eof],
+ wlt, ?LINE, C3),
stop(),
delete_files(File),
@@ -342,13 +342,13 @@ external(Conf) when is_list(Conf) ->
delete_files(File),
start(),
- ?line open_ext(sune, File, ?FILE),
- ?line init_files_ext(0),
- ?line close(sune),
+ open_ext(sune, File, ?FILE),
+ init_files_ext(0),
+ close(sune),
P0 = pps(),
wlt ! {open, self(), File},
- ?line rec({error, {not_a_log_file, add_ext(File, 1)}}, ?LINE),
- ?line true = (P0 == pps()),
+ rec({error, {not_a_log_file, add_ext(File, 1)}}, ?LINE),
+ true = (P0 == pps()),
stop(),
delete_files(File),
@@ -363,69 +363,69 @@ error(Conf) when is_list(Conf) ->
P0 = pps(),
wlt ! {open, self(), File, 1},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
+ rec({error, {index_file_not_found, File}}, ?LINE),
wlt ! {open, self(), File},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
- ?line true = (P0 == pps()),
+ rec({error, {index_file_not_found, File}}, ?LINE),
+ true = (P0 == pps()),
- ?line open(sune, File, ?LINE),
- ?line close(sune),
+ open(sune, File, ?LINE),
+ close(sune),
P1 = pps(),
- ?line First = add_ext(File, 1),
- ?line ok = file:delete(First),
+ First = add_ext(File, 1),
+ ok = file:delete(First),
wlt ! {open, self(), File},
- ?line rec({error, {not_a_log_file, First}}, ?LINE),
- ?line true = (P1 == pps()),
+ rec({error, {not_a_log_file, First}}, ?LINE),
+ true = (P1 == pps()),
delete_files(File),
- ?line open(sune, File, ?LINE),
- ?line init_files(0),
- ?line close(sune),
+ open(sune, File, ?LINE),
+ init_files(0),
+ close(sune),
P2 = pps(),
- ?line C = do_chunk([{open,File},
- {chunk, ["first round, 11", "first round, 12"]}],
- wlt, ?LINE),
- ?line Second = add_ext(File, 2),
- ?line ok = file:delete(Second),
+ C = do_chunk([{open,File},
+ {chunk, ["first round, 11", "first round, 12"]}],
+ wlt, ?LINE),
+ Second = add_ext(File, 2),
+ ok = file:delete(Second),
wlt ! {chunk, self(), C},
- ?line rec({error, {file_error, Second, {error, enoent}}}, ?LINE),
- ?line ok = file:write_file(Second, <<17:(3*8)>>), % three bytes
+ rec({error, {file_error, Second, {error, enoent}}}, ?LINE),
+ ok = file:write_file(Second, <<17:(3*8)>>), % three bytes
wlt ! {chunk, self(), C},
- ?line rec({error, {not_a_log_file, Second}}, ?LINE),
- ?line do_chunk([close], wlt, ?LINE, C),
- ?line true = (P2 == pps()),
+ rec({error, {not_a_log_file, Second}}, ?LINE),
+ do_chunk([close], wlt, ?LINE, C),
+ true = (P2 == pps()),
delete_files(File),
- ?line open(sune, File, ?LINE),
- ?line init_files(0),
- ?line close(sune),
+ open(sune, File, ?LINE),
+ init_files(0),
+ close(sune),
P3 = pps(),
timer:sleep(1100),
Now = calendar:local_time(),
- ?line ok = file:change_time(First, Now),
- ?line C2 = do_chunk([{open,File},
- {chunk, ["first round, 11", "first round, 12"]}],
- wlt, ?LINE),
+ ok = file:change_time(First, Now),
+ C2 = do_chunk([{open,File},
+ {chunk, ["first round, 11", "first round, 12"]}],
+ wlt, ?LINE),
wlt ! {chunk, self(), C2},
- ?line rec({error,{is_wrapped,First}}, ?LINE),
- ?line do_chunk([close], wlt, ?LINE, C2),
+ rec({error,{is_wrapped,First}}, ?LINE),
+ do_chunk([close], wlt, ?LINE, C2),
IndexFile = add_ext(File, idx),
- ?line ok = file:write_file(IndexFile, <<17:(3*8)>>),
+ ok = file:write_file(IndexFile, <<17:(3*8)>>),
wlt ! {open, self(), File, 1},
- ?line rec({error, {index_file_not_found, File}}, ?LINE),
- ?line true = (P3 == pps()),
+ rec({error, {index_file_not_found, File}}, ?LINE),
+ true = (P3 == pps()),
stop(),
delete_files(File),
ok.
start() ->
- ?line ok = wrap_log_test:stop(),
+ ok = wrap_log_test:stop(),
dl_wait(),
- ?line ok = wrap_log_test:init().
+ ok = wrap_log_test:init().
stop() ->
- ?line ok = wrap_log_test:stop(),
+ ok = wrap_log_test:stop(),
dl_wait().
%% Give disk logs opened by 'logger' and 'wlt' time to close after
@@ -449,24 +449,24 @@ delete_files(File) ->
ok.
init_files(Delay) ->
- ?line log_terms(sune, ["first round, 11", "first round, 12"]),
+ log_terms(sune, ["first round, 11", "first round, 12"]),
timer:sleep(Delay),
- ?line log_terms(sune, ["first round, 21", "first round, 22"]),
+ log_terms(sune, ["first round, 21", "first round, 22"]),
timer:sleep(Delay),
- ?line log_terms(sune, ["first round, 31", "first round, 32"]),
+ log_terms(sune, ["first round, 31", "first round, 32"]),
timer:sleep(Delay),
- ?line log_terms(sune, ["first round, 41", "first round, 42"]),
+ log_terms(sune, ["first round, 41", "first round, 42"]),
timer:sleep(Delay),
ok.
init_files_ext(Delay) ->
- ?line blog_terms(sune, ["first round, 11", "first round, 12"]),
+ blog_terms(sune, ["first round, 11", "first round, 12"]),
timer:sleep(Delay),
- ?line blog_terms(sune, ["first round, 21", "first round, 22"]),
+ blog_terms(sune, ["first round, 21", "first round, 22"]),
timer:sleep(Delay),
- ?line blog_terms(sune, ["first round, 31", "first round, 32"]),
+ blog_terms(sune, ["first round, 31", "first round, 32"]),
timer:sleep(Delay),
- ?line blog_terms(sune, ["first round, 41", "first round, 42"]),
+ blog_terms(sune, ["first round, 41", "first round, 42"]),
timer:sleep(Delay),
ok.
@@ -478,27 +478,27 @@ do_chunk(Commands, Server, Where) ->
do_chunk([{open, File, One} | Cs], S, W, _C) ->
S ! {open, self(), File, One},
- ?line NC = rec1(ok, {W,?LINE}),
+ NC = rec1(ok, {W,?LINE}),
do_chunk(Cs, S, W, NC);
do_chunk([{open, File} | Cs], S, W, _C) ->
S ! {open, self(), File},
- ?line NC = rec1(ok, {W,?LINE}),
+ NC = rec1(ok, {W,?LINE}),
do_chunk(Cs, S, W, NC);
do_chunk([{chunk, Terms} | Cs], S, W, C) ->
S ! {chunk, self(), C},
- ?line NC = rec2(Terms, {W,?LINE}),
+ NC = rec2(Terms, {W,?LINE}),
do_chunk(Cs, S, W, NC);
do_chunk([{chunk, N, Terms} | Cs], S, W, C) ->
S ! {chunk, self(), C, N},
- ?line NC = rec2(Terms, {W,?LINE}),
+ NC = rec2(Terms, {W,?LINE}),
do_chunk(Cs, S, W, NC);
do_chunk([eof], S, W, C) ->
S ! {chunk, self(), C},
- ?line C1 = rec2(eof, {W,?LINE}),
+ C1 = rec2(eof, {W,?LINE}),
do_chunk([close], S, W, C1);
do_chunk([close], S, W, C) ->
S ! {close, self(), C},
- ?line rec(ok, {W,?LINE});
+ rec(ok, {W,?LINE});
do_chunk([], _S, _W, C) ->
C.
@@ -551,6 +551,6 @@ rec(M, Where) ->
Else -> ct:fail({error, {Where, Else}})
after 5000 -> ct:fail({error, {Where, time_out}})
end.
-
+
pps() ->
{erlang:ports(), lists:filter(fun erlang:is_process_alive/1, processes())}.