From 0aad93323b1802723edfbfdc4a5d2d0f7b3393cc Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 15 Apr 2019 09:57:46 +0200 Subject: Added new -s commandline option to shutdown the server instead of letting it terminate * TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/client.cpp: --- .../tests/ImplRepo/Bug_4152_Regression/client.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/client.cpp b/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/client.cpp index e9f5e6c73f0..2eba63f0baf 100644 --- a/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/client.cpp +++ b/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/client.cpp @@ -4,11 +4,12 @@ #include "ace/OS_NS_unistd.h" bool killit = false; +bool shutdown_server = false; int parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k")); + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("ks")); int c; while ((c = get_opts ()) != -1) @@ -17,6 +18,9 @@ parse_args (int argc, ACE_TCHAR *argv[]) case 'k': killit = true; break; + case 's': + shutdown_server = true; + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, @@ -53,6 +57,12 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client send terminate request\n")); } + else if (shutdown_server) + { + test->shutdown (); + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Client send shutdown request\n")); + } else { CORBA::Short const n = test->get_server_num (); @@ -64,8 +74,8 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) catch (const CORBA::Exception &ex) { ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Client caught: %C on first attempt, retrying killit %d\n", - ex._name (), killit)); + "(%P|%t) Client caught: %C on first attempt, retrying killit <%d> shutdown <%d>\n", + ex._name (), killit, shutdown_server)); try { if (CORBA::is_nil (test.in())) @@ -78,6 +88,12 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client send terminate request on second attempt\n")); } + else if (shutdown_server) + { + test->shutdown (); + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Client send shutdown request on second attempt\n")); + } else { CORBA::Short const n = test->get_server_num (); -- cgit v1.2.1