diff options
Diffstat (limited to 'lib/orber/test/csiv2_SUITE.erl')
-rw-r--r-- | lib/orber/test/csiv2_SUITE.erl | 103 |
1 files changed, 38 insertions, 65 deletions
diff --git a/lib/orber/test/csiv2_SUITE.erl b/lib/orber/test/csiv2_SUITE.erl index 48818e4cab..7844060582 100644 --- a/lib/orber/test/csiv2_SUITE.erl +++ b/lib/orber/test/csiv2_SUITE.erl @@ -18,7 +18,6 @@ %% %CopyrightEnd% %% %% - -module(csiv2_SUITE). -include_lib("common_test/include/ct.hrl"). @@ -31,7 +30,7 @@ -include_lib("orber/COSS/CosNaming/CosNaming_NamingContext.hrl"). %%-include_lib("orber/src/OrberCSIv2.hrl"). --define(default_timeout, ?t:minutes(5)). +-define(default_timeout, test_server:minutes(5)). -define(match(ExpectedRes,Expr), fun() -> @@ -44,7 +43,7 @@ _ -> io:format("###### ERROR ERROR ######~nRESULT: ~p~n", [AcTuAlReS]), - ?line exit(AcTuAlReS) + exit(AcTuAlReS) end end()). @@ -357,7 +356,7 @@ end_per_testcase(_Case, Config) -> orber:jump_stop(), Path = code:which(?MODULE), code:del_path(filename:join(filename:dirname(Path), "idl_output")), - Dog = ?config(watchdog, Config), + Dog = proplists:get_value(watchdog, Config), test_server:timetrap_cancel(Dog), ok. @@ -389,8 +388,8 @@ end_per_suite(Config) -> -ifdef(false). %% OrberCSIv2 -code_CertificateChain_api(doc) -> ["Code CertificateChain"]; -code_CertificateChain_api(suite) -> []; +%%----------------------------------------------------------------- +%% Code CertificateChain code_CertificateChain_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -399,8 +398,7 @@ code_CertificateChain_api(_Config) -> 'OrberCSIv2':decode('CertificateChain', list_to_binary(Enc))), ok. -code_AttributeCertChain_api(doc) -> ["Code AttributeCertChain"]; -code_AttributeCertChain_api(suite) -> []; +%% Code AttributeCertChain code_AttributeCertChain_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -409,8 +407,7 @@ code_AttributeCertChain_api(_Config) -> 'OrberCSIv2':decode('AttributeCertChain', list_to_binary(Enc))), ok. -code_VerifyingCertChain_api(doc) -> ["Code VerifyingCertChain"]; -code_VerifyingCertChain_api(suite) -> []; +%% Code VerifyingCertChain code_VerifyingCertChain_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -420,8 +417,8 @@ code_VerifyingCertChain_api(_Config) -> ok. %% PKIXAttributeCertificate -code_AttributeCertificate_api(doc) -> ["Code AttributeCertificate"]; -code_AttributeCertificate_api(suite) -> []; +%%----------------------------------------------------------------- +%% Code AttributeCertificate code_AttributeCertificate_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -430,8 +427,7 @@ code_AttributeCertificate_api(_Config) -> 'OrberCSIv2':decode('AttributeCertificate', list_to_binary(Enc))), ok. -code_AttributeCertificateInfo_api(doc) -> ["Code AttributeCertificateInfo"]; -code_AttributeCertificateInfo_api(suite) -> []; +%% Code AttributeCertificateInfo code_AttributeCertificateInfo_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -440,8 +436,7 @@ code_AttributeCertificateInfo_api(_Config) -> 'OrberCSIv2':decode('AttributeCertificateInfo', list_to_binary(Enc))), ok. -code_AttCertVersion_api(doc) -> ["Code AttCertVersion"]; -code_AttCertVersion_api(suite) -> []; +%% Code AttCertVersion code_AttCertVersion_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -450,8 +445,7 @@ code_AttCertVersion_api(_Config) -> 'OrberCSIv2':decode('AttCertVersion', list_to_binary(Enc))), ok. -code_Holder_api(doc) -> ["Code Holder"]; -code_Holder_api(suite) -> []; +%% Code Holder code_Holder_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -460,8 +454,7 @@ code_Holder_api(_Config) -> 'OrberCSIv2':decode('Holder', list_to_binary(Enc))), ok. -code_AttCertIssuer_api(doc) -> ["Code AttCertIssuer"]; -code_AttCertIssuer_api(suite) -> []; +%% Code AttCertIssuer code_AttCertIssuer_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -470,8 +463,7 @@ code_AttCertIssuer_api(_Config) -> 'OrberCSIv2':decode('AttCertIssuer', list_to_binary(Enc))), ok. -code_AttCertValidityPeriod_api(doc) -> ["Code AttCertValidityPeriod"]; -code_AttCertValidityPeriod_api(suite) -> []; +%% Code AttCertValidityPeriod code_AttCertValidityPeriod_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('AttCertValidityPeriod', ?AttCertValidityPeriod)), @@ -479,8 +471,7 @@ code_AttCertValidityPeriod_api(_Config) -> 'OrberCSIv2':decode('AttCertValidityPeriod', list_to_binary(Enc))), ok. -code_V2Form_api(doc) -> ["Code V2Form"]; -code_V2Form_api(suite) -> []; +%% Code V2Form code_V2Form_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -489,8 +480,7 @@ code_V2Form_api(_Config) -> 'OrberCSIv2':decode('V2Form', list_to_binary(Enc))), ok. -code_IssuerSerial_api(doc) -> ["Code IssuerSerial"]; -code_IssuerSerial_api(suite) -> []; +%% Code IssuerSerial code_IssuerSerial_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -499,8 +489,7 @@ code_IssuerSerial_api(_Config) -> 'OrberCSIv2':decode('IssuerSerial', list_to_binary(Enc))), ok. -code_ObjectDigestInfo_api(doc) -> ["Code ObjectDigestInfo"]; -code_ObjectDigestInfo_api(suite) -> []; +%% Code ObjectDigestInfo code_ObjectDigestInfo_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -510,8 +499,8 @@ code_ObjectDigestInfo_api(_Config) -> ok. %% PKIX1Explicit88 -code_Certificate_api(doc) -> ["Code Certificate"]; -code_Certificate_api(suite) -> []; +%%----------------------------------------------------------------- +%% Code Certificate code_Certificate_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -520,8 +509,7 @@ code_Certificate_api(_Config) -> 'OrberCSIv2':decode('Certificate', list_to_binary(Enc))), ok. -code_TBSCertificate_api(doc) -> ["Code TBSCertificate"]; -code_TBSCertificate_api(suite) -> []; +%% Code TBSCertificate code_TBSCertificate_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -530,8 +518,7 @@ code_TBSCertificate_api(_Config) -> 'OrberCSIv2':decode('TBSCertificate', list_to_binary(Enc))), ok. -code_CertificateSerialNumber_api(doc) -> ["Code CertificateSerialNumber"]; -code_CertificateSerialNumber_api(suite) -> []; +%% Code CertificateSerialNumber"]; code_CertificateSerialNumber_api(_Config) -> {ok, Enc} = ?match({ok, _}, @@ -540,16 +527,14 @@ code_CertificateSerialNumber_api(_Config) -> 'OrberCSIv2':decode('CertificateSerialNumber', list_to_binary(Enc))), ok. -code_Version_api(doc) -> ["Code Version"]; -code_Version_api(suite) -> []; +%% Code Version code_Version_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('Version', ?Version)), ?match({ok, ?Version}, 'OrberCSIv2':decode('Version', list_to_binary(Enc))), ok. -code_AlgorithmIdentifier_api(doc) -> ["Code AlgorithmIdentifier"]; -code_AlgorithmIdentifier_api(suite) -> []; +%% Code AlgorithmIdentifier code_AlgorithmIdentifier_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('AlgorithmIdentifier', ?AlgorithmIdentifier)), @@ -557,8 +542,7 @@ code_AlgorithmIdentifier_api(_Config) -> 'OrberCSIv2':decode('AlgorithmIdentifier', list_to_binary(Enc))), ok. -code_Name_api(doc) -> ["Code Name"]; -code_Name_api(suite) -> []; +%% Code Name code_Name_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('Name', ?Name)), @@ -566,8 +550,7 @@ code_Name_api(_Config) -> 'OrberCSIv2':decode('Name', list_to_binary(Enc))), ok. -code_RDNSequence_api(doc) -> ["Code RDNSequence"]; -code_RDNSequence_api(suite) -> []; +%% Code RDNSequence code_RDNSequence_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('RDNSequence', ?RDNSequence)), @@ -575,8 +558,7 @@ code_RDNSequence_api(_Config) -> 'OrberCSIv2':decode('RDNSequence', list_to_binary(Enc))), ok. -code_RelativeDistinguishedName_api(doc) -> ["Code RelativeDistinguishedName"]; -code_RelativeDistinguishedName_api(suite) -> []; +%% Code RelativeDistinguishedName code_RelativeDistinguishedName_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('RelativeDistinguishedName', ?RelativeDistinguishedName)), @@ -584,8 +566,7 @@ code_RelativeDistinguishedName_api(_Config) -> 'OrberCSIv2':decode('RelativeDistinguishedName', list_to_binary(Enc))), ok. -code_AttributeTypeAndValue_api(doc) -> ["Code AttributeTypeAndValue"]; -code_AttributeTypeAndValue_api(suite) -> []; +%% Code AttributeTypeAndValue code_AttributeTypeAndValue_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('AttributeTypeAndValue', ?AttributeTypeAndValue)), @@ -593,8 +574,7 @@ code_AttributeTypeAndValue_api(_Config) -> 'OrberCSIv2':decode('AttributeTypeAndValue', list_to_binary(Enc))), ok. -code_Attribute_api(doc) -> ["Code Attribute"]; -code_Attribute_api(suite) -> []; +%% Code Attribute"]; code_Attribute_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('Attribute', ?Attribute)), @@ -602,8 +582,7 @@ code_Attribute_api(_Config) -> 'OrberCSIv2':decode('Attribute', list_to_binary(Enc))), ok. -code_Validity_api(doc) -> ["Code Validity"]; -code_Validity_api(suite) -> []; +%% Code Validity code_Validity_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('Validity', ?Validity)), @@ -611,8 +590,7 @@ code_Validity_api(_Config) -> 'OrberCSIv2':decode('Validity', list_to_binary(Enc))), ok. -code_SubjectPublicKeyInfo_api(doc) -> ["Code SubjectPublicKeyInfo"]; -code_SubjectPublicKeyInfo_api(suite) -> []; +%% Code SubjectPublicKeyInfo code_SubjectPublicKeyInfo_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('SubjectPublicKeyInfo', ?SubjectPublicKeyInfo)), @@ -620,16 +598,14 @@ code_SubjectPublicKeyInfo_api(_Config) -> 'OrberCSIv2':decode('SubjectPublicKeyInfo', list_to_binary(Enc))), ok. -code_UniqueIdentifier_api(doc) -> ["Code UniqueIdentifier"]; -code_UniqueIdentifier_api(suite) -> []; +%% Code UniqueIdentifier code_UniqueIdentifier_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('UniqueIdentifier', ?UniqueIdentifier)), ?match({ok, _}, 'OrberCSIv2':decode('UniqueIdentifier', list_to_binary(Enc))), ok. -code_Extensions_api(doc) -> ["Code Extensions"]; -code_Extensions_api(suite) -> []; +%% Code Extensions code_Extensions_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('Extensions', ?Extensions)), @@ -637,8 +613,7 @@ code_Extensions_api(_Config) -> 'OrberCSIv2':decode('Extensions', list_to_binary(Enc))), ok. -code_Extension_api(doc) -> ["Code Extension"]; -code_Extension_api(suite) -> []; +%% Code Extension code_Extension_api(_Config) -> {ok, Enc} = ?match({ok, _}, 'OrberCSIv2':encode('Extension', ?Extension)), @@ -647,8 +622,8 @@ code_Extension_api(_Config) -> ok. %% OpenSSL generated x509 Certificate -code_OpenSSL509_api(doc) -> ["Code OpenSSL generated x509 Certificate"]; -code_OpenSSL509_api(suite) -> []; +%%----------------------------------------------------------------- +%% Code OpenSSL generated x509 Certificate code_OpenSSL509_api(_Config) -> {ok, Cert} = ?match({ok, #'Certificate'{}}, @@ -666,8 +641,7 @@ code_OpenSSL509_api(_Config) -> %%----------------------------------------------------------------- %% Test ssl:peercert %%----------------------------------------------------------------- -ssl_server_peercert_api(doc) -> ["Test ssl:peercert (server side)"]; -ssl_server_peercert_api(suite) -> []; +%% Test ssl:peercert (server side) ssl_server_peercert_api(_Config) -> Options = orber_test_lib:get_options(iiop_ssl, server, 2, [{iiop_ssl_port, 0}]), @@ -685,8 +659,7 @@ ssl_server_peercert_api(_Config) -> destroy_fake_ORB(ssl, Socket), ok. -ssl_client_peercert_api(doc) -> ["Test ssl:peercert (client side)"]; -ssl_client_peercert_api(suite) -> []; +%% Test ssl:peercert (client side) ssl_client_peercert_api(_Config) -> Options = orber_test_lib:get_options(iiop_ssl, client, 2, [{iiop_ssl_port, 0}]), @@ -827,7 +800,7 @@ context_test(Obj) -> context_data = MTContextError}, #'IOP_ServiceContext'{context_id=?IOP_SecurityAttributeService, context_data = MTMessageInContext}], - ?line ?match(ok, orber_test_server:testing_iiop_context(Obj, [{context, Ctx}])). + ?match(ok, orber_test_server:testing_iiop_context(Obj, [{context, Ctx}])). fake_server_ORB(Type, Port, Options) -> |