diff options
author | Raimo Niskanen <[email protected]> | 2015-03-13 09:18:14 +0100 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2015-03-13 09:18:14 +0100 |
commit | 0b5ae3e554c7c1220281df138fb0cefb76860427 (patch) | |
tree | 0309b66144790b24d1704b00ab2a8d732265cb46 /lib | |
parent | e0e056a62c240542decac2e2b3765a5399efae62 (diff) | |
parent | c7df506f66f605948b5b45a305d68cfc430916d6 (diff) | |
download | otp-0b5ae3e554c7c1220281df138fb0cefb76860427.tar.gz otp-0b5ae3e554c7c1220281df138fb0cefb76860427.tar.bz2 otp-0b5ae3e554c7c1220281df138fb0cefb76860427.zip |
Merge branch 'maint'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kernel/test/inet_SUITE.erl | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl index 849013ac79..44a32fc1ec 100644 --- a/lib/kernel/test/inet_SUITE.erl +++ b/lib/kernel/test/inet_SUITE.erl @@ -88,10 +88,30 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. +init_per_testcase(lookup_bad_search_option, Config) -> + Db = inet_db, + Key = res_lookup, + %% The bad option can not enter through inet_db:set_lookup/1, + %% but through e.g .inetrc. + Prev = ets:lookup(Db, Key), + ets:delete(Db, Key), + ets:insert(Db, {Key,[lookup_bad_search_option]}), + ?t:format("Misconfigured resolver lookup order", []), + Dog = test_server:timetrap(test_server:seconds(60)), + [{Key,Prev},{watchdog,Dog}|Config]; init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), [{watchdog,Dog}|Config]. +end_per_testcase(lookup_bad_search_option, Config) -> + Dog = ?config(watchdog, Config), + test_server:timetrap_cancel(Dog), + Db = inet_db, + Key = res_lookup, + Prev = ?config(Key, Config), + ets:delete(Db, Key), + ets:insert(Db, Prev), + ?t:format("Restored resolver lookup order", []); end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). @@ -915,10 +935,8 @@ lookup_bad_search_option(suite) -> lookup_bad_search_option(doc) -> ["Test lookup with erroneously configured lookup option (OTP-12133)"]; lookup_bad_search_option(Config) when is_list(Config) -> - Db = inet_db, - %% The bad option can not enter through inet_db:set_lookup/1, - %% but through e.g .inetrc. - ets:insert(Db, {res_lookup,[lookup_bad_search_option]}), + %% Manipulation of resolver config is done in init_per_testcase + %% and end_per_testcase to ensure cleanup. {ok,Hostname} = inet:gethostname(), {ok,_Hent} = inet:gethostbyname(Hostname), % Will hang loop for this bug ok. |