From 240533939c9ecd8f07c9f5a6619182bb8e772a86 Mon Sep 17 00:00:00 2001 From: Ali Sabil Date: Thu, 13 Jun 2013 11:47:24 +0200 Subject: Use ct_helper for retrieving the loopack interface MTU --- test/http_SUITE.erl | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'test/http_SUITE.erl') diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl index 01da7b2..39b30db 100644 --- a/test/http_SUITE.erl +++ b/test/http_SUITE.erl @@ -420,15 +420,6 @@ body_to_chunks(ChunkSize, Body, Acc) -> body_to_chunks(ChunkSize, Rest, [<< ChunkSizeBin/binary, "\r\n", Chunk/binary, "\r\n" >>|Acc]). -get_mtu() -> - {ok, Interfaces} = inet:getiflist(), - [LocalInterface | _ ] = lists:filter(fun(Interface) -> - {ok, [{flags, Flags}]} = inet:ifget(Interface, [flags]), - lists:member(loopback, Flags) - end, Interfaces), - {ok, [{mtu, MTU}]} = inet:ifget(LocalInterface, [mtu]), - MTU. - %% Tests. check_raw_status(Config) -> @@ -526,7 +517,7 @@ chunked_response(Config) -> %% Check if sending requests whose size is around the MTU breaks something. echo_body(Config) -> Client = ?config(client, Config), - MTU = get_mtu(), + MTU = ct_helper:get_loopback_mtu(), _ = [begin Body = list_to_binary(lists:duplicate(Size, $a)), {ok, Client2} = cowboy_client:request(<<"POST">>, -- cgit v1.2.3