diff options
Diffstat (limited to 'lib/observer/test')
-rw-r--r-- | lib/observer/test/Makefile | 4 | ||||
-rw-r--r-- | lib/observer/test/crashdump_viewer_SUITE.erl | 86 | ||||
-rw-r--r-- | lib/observer/test/etop_SUITE.erl | 30 | ||||
-rw-r--r-- | lib/observer/test/observer.cover | 6 | ||||
-rw-r--r-- | lib/observer/test/observer.spec | 3 | ||||
-rw-r--r-- | lib/observer/test/observer_SUITE.erl | 25 | ||||
-rw-r--r-- | lib/observer/test/ttb_SUITE.erl | 37 |
7 files changed, 133 insertions, 58 deletions
diff --git a/lib/observer/test/Makefile b/lib/observer/test/Makefile index 6f1430b00a..6073e6ea00 100644 --- a/lib/observer/test/Makefile +++ b/lib/observer/test/Makefile @@ -53,7 +53,7 @@ EBIN = . make_emakefile: $(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) \ - $(MODULES) >> $(EMAKEFILE) + $(MODULES) > $(EMAKEFILE) tests debug opt: make_emakefile cd $(ERL_TOP)/lib/test_server/src && \ @@ -80,7 +80,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DATA) observer.spec observer.dynspec $(EMAKEFILE) \ + $(INSTALL_DATA) observer.spec $(EMAKEFILE) \ $(COVERFILE) $(ERL_FILES) \ $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/observer/test/crashdump_viewer_SUITE.erl b/lib/observer/test/crashdump_viewer_SUITE.erl index fcf383dc2e..fdc4a2f1ff 100644 --- a/lib/observer/test/crashdump_viewer_SUITE.erl +++ b/lib/observer/test/crashdump_viewer_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2010. All Rights Reserved. +%% Copyright Ericsson AB 2003-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,12 +20,13 @@ -module(crashdump_viewer_SUITE). %% Test functions --export([all/1,translate/1,start/1,fini/1,load_file/1, +-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, + translate/1,start/1,fini/1,load_file/1, non_existing/1,not_a_crashdump/1,old_crashdump/1]). -export([init_per_suite/1, end_per_suite/1]). -export([init_per_testcase/2, end_per_testcase/2]). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include_lib("kernel/include/file.hrl"). @@ -46,16 +47,28 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> - [translate,{conf,start,[load_file,non_existing,not_a_crashdump, - old_crashdump],fini}]. +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> + [translate, load_file, non_existing, not_a_crashdump, + old_crashdump]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_suite(doc) -> ["Create a lot of crashdumps which can be used in the testcases below"]; init_per_suite(Config) when is_list(Config) -> Dog = ?t:timetrap(?default_timeout), application:start(inets), % will be using the http client later - http:set_options([{ipv6,disabled}]), + httpc:set_options([{ipfamily,inet6fb4}]), DataDir = ?config(data_dir,Config), Rels = [R || R <- [r12b,r13b], ?t:is_release_available(R)] ++ [current], io:format("Creating crash dumps for the following releases: ~p", [Rels]), @@ -99,7 +112,7 @@ start(Config) when is_list(Config) -> undefined = whereis(crashdump_viewer_server), undefined = whereis(web_tool), Url = cdv_url(Port,"start_page"), - {error,_} = http:request(get,{Url,[]},[],[]), + {error,_} = httpc:request(Url), % exit(whereis(httpc_manager),kill), ?t:timetrap_cancel(AngryDog), ok. @@ -233,7 +246,7 @@ cdv_url(Port,Link) -> "http://localhost:" ++ Port ++ "/cdv_erl/crashdump_viewer/" ++ Link. request_sync(Method,HTTPReqCont) -> - case http:request(Method, + case httpc:request(Method, HTTPReqCont, [{timeout,30000}], [{full_result, false}]) of @@ -241,13 +254,13 @@ request_sync(Method,HTTPReqCont) -> Html; {ok,{Code,Html}} -> io:format("~s\n", [Html]), - io:format("Received ~w from http:request(...) with\nMethod=~w\n" + io:format("Received ~w from httpc:request(...) with\nMethod=~w\n" "HTTPReqCont=~p\n", [Code,Method,HTTPReqCont]), ?t:fail(); Other -> io:format( - "Received ~w from http:request(...) with\nMethod=~w\n" + "Received ~w from httpc:request(...) with\nMethod=~w\n" "HTTPReqCont=~p\n", [Other,Method,HTTPReqCont]), ?t:fail() @@ -401,16 +414,17 @@ special(Port,File) -> _ -> ok end; - ".250atoms" -> - Html1 = contents(Port,"atoms"), - NextLink1 = next_link(Html1), - "Atoms" = title(Html1), - Html2 = contents(Port,NextLink1), - NextLink2 = next_link(Html2), - "Atoms" = title(Html2), - Html3 = contents(Port,NextLink2), - "" = next_link(Html3), - "Atoms" = title(Html3); + %%! No longer needed - all atoms are shown on one page!! + %% ".250atoms" -> + %% Html1 = contents(Port,"atoms"), + %% NextLink1 = next_link(Html1), + %% "Atoms" = title(Html1), + %% Html2 = contents(Port,NextLink1), + %% NextLink2 = next_link(Html2), + %% "Atoms" = title(Html2), + %% Html3 = contents(Port,NextLink2), + %% "" = next_link(Html3), + %% "Atoms" = title(Html3); _ -> ok end, @@ -483,27 +497,27 @@ expand_binary_link(Html) -> end. -next_link(Html) -> - case Html of - "<A HREF=\"./next?pos=" ++ Rest -> - "next?pos=" ++ string:sub_word(Rest,1,$"); - [_H|T] -> - next_link(T); - [] -> - [] - end. +%% next_link(Html) -> +%% case Html of +%% "<A HREF=\"./next?pos=" ++ Rest -> +%% "next?pos=" ++ string:sub_word(Rest,1,$"); +%% [_H|T] -> +%% next_link(T); +%% [] -> +%% [] +%% end. toggle_menu(Port) -> - Html = contents(Port,"toggle?index=10"), + Html = contents(Port,"toggle?index=4"), check_toggle(Html). check_toggle(Html) -> case Html of - "<A HREF=\"./toggle?index=10\"><IMG SRC=\"/crashdump_viewer/collapsd.gif\"" ++ _ -> + "<A HREF=\"./toggle?index=4\"><IMG SRC=\"/crashdump_viewer/collapsd.gif\"" ++ _ -> collapsed; - "<A HREF=\"./toggle?index=10\"><IMG SRC=\"/crashdump_viewer/exploded.gif\"" ++ _ -> + "<A HREF=\"./toggle?index=4\"><IMG SRC=\"/crashdump_viewer/exploded.gif\"" ++ _ -> exploded; [_H|T] -> check_toggle(T) @@ -530,10 +544,10 @@ expand_link(Html) -> port_details(Port) -> - Port1 = contents(Port,"ports?port=Port<0.1>"), + Port1 = contents(Port,"port?port=Port<0.1>"), "#Port<0.1>" = title(Port1), - Port0 = contents(Port,"ports?port=Port<0.0>"), + Port0 = contents(Port,"port?port=Port<0.0>"), "Could not find port: #Port<0.0>" = title(Port0). is_truncated(File) -> @@ -655,7 +669,7 @@ rename(From,To) -> end. check_complete(File) -> - check_complete1(File,5). + check_complete1(File,10). check_complete1(_File,0) -> {error,enoent}; diff --git a/lib/observer/test/etop_SUITE.erl b/lib/observer/test/etop_SUITE.erl index 54f4a78e69..ab2a6f5d18 100644 --- a/lib/observer/test/etop_SUITE.erl +++ b/lib/observer/test/etop_SUITE.erl @@ -20,22 +20,42 @@ -module(etop_SUITE). %% Test functions --export([all/1,text/1,text_tracing_off/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2,text/1,text_tracing_off/1]). +-export([init_per_testcase/2, end_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(1)). init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. -all(suite) -> [text,text_tracing_off]. +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> + [text, text_tracing_off]. + +groups() -> + []. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + text(suite) -> []; diff --git a/lib/observer/test/observer.cover b/lib/observer/test/observer.cover index 47770ba839..fafb718840 100644 --- a/lib/observer/test/observer.cover +++ b/lib/observer/test/observer.cover @@ -1,2 +1,4 @@ -{exclude,[multitrace]}. -{include,[observer_backend]}. +{incl_app,observer,details}. + +{excl_mods,observer,[multitrace]}. +{incl_mods,observer,[observer_backend]}. diff --git a/lib/observer/test/observer.spec b/lib/observer/test/observer.spec index 801eb80607..3b4b5da28c 100644 --- a/lib/observer/test/observer.spec +++ b/lib/observer/test/observer.spec @@ -1,2 +1 @@ -{topcase, {dir, "../observer_test"}}. - +{suites,"../observer_test",all}. diff --git a/lib/observer/test/observer_SUITE.erl b/lib/observer/test/observer_SUITE.erl index 3e9522c7a4..46d4612706 100644 --- a/lib/observer/test/observer_SUITE.erl +++ b/lib/observer/test/observer_SUITE.erl @@ -18,10 +18,11 @@ %% -module(observer_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %% Test server specific exports --export([all/1]). +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). %% Test cases @@ -39,9 +40,27 @@ end_per_testcase(_Case, Config) -> ?t:timetrap_cancel(Dog), ok. -all(suite) -> +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> [app_file]. +groups() -> + []. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + app_file(suite) -> []; app_file(doc) -> diff --git a/lib/observer/test/ttb_SUITE.erl b/lib/observer/test/ttb_SUITE.erl index 6da5e36b29..14bd1e9c33 100644 --- a/lib/observer/test/ttb_SUITE.erl +++ b/lib/observer/test/ttb_SUITE.erl @@ -21,14 +21,16 @@ -compile(export_all). %% Test functions --export([all/1,file/1,file_no_pi/1,file_fetch/1,wrap/1,wrap_merge/1, +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, + init_per_group/2,end_per_group/2, + file/1,file_no_pi/1,file_fetch/1,wrap/1,wrap_merge/1, wrap_merge_fetch_format/1,write_config1/1,write_config2/1, write_config3/1,history/1,write_trace_info/1,seq_trace/1, diskless/1,otp_4967_1/1,otp_4967_2/1]). --export([init_per_testcase/2, fin_per_testcase/2]). +-export([init_per_testcase/2, end_per_testcase/2]). -export([foo/0]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(1)). @@ -36,15 +38,34 @@ init_per_testcase(_Case, Config) -> ttb:stop(), ?line Dog=test_server:timetrap(?default_timeout), [{watchdog, Dog}|Config]. -fin_per_testcase(_Case, Config) -> +end_per_testcase(_Case, Config) -> Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), ok. -all(suite) -> [file,file_no_pi,file_fetch,wrap,wrap_merge, - wrap_merge_fetch_format,write_config1,write_config2, - write_config3,history,write_trace_info,seq_trace,diskless, - otp_4967_1,otp_4967_2]. +suite() -> [{ct_hooks,[ts_install_cth]}]. + +all() -> + [file, file_no_pi, file_fetch, wrap, wrap_merge, + wrap_merge_fetch_format, write_config1, write_config2, + write_config3, history, write_trace_info, seq_trace, + diskless, otp_4967_1, otp_4967_2]. + +groups() -> + []. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + file(suite) -> []; |