From 5156e424454de9a2e949a25ad2ee39a951feb57a Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Wed, 21 Mar 2001 06:02:01 +0000 Subject: ChangeLogTag:Tue Mar 20 21:53:17 2001 Ossama Othman --- TAO/ChangeLogs/ChangeLog-02a | 25 ++++++++++++++++++++++ .../tests/Security/Secure_Invocation/Foo.idl | 8 ++++++- .../tests/Security/Secure_Invocation/Foo_i.cpp | 13 +++++++++-- .../tests/Security/Secure_Invocation/Foo_i.h | 3 ++- .../tests/Security/Secure_Invocation/run_test.pl | 2 +- 5 files changed, 46 insertions(+), 5 deletions(-) diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 67f68ccc952..7bd789dc4b9 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,28 @@ +Tue Mar 20 21:53:17 2001 Ossama Othman + + * orbsvcs/tests/Security/Secure_Invocation/Foo.idl: + + Added user exception that is thrown when no security attributes + are available for the current upcall. + + The baz() test method raises this exception. + + * orbsvcs/tests/Security/Secure_Invocation/Foo_i.h (baz): + + Updated exception specification to include the newly added user + exception. + + * orbsvcs/tests/Security/Secure_Invocation/Foo_i.cpp (baz): + + Throw an exception if no security attributes are available for + the current upcall. The exception indicates problem with the + underlying security mechanism in use. + + * orbsvcs/tests/Security/Secure_Invocation/run_test.pl: + + Increased timeout for server IOR file. It wasn't long enough + for some slow machines. + Tue Mar 20 20:01:56 2001 Carlos O'Ryan * tao/Transport.cpp (make_idle): diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo.idl b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo.idl index ba47c809ad6..d52d94a51c2 100644 --- a/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo.idl +++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo.idl @@ -16,8 +16,14 @@ module Foo { interface Bar { + /// Exception that indicates that no security attributes were + /// available during the upcall. If this exception is thrown, + /// then is most likely a problem with the underlying security + /// mechanism(s). + exception NoSecurityAttributes {}; + /// Test method. - void baz (); + void baz () raises (NoSecurityAttributes); /// Shutdown the server. oneway void shutdown (); diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.cpp b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.cpp index 0b97f6ee5a8..6bbfcc7efb3 100644 --- a/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.cpp +++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.cpp @@ -17,7 +17,8 @@ Foo_i::Foo_i (CORBA::ORB_ptr orb, void Foo_i::baz (CORBA::Environment &ACE_TRY_ENV) - ACE_THROW_SPEC ((CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException, + Foo::Bar::NoSecurityAttributes)) { Security::AttributeType desired_attribute; @@ -44,6 +45,15 @@ Foo_i::baz (CORBA::Environment &ACE_TRY_ENV) // information is available for this upcall. The following code // verifies that this is actually the case. + CORBA::ULong len = attribute_list->length (); + if (len == 0) + { + // The desired security attribute was not available. This + // indicates a failure in the underlying security mechanism + // support. + ACE_THROW (Foo::Bar::NoSecurityAttributes ()); + } + // Assume X.509 certificates are in use. const char x509[] = "x509"; Security::OID x509_defining_authority; @@ -54,7 +64,6 @@ Foo_i::baz (CORBA::Environment &ACE_TRY_ENV) ACE_OS_String::memcpy (buf, x509, sizeof (x509)); - CORBA::ULong len = attribute_list->length (); for (CORBA::ULong i = 0; i < len; ++i) { Security::SecAttribute &attribute = attribute_list[i]; diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.h b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.h index b1c7668249c..19760b5b615 100644 --- a/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.h +++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.h @@ -29,7 +29,8 @@ public: /// Test method. virtual void baz (CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) - ACE_THROW_SPEC ((CORBA::SystemException)); + ACE_THROW_SPEC ((CORBA::SystemException, + Foo::Bar::NoSecurityAttributes)); virtual void shutdown (CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl b/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl index 2d042617a94..4f49a18acd5 100755 --- a/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl +++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl @@ -21,7 +21,7 @@ $SV = Process::Create ($EXEPREFIX."server$EXE_EXT ", " -ORBSvcConf server_nopasswd.conf " . " -o $iorfile"); -if (ACE::waitforfile_timed ($iorfile, 5) == -1) { +if (ACE::waitforfile_timed ($iorfile, 10) == -1) { print STDERR "ERROR: cannot find file <$iorfile>\n"; $SV->Kill (); $SV->TimedWait (1); exit 1; -- cgit v1.2.1