From f0d51083a6cda851ed60578a7679e20b1fe5678a Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Sun, 29 Mar 2015 01:29:23 +0100 Subject: Replace erlang:now() usage in emulator suite --- erts/emulator/test/decode_packet_SUITE.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'erts/emulator/test/decode_packet_SUITE.erl') diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index 2baf91cf29..330ad299e5 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -52,7 +52,9 @@ end_per_group(_GroupName, Config) -> init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> - Seed = {S1,S2,S3} = now(), + Seed = {S1,S2,S3} = {erlang:monotonic_time(), + erlang:time_offset(), + erlang:unique_integer()}, random:seed(S1,S2,S3), io:format("*** SEED: ~p ***\n", [Seed]), Dog=?t:timetrap(?t:minutes(1)), -- cgit v1.2.1 From 738c34d4bb8f1a3811acd00af8c6c12107f8315b Mon Sep 17 00:00:00 2001 From: Bruce Yinhe Date: Thu, 18 Jun 2015 11:31:02 +0200 Subject: Change license text to APLv2 --- erts/emulator/test/decode_packet_SUITE.erl | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'erts/emulator/test/decode_packet_SUITE.erl') diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index 330ad299e5..6a5ca20ac3 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -3,16 +3,17 @@ %% %% Copyright Ericsson AB 2008-2013. 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 -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at %% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. %% %% %CopyrightEnd% %% -- cgit v1.2.1 From 71ddd8c1aba0478fe5aa07bdc8f9e6a86515bb11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 9 Dec 2015 15:04:28 +0100 Subject: Emulator test suite: Replace use of 'random' with 'rand' --- erts/emulator/test/decode_packet_SUITE.erl | 47 ++++++++++++++---------------- 1 file changed, 22 insertions(+), 25 deletions(-) (limited to 'erts/emulator/test/decode_packet_SUITE.erl') diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index 6a5ca20ac3..65ae94d0dc 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -53,11 +53,8 @@ end_per_group(_GroupName, Config) -> init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> - Seed = {S1,S2,S3} = {erlang:monotonic_time(), - erlang:time_offset(), - erlang:unique_integer()}, - random:seed(S1,S2,S3), - io:format("*** SEED: ~p ***\n", [Seed]), + rand:seed(exsplus), + io:format("*** SEED: ~p ***\n", [rand:export_seed()]), Dog=?t:timetrap(?t:minutes(1)), [{watchdog, Dog}|Config]. @@ -136,7 +133,7 @@ pack(Type,Body,Rest,BitOffs) -> {Packet,Unpacked} = pack(Type,Body), %% Make Bin a sub-bin with an arbitrary bitoffset within Orig - Prefix = random:uniform(1 bsl BitOffs) - 1, + Prefix = rand:uniform(1 bsl BitOffs) - 1, Orig = <>, <<_:BitOffs,Bin/bits>> = Orig, {Bin,Unpacked,Orig}. @@ -151,13 +148,13 @@ pack(4,Bin) -> Psz = byte_size(Bin), {<>, Bin}; pack(asn1,Bin) -> - Ident = case random:uniform(3) of + Ident = case rand:uniform(3) of 1 -> <<17>>; 2 -> <<16#1f,16#81,17>>; 3 -> <<16#1f,16#81,16#80,16#80,17>> end, Psz = byte_size(Bin), - Length = case random:uniform(4) of + Length = case rand:uniform(4) of 1 when Psz < 128 -> <>; R when R=<2 andalso Psz < 16#10000 -> @@ -177,42 +174,42 @@ pack(sunrm,Bin) -> {Res,Res}; pack(cdr,Bin) -> GIOP = <<"GIOP">>, - Major = random:uniform(256) - 1, - Minor = random:uniform(256) - 1, - MType = random:uniform(256) - 1, + Major = rand:uniform(256) - 1, + Minor = rand:uniform(256) - 1, + MType = rand:uniform(256) - 1, Psz = byte_size(Bin), - Res = case random:uniform(2) of + Res = case rand:uniform(2) of 1 -> <>; 2 -> <> end, {Res,Res}; pack(fcgi,Bin) -> Ver = 1, - Type = random:uniform(256) - 1, - Id = random:uniform(65536) - 1, - PaddSz = random:uniform(16) - 1, + Type = rand:uniform(256) - 1, + Id = rand:uniform(65536) - 1, + PaddSz = rand:uniform(16) - 1, Psz = byte_size(Bin), - Reserv = random:uniform(256) - 1, + Reserv = rand:uniform(256) - 1, Padd = case PaddSz of 0 -> <<>>; - _ -> list_to_binary([random:uniform(256)-1 + _ -> list_to_binary([rand:uniform(256)-1 || _<- lists:seq(1,PaddSz)]) end, Res = <>, {<>, Res}; pack(tpkt,Bin) -> Ver = 3, - Reserv = random:uniform(256) - 1, + Reserv = rand:uniform(256) - 1, Size = byte_size(Bin) + 4, Res = <>, {Res, Res}; pack(ssl_tls,Bin) -> - Content = case (random:uniform(256) - 1) of + Content = case (rand:uniform(256) - 1) of C when C<128 -> C; _ -> v2hello end, - Major = random:uniform(256) - 1, - Minor = random:uniform(256) - 1, + Major = rand:uniform(256) - 1, + Minor = rand:uniform(256) - 1, pack_ssl(Content,Major,Minor,Bin). pack_ssl(Content, Major, Minor, Body) -> @@ -371,10 +368,10 @@ http_do({Bin,[{_Line,PL,PB}|Tail]}, Type) -> ?line {ok, PB, Rest} = decode_pkt(http_with_bin(Type),Bin), %% Same tests again but as SubBin - PreLen = random:uniform(64), - Prefix = random:uniform(1 bsl PreLen) - 1, - SufLen = random:uniform(64), - Suffix = random:uniform(1 bsl SufLen) - 1, + PreLen = rand:uniform(64), + Prefix = rand:uniform(1 bsl PreLen) - 1, + SufLen = rand:uniform(64), + Suffix = rand:uniform(1 bsl SufLen) - 1, Orig = <>, BinLen = bit_size(Bin), <<_:PreLen, SubBin:BinLen/bits, _/bits>> = Orig, % Make SubBin -- cgit v1.2.1 From 03fcb7dabf8861e60ffab4121a909b347bccfec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 15 Feb 2016 15:33:12 +0100 Subject: Eliminate use of test_server.hrl and test_server_line.hrl As a first step to removing the test_server application as as its own separate application, change the inclusion of test_server.hrl to an inclusion of ct.hrl and remove the inclusion of test_server_line.hrl. --- erts/emulator/test/decode_packet_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/emulator/test/decode_packet_SUITE.erl') diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index 65ae94d0dc..58a8d390f0 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -22,7 +22,7 @@ -module(decode_packet_SUITE). --include_lib("test_server/include/test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2, -- cgit v1.2.1 From c062dfc485ad0d51d648701950f77ef8f51d4f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 8 Mar 2016 19:35:31 +0100 Subject: Modernize use of timetraps --- erts/emulator/test/decode_packet_SUITE.erl | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'erts/emulator/test/decode_packet_SUITE.erl') diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index 58a8d390f0..213234af52 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -24,13 +24,14 @@ -include_lib("common_test/include/ct.hrl"). --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2, +-export([all/0, suite/0,groups/0, init_per_testcase/2,end_per_testcase/2, basic/1, packet_size/1, neg/1, http/1, line/1, ssl/1, otp_8536/1, otp_9389/1, otp_9389_line/1]). -suite() -> [{ct_hooks,[ts_install_cth]}]. +suite() -> + [{ct_hooks,[ts_install_cth]}, + {timetrap, {minutes, 1}}]. all() -> [basic, packet_size, neg, http, line, ssl, otp_8536, @@ -39,28 +40,13 @@ all() -> groups() -> []. -init_per_suite(Config) -> - Config. - -end_per_suite(_Config) -> - ok. - -init_per_group(_GroupName, Config) -> - Config. - -end_per_group(_GroupName, Config) -> - Config. - - init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> rand:seed(exsplus), io:format("*** SEED: ~p ***\n", [rand:export_seed()]), - Dog=?t:timetrap(?t:minutes(1)), - [{watchdog, Dog}|Config]. + Config. -end_per_testcase(_Func, Config) -> - Dog=?config(watchdog, Config), - ?t:timetrap_cancel(Dog). +end_per_testcase(_Func, _Config) -> + ok. basic(doc) -> []; basic(suite) -> []; -- cgit v1.2.1 From 33b0c5f37b7b5baa42d4999d1a2be32470fb1bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Thu, 10 Mar 2016 17:59:23 +0100 Subject: Eliminate use of doc and suite clauses Those clause are obsolete and never used by common_test. --- erts/emulator/test/decode_packet_SUITE.erl | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'erts/emulator/test/decode_packet_SUITE.erl') diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index 213234af52..08e2448146 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -48,8 +48,6 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> end_per_testcase(_Func, _Config) -> ok. -basic(doc) -> []; -basic(suite) -> []; basic(Config) when is_list(Config) -> ?line Packet = <<101,22,203,54,175>>, ?line Rest = <<123,34,0,250>>, @@ -213,8 +211,6 @@ pack_ssl(Content, Major, Minor, Body) -> {Res, {ssl_tls,[],C,{Major,Minor}, Data}}. -packet_size(doc) -> []; -packet_size(suite) -> []; packet_size(Config) when is_list(Config) -> ?line Packet = <<101,22,203,54,175>>, ?line Rest = <<123,34,0,250>>, @@ -264,8 +260,6 @@ packet_size(Config) when is_list(Config) -> ok. -neg(doc) -> []; -neg(suite) -> []; neg(Config) when is_list(Config) -> ?line Bin = <<"dummy">>, Fun = fun()->dummy end, @@ -294,8 +288,6 @@ neg(Config) when is_list(Config) -> ok. -http(doc) -> []; -http(suite) -> []; http(Config) when is_list(Config) -> ?line <<"foo">> = http_do(http_request("foo")), ?line <<" bar">> = http_do(http_request(" bar")), @@ -472,8 +464,6 @@ http_uri_variants() -> {"something_else", "something_else", <<"something_else">>}]. -line(doc) -> []; -line(suite) -> []; line(Config) when is_list(Config) -> Text = <<"POST /invalid/url HTTP/1.1\r\n" "Connection: close\r\n" @@ -524,8 +514,6 @@ find_in_binary(Byte, Bin) -> P -> P end. -ssl(doc) -> []; -ssl(suite) -> []; ssl(Config) when is_list(Config) -> Major = 34, Minor = 17, @@ -541,7 +529,7 @@ ssl(Config) when is_list(Config) -> F(v2hello), ok. -otp_8536(doc) -> ["Corrupt sub-binary-strings from httph_bin"]; +%% Corrupt sub-binary-strings from httph_bin otp_8536(Config) when is_list(Config) -> lists:foreach(fun otp_8536_do/1, lists:seq(1,50)), ok. @@ -570,8 +558,7 @@ decode_pkt(Type,Bin,Opts) -> %%io:format(" -> ~p\n",[Res]), Res. -otp_9389(doc) -> ["Verify line_length works correctly for HTTP headers"]; -otp_9389(suite) -> []; +%% Verify line_length works correctly for HTTP headers otp_9389(Config) when is_list(Config) -> Opts = [{packet_size, 16384}, {line_length, 3000}], Pkt = list_to_binary(["GET / HTTP/1.1\r\nHost: localhost\r\nLink: /", @@ -590,8 +577,7 @@ otp_9389(Config) when is_list(Config) -> erlang:decode_packet(httph, Rest3, Opts), ok. -otp_9389_line(doc) -> ["Verify packet_size works correctly for line mode"]; -otp_9389_line(suite) -> []; +%% Verify packet_size works correctly for line mode otp_9389_line(Config) when is_list(Config) -> Opts = [{packet_size, 20}], Line1 = <<"0123456789012345678\n">>, -- cgit v1.2.1 From 20ae6a9238d3fd09587bd3f4179a8ae25f1e3aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Thu, 10 Mar 2016 18:19:16 +0100 Subject: Remove ?line macros --- erts/emulator/test/decode_packet_SUITE.erl | 458 ++++++++++++++--------------- 1 file changed, 229 insertions(+), 229 deletions(-) (limited to 'erts/emulator/test/decode_packet_SUITE.erl') diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index 08e2448146..ad592f7147 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -25,8 +25,8 @@ -include_lib("common_test/include/ct.hrl"). -export([all/0, suite/0,groups/0, - init_per_testcase/2,end_per_testcase/2, - basic/1, packet_size/1, neg/1, http/1, line/1, ssl/1, otp_8536/1, + init_per_testcase/2,end_per_testcase/2, + basic/1, packet_size/1, neg/1, http/1, line/1, ssl/1, otp_8536/1, otp_9389/1, otp_9389_line/1]). suite() -> @@ -49,40 +49,40 @@ end_per_testcase(_Func, _Config) -> ok. basic(Config) when is_list(Config) -> - ?line Packet = <<101,22,203,54,175>>, - ?line Rest = <<123,34,0,250>>, - ?line Bin = <>, - ?line {ok, Bin, <<>>} = decode_pkt(raw,Bin), + Packet = <<101,22,203,54,175>>, + Rest = <<123,34,0,250>>, + Bin = <>, + {ok, Bin, <<>>} = decode_pkt(raw,Bin), - ?line {more, 5+1} = decode_pkt(1,<<5,1,2,3,4>>), - ?line {more, 5+2} = decode_pkt(2,<<0,5,1,2,3,4>>), - ?line {more, 5+4} = decode_pkt(4,<<0,0,0,5,1,2,3,4>>), + {more, 5+1} = decode_pkt(1,<<5,1,2,3,4>>), + {more, 5+2} = decode_pkt(2,<<0,5,1,2,3,4>>), + {more, 5+4} = decode_pkt(4,<<0,0,0,5,1,2,3,4>>), - ?line {more, undefined} = decode_pkt(1,<<>>), - ?line {more, undefined} = decode_pkt(2,<<0>>), - ?line {more, undefined} = decode_pkt(4,<<0,0,0>>), + {more, undefined} = decode_pkt(1,<<>>), + {more, undefined} = decode_pkt(2,<<0>>), + {more, undefined} = decode_pkt(4,<<0,0,0>>), Types = [1,2,4,asn1,sunrm,cdr,fcgi,tpkt,ssl_tls], %% Run tests for different header types and bit offsets. lists:foreach(fun({Type,Bits})->basic_pack(Type,Packet,Rest,Bits), - more_length(Type,Packet,Bits) end, - [{T,B} || T<-Types, B<-lists:seq(0,32)]), + more_length(Type,Packet,Bits) end, + [{T,B} || T<-Types, B<-lists:seq(0,32)]), ok. basic_pack(Type,Body,Rest,BitOffs) -> - ?line {Bin,Unpacked,_} = pack(Type,Body,Rest,BitOffs), - ?line {ok, Unpacked, Rest} = decode_pkt(Type,Bin), + {Bin,Unpacked,_} = pack(Type,Body,Rest,BitOffs), + {ok, Unpacked, Rest} = decode_pkt(Type,Bin), case Rest of - <<>> -> ok; - _ -> - ?line <<_:1,NRest/bits>> = Rest, - basic_pack(Type,Body,NRest,BitOffs) + <<>> -> ok; + _ -> + <<_:1,NRest/bits>> = Rest, + basic_pack(Type,Body,NRest,BitOffs) end. more_length(Type,Body,BitOffs) -> - ?line {Bin,_,_} = pack(Type,Body,<<>>,BitOffs), + {Bin,_,_} = pack(Type,Body,<<>>,BitOffs), HdrSize = byte_size(Bin) - byte_size(Body), more_length_do(Type,HdrSize,Bin,byte_size(Bin)). @@ -91,17 +91,17 @@ more_length_do(_,_,_,0) -> more_length_do(Type,HdrSize,Bin,Size) -> TrySize = (Size*3) div 4, NSize = if TrySize < HdrSize -> Size - 1; - true -> TrySize - end, + true -> TrySize + end, {B1,_} = split_binary(Bin,NSize), - ?line {more, Length} = decode_pkt(Type,B1), + {more, Length} = decode_pkt(Type,B1), case Length of - L when L=:=byte_size(Bin) -> ok; - undefined when NSize ok + L when L=:=byte_size(Bin) -> ok; + undefined when NSize ok end, more_length_do(Type,HdrSize,Bin,NSize). - + pack(Type,Packet,Rest) -> {Bin,Unpacked} = pack(Type,Packet), @@ -133,28 +133,28 @@ pack(4,Bin) -> {<>, Bin}; pack(asn1,Bin) -> Ident = case rand:uniform(3) of - 1 -> <<17>>; - 2 -> <<16#1f,16#81,17>>; - 3 -> <<16#1f,16#81,16#80,16#80,17>> - end, + 1 -> <<17>>; + 2 -> <<16#1f,16#81,17>>; + 3 -> <<16#1f,16#81,16#80,16#80,17>> + end, Psz = byte_size(Bin), Length = case rand:uniform(4) of - 1 when Psz < 128 -> - <>; - R when R=<2 andalso Psz < 16#10000 -> - <<16#82,Psz:16>>; - R when R=<3 andalso Psz < 16#1000000 -> - <<16#83,Psz:24>>; - _ when Psz < 16#100000000 -> - <<16#84,Psz:32>> - end, + 1 when Psz < 128 -> + <>; + R when R=<2 andalso Psz < 16#10000 -> + <<16#82,Psz:16>>; + R when R=<3 andalso Psz < 16#1000000 -> + <<16#83,Psz:24>>; + _ when Psz < 16#100000000 -> + <<16#84,Psz:32>> + end, Res = <>, {Res,Res}; pack(sunrm,Bin) -> Psz = byte_size(Bin), Res = if Psz < 16#80000000 -> - <> - end, + <> + end, {Res,Res}; pack(cdr,Bin) -> GIOP = <<"GIOP">>, @@ -163,9 +163,9 @@ pack(cdr,Bin) -> MType = rand:uniform(256) - 1, Psz = byte_size(Bin), Res = case rand:uniform(2) of - 1 -> <>; - 2 -> <> - end, + 1 -> <>; + 2 -> <> + end, {Res,Res}; pack(fcgi,Bin) -> Ver = 1, @@ -175,10 +175,10 @@ pack(fcgi,Bin) -> Psz = byte_size(Bin), Reserv = rand:uniform(256) - 1, Padd = case PaddSz of - 0 -> <<>>; - _ -> list_to_binary([rand:uniform(256)-1 - || _<- lists:seq(1,PaddSz)]) - end, + 0 -> <<>>; + _ -> list_to_binary([rand:uniform(256)-1 + || _<- lists:seq(1,PaddSz)]) + end, Res = <>, {<>, Res}; pack(tpkt,Bin) -> @@ -189,149 +189,149 @@ pack(tpkt,Bin) -> {Res, Res}; pack(ssl_tls,Bin) -> Content = case (rand:uniform(256) - 1) of - C when C<128 -> C; - _ -> v2hello - end, + C when C<128 -> C; + _ -> v2hello + end, Major = rand:uniform(256) - 1, Minor = rand:uniform(256) - 1, pack_ssl(Content,Major,Minor,Bin). pack_ssl(Content, Major, Minor, Body) -> case Content of - v2hello -> - Size = byte_size(Body), - Res = <<1:1,(Size+3):15, 1:8, Major:8, Minor:8, Body/binary>>, - C = 22, - Data = <<1:8, (Size+2):24, Major:8, Minor:8, Body/binary>>; - C when is_integer(C) -> - Size = byte_size(Body), - Res = <>, - Data = Body + v2hello -> + Size = byte_size(Body), + Res = <<1:1,(Size+3):15, 1:8, Major:8, Minor:8, Body/binary>>, + C = 22, + Data = <<1:8, (Size+2):24, Major:8, Minor:8, Body/binary>>; + C when is_integer(C) -> + Size = byte_size(Body), + Res = <>, + Data = Body end, {Res, {ssl_tls,[],C,{Major,Minor}, Data}}. packet_size(Config) when is_list(Config) -> - ?line Packet = <<101,22,203,54,175>>, - ?line Rest = <<123,34,0,250>>, + Packet = <<101,22,203,54,175>>, + Rest = <<123,34,0,250>>, F = fun({Type,Max})-> - ?line {Bin,Unpacked} = pack(Type,Packet,Rest), - ?line case decode_pkt(Type,Bin,[{packet_size,Max}]) of - {ok,Unpacked,Rest} when Max=:=0; Max>=byte_size(Packet) -> - ok; - {error,_} when Max - ok; - {error,_} when Type=:=fcgi, Max=/=0 -> - %% packet includes random amount of padding - ok - end - end, - ?line lists:foreach(F, [{T,D} || T<-[1,2,4,asn1,sunrm,cdr,fcgi,tpkt,ssl_tls], - D<-lists:seq(0, byte_size(Packet)*2)]), + {Bin,Unpacked} = pack(Type,Packet,Rest), + case decode_pkt(Type,Bin,[{packet_size,Max}]) of + {ok,Unpacked,Rest} when Max=:=0; Max>=byte_size(Packet) -> + ok; + {error,_} when Max + ok; + {error,_} when Type=:=fcgi, Max=/=0 -> + %% packet includes random amount of padding + ok + end + end, + lists:foreach(F, [{T,D} || T<-[1,2,4,asn1,sunrm,cdr,fcgi,tpkt,ssl_tls], + D<-lists:seq(0, byte_size(Packet)*2)]), %% Test OTP-8102, "negative" 4-byte sizes. lists:foreach(fun(Size) -> - ?line {error,_} = decode_pkt(4,<>) - end, - lists:seq(-10,-1)), + {error,_} = decode_pkt(4,<>) + end, + lists:seq(-10,-1)), %% Test OTP-9389, long HTTP header lines. Opts = [{packet_size, 128}], Pkt = list_to_binary(["GET / HTTP/1.1\r\nHost: localhost\r\nLink: /", string:chars($Y, 64), "\r\n\r\n"]), <> = Pkt, - ?line {ok, {http_request,'GET',{abs_path,"/"},{1,1}}, Rest1} = - erlang:decode_packet(http, Pkt1, Opts), - ?line {ok, {http_header,_,'Host',_,"localhost"}, Rest2} = - erlang:decode_packet(httph, Rest1, Opts), - ?line {more, undefined} = erlang:decode_packet(httph, Rest2, Opts), - ?line {ok, {http_header,_,"Link",_,_}, _} = - erlang:decode_packet(httph, list_to_binary([Rest2, Pkt2]), Opts), + {ok, {http_request,'GET',{abs_path,"/"},{1,1}}, Rest1} = + erlang:decode_packet(http, Pkt1, Opts), + {ok, {http_header,_,'Host',_,"localhost"}, Rest2} = + erlang:decode_packet(httph, Rest1, Opts), + {more, undefined} = erlang:decode_packet(httph, Rest2, Opts), + {ok, {http_header,_,"Link",_,_}, _} = + erlang:decode_packet(httph, list_to_binary([Rest2, Pkt2]), Opts), Pkt3 = list_to_binary(["GET / HTTP/1.1\r\nHost: localhost\r\nLink: /", string:chars($Y, 129), "\r\n\r\n"]), - ?line {ok, {http_request,'GET',{abs_path,"/"},{1,1}}, Rest3} = - erlang:decode_packet(http, Pkt3, Opts), - ?line {ok, {http_header,_,'Host',_,"localhost"}, Rest4} = - erlang:decode_packet(httph, Rest3, Opts), - ?line {error, invalid} = erlang:decode_packet(httph, Rest4, Opts), + {ok, {http_request,'GET',{abs_path,"/"},{1,1}}, Rest3} = + erlang:decode_packet(http, Pkt3, Opts), + {ok, {http_header,_,'Host',_,"localhost"}, Rest4} = + erlang:decode_packet(httph, Rest3, Opts), + {error, invalid} = erlang:decode_packet(httph, Rest4, Opts), ok. neg(Config) when is_list(Config) -> - ?line Bin = <<"dummy">>, + Bin = <<"dummy">>, Fun = fun()->dummy end, - + BadargF = fun(T,B,Opts)-> {'EXIT',{badarg,_}} = (catch decode_pkt(T,B,Opts)) end, %% Invalid Type args lists:foreach(fun(T)-> BadargF(T,Bin,[]) end, - [3,-1,5,2.0,{2},unknown,[],"line",Bin,Fun,self()]), + [3,-1,5,2.0,{2},unknown,[],"line",Bin,Fun,self()]), %% Invalid Bin args lists:foreach(fun(B)-> BadargF(0,B,[]) end, - [3,2.0,unknown,[],"Bin",[Bin],{Bin},Fun,self()]), + [3,2.0,unknown,[],"Bin",[Bin],{Bin},Fun,self()]), %% Invalid options InvOpts = [2,false,self(),Bin,"Options",Fun, - packet_size,{packet_size},{packet_size,0,false}, - {packet_size,-1},{packet_size,100.0},{packet_size,false}, - {line_length,-1},{line_length,100.0},{line_length,false}], + packet_size,{packet_size},{packet_size,0,false}, + {packet_size,-1},{packet_size,100.0},{packet_size,false}, + {line_length,-1},{line_length,100.0},{line_length,false}], lists:foreach(fun(Opt)-> BadargF(0,Bin,Opt), - BadargF(0,Bin,[Opt]), - BadargF(0,Bin,[Opt,{packet_size,1000}]), - BadargF(0,Bin,[{packet_size,1000},Opt]) end, - InvOpts), + BadargF(0,Bin,[Opt]), + BadargF(0,Bin,[Opt,{packet_size,1000}]), + BadargF(0,Bin,[{packet_size,1000},Opt]) end, + InvOpts), ok. http(Config) when is_list(Config) -> - ?line <<"foo">> = http_do(http_request("foo")), - ?line <<" bar">> = http_do(http_request(" bar")), - ?line <<"Hello!">> = http_do(http_response("Hello!")), + <<"foo">> = http_do(http_request("foo")), + <<" bar">> = http_do(http_request(" bar")), + <<"Hello!">> = http_do(http_response("Hello!")), %% Test all known header atoms Val = "dummy value", ValB = list_to_binary(Val), Rest = <<"Rest">>, HdrF = fun(Str,N) -> - ?line StrA = list_to_atom(Str), - ?line StrB = list_to_binary(Str), - ?line Bin = <>, - ?line {ok, {http_header,N,StrA,undefined,Val}, Rest} = decode_pkt(httph,Bin), - ?line {ok, {http_header,N,StrA,undefined,ValB}, Rest} = decode_pkt(httph_bin,Bin), - ?line N + 1 - end, - ?line lists:foldl(HdrF, 1, http_hdr_strings()), + StrA = list_to_atom(Str), + StrB = list_to_binary(Str), + Bin = <>, + {ok, {http_header,N,StrA,undefined,Val}, Rest} = decode_pkt(httph,Bin), + {ok, {http_header,N,StrA,undefined,ValB}, Rest} = decode_pkt(httph_bin,Bin), + N + 1 + end, + lists:foldl(HdrF, 1, http_hdr_strings()), %% Test all known method atoms MethF = fun(Meth) -> - ?line MethA = list_to_atom(Meth), - ?line MethB = list_to_binary(Meth), - ?line Bin = <>, - ?line {ok, {http_request,MethA,{abs_path,"/invalid/url"},{1,0}}, - Rest} = decode_pkt(http,Bin), - ?line {ok, {http_request,MethA,{abs_path,<<"/invalid/url">>},{1,0}}, - Rest} = decode_pkt(http_bin,Bin) - end, - ?line lists:foreach(MethF, http_meth_strings()), + MethA = list_to_atom(Meth), + MethB = list_to_binary(Meth), + Bin = <>, + {ok, {http_request,MethA,{abs_path,"/invalid/url"},{1,0}}, + Rest} = decode_pkt(http,Bin), + {ok, {http_request,MethA,{abs_path,<<"/invalid/url">>},{1,0}}, + Rest} = decode_pkt(http_bin,Bin) + end, + lists:foreach(MethF, http_meth_strings()), %% Test all uri variants UriF = fun({Str,ResL,ResB}) -> - Bin = <<"GET ",(list_to_binary(Str))/binary," HTTP/1.1\r\n",Rest/binary>>, - {ok, {http_request, 'GET', ResL, {1,1}}, Rest} = decode_pkt(http,Bin), - {ok, {http_request, 'GET', ResB, {1,1}}, Rest} = decode_pkt(http_bin,Bin) - end, + Bin = <<"GET ",(list_to_binary(Str))/binary," HTTP/1.1\r\n",Rest/binary>>, + {ok, {http_request, 'GET', ResL, {1,1}}, Rest} = decode_pkt(http,Bin), + {ok, {http_request, 'GET', ResB, {1,1}}, Rest} = decode_pkt(http_bin,Bin) + end, lists:foreach(UriF, http_uri_variants()), %% Response with empty phrase - ?line {ok,{http_response,{1,1},200,[]},<<>>} = decode_pkt(http, <<"HTTP/1.1 200\r\n">>, []), - ?line {ok,{http_response,{1,1},200,<<>>},<<>>} = decode_pkt(http_bin, <<"HTTP/1.1 200\r\n">>, []), + {ok,{http_response,{1,1},200,[]},<<>>} = decode_pkt(http, <<"HTTP/1.1 200\r\n">>, []), + {ok,{http_response,{1,1},200,<<>>},<<>>} = decode_pkt(http_bin, <<"HTTP/1.1 200\r\n">>, []), ok. - + http_with_bin(http) -> http_bin; http_with_bin(httph) -> @@ -342,8 +342,8 @@ http_do(Tup) -> http_do({Bin, []}, _) -> Bin; http_do({Bin,[{_Line,PL,PB}|Tail]}, Type) -> - ?line {ok, PL, Rest} = decode_pkt(Type,Bin), - ?line {ok, PB, Rest} = decode_pkt(http_with_bin(Type),Bin), + {ok, PL, Rest} = decode_pkt(Type,Bin), + {ok, PB, Rest} = decode_pkt(http_with_bin(Type),Bin), %% Same tests again but as SubBin PreLen = rand:uniform(64), @@ -353,77 +353,77 @@ http_do({Bin,[{_Line,PL,PB}|Tail]}, Type) -> Orig = <>, BinLen = bit_size(Bin), <<_:PreLen, SubBin:BinLen/bits, _/bits>> = Orig, % Make SubBin - ?line SubBin = Bin, % just to make sure + SubBin = Bin, % just to make sure - ?line {ok, PL, Rest} = decode_pkt(Type,SubBin), - ?line {ok, PB, Rest} = decode_pkt(http_with_bin(Type),SubBin), + {ok, PL, Rest} = decode_pkt(Type,SubBin), + {ok, PB, Rest} = decode_pkt(http_with_bin(Type),SubBin), http_do({Rest, Tail}, httph). http_request(Msg) -> QnA = [{"POST /invalid/url HTTP/1.1\r\n", - {http_request, 'POST', {abs_path, "/invalid/url" }, {1,1}}, - {http_request, 'POST', {abs_path,<<"/invalid/url">>}, {1,1}}}, - {"Connection: close\r\n", - {http_header,2,'Connection',undefined, "close"}, - {http_header,2,'Connection',undefined,<<"close">>}}, - {"Host\t : localhost:8000\r\n", % white space before : - {http_header,14,'Host',undefined, "localhost:8000"}, - {http_header,14,'Host',undefined,<<"localhost:8000">>}}, - {"User-Agent: perl post\r\n", - {http_header,24,'User-Agent',undefined, "perl post"}, - {http_header,24,'User-Agent',undefined,<<"perl post">>}}, - {"Content-Length: 4\r\n", - {http_header,38,'Content-Length',undefined, "4"}, - {http_header,38,'Content-Length',undefined,<<"4">>}}, - {"Content-Type: text/xml; charset=utf-8\r\n", - {http_header,42,'Content-Type',undefined, "text/xml; charset=utf-8"}, - {http_header,42,'Content-Type',undefined,<<"text/xml; charset=utf-8">>}}, - {"Other-Field: with some text\r\n", - {http_header,0, "Other-Field" ,undefined, "with some text"}, - {http_header,0,<<"Other-Field">>,undefined,<<"with some text">>}}, - {"Make-sure-a-LONG-HEaDer-fIeLd-is-fORMATTED-NicelY: with some text\r\n", - {http_header,0, "Make-Sure-A-Long-Header-Field-Is-Formatted-Nicely" ,undefined, "with some text"}, - {http_header,0,<<"Make-Sure-A-Long-Header-Field-Is-Formatted-Nicely">>,undefined,<<"with some text">>}}, - {"Multi-Line: Once upon a time in a land far far away,\r\n" - " there lived a princess imprisoned in the highest tower\r\n" - " of the most haunted castle.\r\n", - {http_header,0, "Multi-Line" ,undefined, "Once upon a time in a land far far away,\r\n there lived a princess imprisoned in the highest tower\r\n of the most haunted castle."}, - {http_header,0,<<"Multi-Line">>,undefined,<<"Once upon a time in a land far far away,\r\n there lived a princess imprisoned in the highest tower\r\n of the most haunted castle.">>}}, - {"\r\n", - http_eoh, - http_eoh}], + {http_request, 'POST', {abs_path, "/invalid/url" }, {1,1}}, + {http_request, 'POST', {abs_path,<<"/invalid/url">>}, {1,1}}}, + {"Connection: close\r\n", + {http_header,2,'Connection',undefined, "close"}, + {http_header,2,'Connection',undefined,<<"close">>}}, + {"Host\t : localhost:8000\r\n", % white space before : + {http_header,14,'Host',undefined, "localhost:8000"}, + {http_header,14,'Host',undefined,<<"localhost:8000">>}}, + {"User-Agent: perl post\r\n", + {http_header,24,'User-Agent',undefined, "perl post"}, + {http_header,24,'User-Agent',undefined,<<"perl post">>}}, + {"Content-Length: 4\r\n", + {http_header,38,'Content-Length',undefined, "4"}, + {http_header,38,'Content-Length',undefined,<<"4">>}}, + {"Content-Type: text/xml; charset=utf-8\r\n", + {http_header,42,'Content-Type',undefined, "text/xml; charset=utf-8"}, + {http_header,42,'Content-Type',undefined,<<"text/xml; charset=utf-8">>}}, + {"Other-Field: with some text\r\n", + {http_header,0, "Other-Field" ,undefined, "with some text"}, + {http_header,0,<<"Other-Field">>,undefined,<<"with some text">>}}, + {"Make-sure-a-LONG-HEaDer-fIeLd-is-fORMATTED-NicelY: with some text\r\n", + {http_header,0, "Make-Sure-A-Long-Header-Field-Is-Formatted-Nicely" ,undefined, "with some text"}, + {http_header,0,<<"Make-Sure-A-Long-Header-Field-Is-Formatted-Nicely">>,undefined,<<"with some text">>}}, + {"Multi-Line: Once upon a time in a land far far away,\r\n" + " there lived a princess imprisoned in the highest tower\r\n" + " of the most haunted castle.\r\n", + {http_header,0, "Multi-Line" ,undefined, "Once upon a time in a land far far away,\r\n there lived a princess imprisoned in the highest tower\r\n of the most haunted castle."}, + {http_header,0,<<"Multi-Line">>,undefined,<<"Once upon a time in a land far far away,\r\n there lived a princess imprisoned in the highest tower\r\n of the most haunted castle.">>}}, + {"\r\n", + http_eoh, + http_eoh}], Bin = lists:foldl(fun({Line,_,_},Acc) -> LineBin = list_to_binary(Line), - <> end, - <<"">>, QnA), + <> end, + <<"">>, QnA), MsgBin = list_to_binary(Msg), {<>, QnA}. http_response(Msg) -> QnA = [{"HTTP/1.0 404 Object Not Found\r\n", - {http_response, {1,0}, 404, "Object Not Found"}, - {http_response, {1,0}, 404, <<"Object Not Found">>}}, - {"Server: inets/4.7.16\r\n", - {http_header, 30, 'Server', undefined, "inets/4.7.16"}, - {http_header, 30, 'Server', undefined, <<"inets/4.7.16">>}}, - {"Date: Fri, 04 Jul 2008 17:16:22 GMT\r\n", - {http_header, 3, 'Date', undefined, "Fri, 04 Jul 2008 17:16:22 GMT"}, - {http_header, 3, 'Date', undefined, <<"Fri, 04 Jul 2008 17:16:22 GMT">>}}, - {"Content-Type: text/html\r\n", - {http_header, 42, 'Content-Type', undefined, "text/html"}, - {http_header, 42, 'Content-Type', undefined, <<"text/html">>}}, - {"Content-Length: 207\r\n", - {http_header, 38, 'Content-Length', undefined, "207"}, - {http_header, 38, 'Content-Length', undefined, <<"207">>}}, - {"\r\n", - http_eoh, - http_eoh}], + {http_response, {1,0}, 404, "Object Not Found"}, + {http_response, {1,0}, 404, <<"Object Not Found">>}}, + {"Server: inets/4.7.16\r\n", + {http_header, 30, 'Server', undefined, "inets/4.7.16"}, + {http_header, 30, 'Server', undefined, <<"inets/4.7.16">>}}, + {"Date: Fri, 04 Jul 2008 17:16:22 GMT\r\n", + {http_header, 3, 'Date', undefined, "Fri, 04 Jul 2008 17:16:22 GMT"}, + {http_header, 3, 'Date', undefined, <<"Fri, 04 Jul 2008 17:16:22 GMT">>}}, + {"Content-Type: text/html\r\n", + {http_header, 42, 'Content-Type', undefined, "text/html"}, + {http_header, 42, 'Content-Type', undefined, <<"text/html">>}}, + {"Content-Length: 207\r\n", + {http_header, 38, 'Content-Length', undefined, "207"}, + {http_header, 38, 'Content-Length', undefined, <<"207">>}}, + {"\r\n", + http_eoh, + http_eoh}], Bin = lists:foldl(fun({Line,_,_},Acc) -> LineBin = list_to_binary(Line), - <> end, - <<"">>, QnA), + <> end, + <<"">>, QnA), MsgBin = list_to_binary(Msg), {<>, QnA}. @@ -466,52 +466,52 @@ http_uri_variants() -> line(Config) when is_list(Config) -> Text = <<"POST /invalid/url HTTP/1.1\r\n" - "Connection: close\r\n" - "Host\t : localhost:8000\r\n" - "User-Agent: perl post\r\n" - "Content-Length: 4\r\n" - "Content-Type: text/xml; charset=utf-8\r\n" - "Other-Field: with some text\r\n" - "Multi-Line: Once upon a time in a land far far away,\r\n" - " there lived a princess imprisoned in the highest tower\r\n" - " of the most haunted castle.\r\n" - "\r\nThe residue">>, + "Connection: close\r\n" + "Host\t : localhost:8000\r\n" + "User-Agent: perl post\r\n" + "Content-Length: 4\r\n" + "Content-Type: text/xml; charset=utf-8\r\n" + "Other-Field: with some text\r\n" + "Multi-Line: Once upon a time in a land far far away,\r\n" + " there lived a princess imprisoned in the highest tower\r\n" + " of the most haunted castle.\r\n" + "\r\nThe residue">>, lists:foreach(fun(MaxLen) -> line_do(Text,MaxLen) end, - [0,7,19,29,37]), + [0,7,19,29,37]), ok. line_do(Bin,MaxLen) -> Res = decode_pkt(line,Bin,[{line_length,MaxLen}]), MyRes = decode_line(Bin,MaxLen), - ?line MyRes = Res, + MyRes = Res, case Res of - {ok,_,Rest} -> - line_do(Rest,MaxLen); - {more,undefined} -> - ok + {ok,_,Rest} -> + line_do(Rest,MaxLen); + {more,undefined} -> + ok end. - + % Emulates decode_packet(line,Bin,[{line_length,MaxLen}]) decode_line(Bin,MaxLen) -> - ?line case find_in_binary($\n,Bin) of - notfound when MaxLen>0 andalso byte_size(Bin) >= MaxLen -> - {LineB,Rest} = split_binary(Bin,MaxLen), - {ok,LineB,Rest}; - notfound -> - {more,undefined}; - Pos when MaxLen>0 andalso Pos > MaxLen -> - {LineB,Rest} = split_binary(Bin,MaxLen), - {ok,LineB,Rest}; - Pos -> - {LineB,Rest} = split_binary(Bin,Pos), - {ok,LineB,Rest} + case find_in_binary($\n,Bin) of + notfound when MaxLen>0 andalso byte_size(Bin) >= MaxLen -> + {LineB,Rest} = split_binary(Bin,MaxLen), + {ok,LineB,Rest}; + notfound -> + {more,undefined}; + Pos when MaxLen>0 andalso Pos > MaxLen -> + {LineB,Rest} = split_binary(Bin,MaxLen), + {ok,LineB,Rest}; + Pos -> + {LineB,Rest} = split_binary(Bin,Pos), + {ok,LineB,Rest} end. find_in_binary(Byte, Bin) -> case string:chr(binary_to_list(Bin),Byte) of - 0 -> notfound; - P -> P + 0 -> notfound; + P -> P end. ssl(Config) when is_list(Config) -> @@ -521,10 +521,10 @@ ssl(Config) when is_list(Config) -> Rest = <<23,123,203,12,234>>, F = fun(Content) -> - {Packet,Unpacked} = pack_ssl(Content, Major, Minor, Body), - Bin = <>, - ?line {ok, Unpacked, Rest} = decode_pkt(ssl_tls, Bin) - end, + {Packet,Unpacked} = pack_ssl(Content, Major, Minor, Body), + Bin = <>, + {ok, Unpacked, Rest} = decode_pkt(ssl_tls, Bin) + end, F(25), F(v2hello), ok. @@ -542,7 +542,7 @@ otp_8536_do(N) -> Bin = <>, io:format("Bin='~p'\n",[Bin]), - ?line {ok,{http_header,0,Hdr2,undefined,Data2},<<"\r\n">>} = decode_pkt(httph_bin, Bin, []), + {ok,{http_header,0,Hdr2,undefined,Data2},<<"\r\n">>} = decode_pkt(httph_bin, Bin, []), %% Do something to trash the C-stack, how about another decode_packet: decode_pkt(httph_bin,<>, []), @@ -566,15 +566,15 @@ otp_9389(Config) when is_list(Config) -> "\r\nContent-Length: 0\r\n\r\n"]), <> = Pkt, {ok, {http_request,'GET',{abs_path,"/"},{1,1}}, Rest1} = - erlang:decode_packet(http, Pkt1, Opts), + erlang:decode_packet(http, Pkt1, Opts), {ok, {http_header,_,'Host',_,"localhost"}, Rest2} = - erlang:decode_packet(httph, Rest1, Opts), + erlang:decode_packet(httph, Rest1, Opts), {more, undefined} = erlang:decode_packet(httph, Rest2, Opts), {ok, {http_header,_,"Link",_,Link}, Rest3} = - erlang:decode_packet(httph, list_to_binary([Rest2, Pkt2]), Opts), + erlang:decode_packet(httph, list_to_binary([Rest2, Pkt2]), Opts), true = (length(Link) > 8000), {ok, {http_header,_,'Content-Length',_,"0"}, <<"\r\n">>} = - erlang:decode_packet(httph, Rest3, Opts), + erlang:decode_packet(httph, Rest3, Opts), ok. %% Verify packet_size works correctly for line mode @@ -584,7 +584,7 @@ otp_9389_line(Config) when is_list(Config) -> Line2 = <<"0123456789\n">>, Line3 = <<"01234567890123456789\n">>, Pkt = list_to_binary([Line1, Line2, Line3]), - ?line {ok, Line1, Rest1} = erlang:decode_packet(line, Pkt, Opts), - ?line {ok, Line2, Rest2} = erlang:decode_packet(line, Rest1, Opts), - ?line {error, invalid} = erlang:decode_packet(line, Rest2, Opts), + {ok, Line1, Rest1} = erlang:decode_packet(line, Pkt, Opts), + {ok, Line2, Rest2} = erlang:decode_packet(line, Rest1, Opts), + {error, invalid} = erlang:decode_packet(line, Rest2, Opts), ok. -- cgit v1.2.1 From 6664eed554974336909d3ffe03f20349cc4c38fd Mon Sep 17 00:00:00 2001 From: Henrik Nord Date: Tue, 15 Mar 2016 15:19:56 +0100 Subject: update copyright-year --- erts/emulator/test/decode_packet_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/emulator/test/decode_packet_SUITE.erl') diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl index ad592f7147..54ee4d5567 100644 --- a/erts/emulator/test/decode_packet_SUITE.erl +++ b/erts/emulator/test/decode_packet_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2013. All Rights Reserved. +%% Copyright Ericsson AB 2008-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. -- cgit v1.2.1