diff options
author | Björn Gustavsson <[email protected]> | 2013-02-07 12:20:09 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-02-07 12:23:36 +0100 |
commit | d45c6b727da8db7664d2cc08a16ef8ca68fe46df (patch) | |
tree | 9c54e0860b805d379c4b770428b8a6ac2a603d9e /lib/asn1/test | |
parent | 258c6a4b0e393d6112c738ae0c4d4b7f699d5e47 (diff) | |
parent | c310adbff67aa89f1ad3bff7c0a03c3506fe85ee (diff) | |
download | otp-d45c6b727da8db7664d2cc08a16ef8ca68fe46df.tar.gz otp-d45c6b727da8db7664d2cc08a16ef8ca68fe46df.tar.bz2 otp-d45c6b727da8db7664d2cc08a16ef8ca68fe46df.zip |
Merge branch 'maint-r15' into maint
* maint-r15:
Prepare release
Don't run testX420/1 on old slow Sparc systems
testX420: Pass Options to the ASN.1 compiler
asn1_erl_nif: Correct broken length encoding
asn1_SUITE: Mend broken test_modified_x420/1
Fix a bug for multiple extension addition groups
Diffstat (limited to 'lib/asn1/test')
-rw-r--r-- | lib/asn1/test/asn1_SUITE.erl | 15 | ||||
-rw-r--r-- | lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn | 21 | ||||
-rw-r--r-- | lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl | 23 | ||||
-rw-r--r-- | lib/asn1/test/testX420.erl | 2 | ||||
-rw-r--r-- | lib/asn1/test/test_modified_x420.erl | 22 |
5 files changed, 65 insertions, 18 deletions
diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index 9a6201455d..12569273bd 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -1054,17 +1054,25 @@ testDoubleEllipses(Config, Rule, Opts) -> testDoubleEllipses:main(Rule). test_modified_x420(Config) -> + test(Config, fun test_modified_x420/3, + [ber,ber_bin,ber_bin_v2,{ber_bin_v2,[nif]}]). +test_modified_x420(Config, Rule, Opts) -> Files = [filename:join(modified_x420, F) || F <- ["PKCS7", "InformationFramework", "AuthenticationFramework"]], - asn1_test_lib:compile_all(Files, Config, [der]), - test_modified_x420:test_io(Config). + asn1_test_lib:compile_all(Files, Config, [Rule,der|Opts]), + test_modified_x420:test(Config). testX420() -> [{timetrap,{minutes,90}}]. testX420(Config) -> - test(Config, fun testX420/3, [ber, ber_bin, ber_bin_v2]). + case erlang:system_info(system_architecture) of + "sparc-sun-solaris2.10" -> + {skip,"Too slow for an old Sparc"}; + _ -> + test(Config, fun testX420/3, [ber, ber_bin, ber_bin_v2]) + end. testX420(Config, Rule, Opts) -> testX420:compile(Rule, [der|Opts], Config), ok = testX420:ticket7759(Rule, Config), @@ -1096,6 +1104,7 @@ testExtensionAdditionGroup(Config, Rule, Opts) -> [debug_info]), extensionAdditionGroup:run([Rule|Opts]), extensionAdditionGroup:run2([Rule|Opts]), + extensionAdditionGroup:run3(), asn1_test_lib:compile("EUTRA-RRC-Definitions", Config, [Rule, {record_name_prefix, "RRC-"}|Opts]), extensionAdditionGroup:run3([Rule|Opts]). diff --git a/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn b/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn index 55124f9449..b7cc74ab07 100644 --- a/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn +++ b/lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn @@ -95,6 +95,27 @@ AS-Config ::= SEQUENCE { ]] } +SystemInformationBlockType2 ::= SEQUENCE { + timeAlignmentTimerCommon TimeAlignmentTimer, + ..., + lateNonCriticalExtension OCTET STRING OPTIONAL, + [[ ssac-BarringForMMTEL-Voice-r9 AC-BarringConfig OPTIONAL, + ssac-BarringForMMTEL-Video-r9 AC-BarringConfig OPTIONAL + ]], + [[ ac-BarringForCSFB-r10 AC-BarringConfig OPTIONAL + ]] +} + +TimeAlignmentTimer ::= ENUMERATED { + sf500, sf750, sf1280, sf1920, sf2560, sf5120, + sf10240, infinity} +AC-BarringConfig ::= SEQUENCE { + ac-BarringFactor ENUMERATED { + p00, p05, p10, p15, p20, p25, p30, p40, + p50, p60, p70, p75, p80, p85, p90, p95}, + ac-BarringTime ENUMERATED {s4, s8, s16, s32, s64, s128, s256, s512}, + ac-BarringForSpecialAC BIT STRING (SIZE(5)) +} END diff --git a/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl b/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl index 5fcec23756..8148381d92 100644 --- a/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl +++ b/lib/asn1/test/asn1_SUITE_data/extensionAdditionGroup.erl @@ -130,3 +130,26 @@ run3(Erule) -> _ -> exit({expected,Val, got, Val2}) end. +run3() -> + SI = #'SystemInformationBlockType2'{ + timeAlignmentTimerCommon = sf500, + lateNonCriticalExtension = asn1_NOVALUE, + 'ssac-BarringForMMTEL-Voice-r9' = asn1_NOVALUE, + 'ssac-BarringForMMTEL-Video-r9' = asn1_NOVALUE, + 'ac-BarringForCSFB-r10' = asn1_NOVALUE}, + Barring = #'AC-BarringConfig'{ + 'ac-BarringFactor' = p00, + 'ac-BarringTime' = s4, + 'ac-BarringForSpecialAC' = [0,0,0,0,0]}, + roundtrip(SI), + roundtrip(SI#'SystemInformationBlockType2'{ + 'ssac-BarringForMMTEL-Voice-r9'=Barring}), + roundtrip(SI#'SystemInformationBlockType2'{ + 'ssac-BarringForMMTEL-Video-r9'=Barring}), + roundtrip(SI#'SystemInformationBlockType2'{ + 'ac-BarringForCSFB-r10'=Barring}). + +roundtrip(V) -> + Mod = 'Extension-Addition-Group', + {ok,E} = Mod:encode('SystemInformationBlockType2', V), + {ok,V} = Mod:decode('SystemInformationBlockType2', iolist_to_binary(E)). diff --git a/lib/asn1/test/testX420.erl b/lib/asn1/test/testX420.erl index abdbbfe536..b222b15204 100644 --- a/lib/asn1/test/testX420.erl +++ b/lib/asn1/test/testX420.erl @@ -37,7 +37,7 @@ compile_loop(Erule, [Spec|Specs], Options, Config) when Erule == ber; Erule == ber_bin; Erule == ber_bin_v2; Erule == per -> CaseDir = ?config(case_dir, Config), asn1_test_lib:compile(filename:join([x420, Spec]), Config, - [Erule, {i, CaseDir}]), + [Erule, {i, CaseDir} | Options]), compile_loop(Erule, Specs, Options, Config); compile_loop(_Erule, _Specs, _Options, _Config) -> ok. diff --git a/lib/asn1/test/test_modified_x420.erl b/lib/asn1/test/test_modified_x420.erl index 2e9dfeee87..ae9d1989fb 100644 --- a/lib/asn1/test/test_modified_x420.erl +++ b/lib/asn1/test/test_modified_x420.erl @@ -18,27 +18,21 @@ %% %% -module(test_modified_x420). - -%-compile(export_all). --export([test_io/1]). +-export([test/1]). -include_lib("test_server/include/test_server.hrl"). -test_io(Config) -> - io:format("~p~n~n", [catch test(Config)]). - test(Config) -> - ?line DataDir = ?config(data_dir,Config), -% ?line OutDir = ?config(priv_dir,Config), + DataDir = ?config(data_dir,Config), - ?line Der = read_pem(filename:join([DataDir,modified_x420,"p7_signed_data.pem"])), - ?line {ok, {_,_,SignedData}} = 'PKCS7':decode('ContentInfo', Der), - ?line {ok,_} = 'PKCS7':decode('SignedData', SignedData). + Der = read_pem(filename:join([DataDir,modified_x420,"p7_signed_data.pem"])), + {ok,{_,_,SignedData}} = asn1_wrapper:decode('PKCS7', 'ContentInfo', Der), + {ok,_} = asn1_wrapper:decode('PKCS7', 'SignedData', SignedData). read_pem(File) -> - ?line {ok, Bin} = file:read_file(File), - ?line ssl_base64:join_decode(lists:flatten(extract_base64(Bin))). - + {ok,Bin} = file:read_file(File), + Der = base64:mime_decode(lists:flatten(extract_base64(Bin))), + binary_to_list(Der). extract_base64(Binary) -> |