[devel] [PATCH 0/1] Review Request for smf: add retry machanism to adminop utils [#2956]

2018-11-06 Thread Vu Minh Nguyen
Summary: smf: add retry machanism to adminop utils [#2956]
Review request for Ticket(s): 2956
Peer Reviewer(s): Lennart
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-2956
Base revision: f8a6848a1cdbff0b518c3db951e4689e260226c7
Personal repository: git://git.code.sf.net/u/winhvu/review


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision 16722697b993da76fb4212105bd1b9b7cc35424c
Author: Vu Minh Nguyen 
Date:   Tue, 6 Nov 2018 17:42:59 +0700

smf: add retry machanism to adminop utils [#2956]

Execution of the campaign will get failed if getting timeout
during performing admin operation.

This ticket adds some retries in such case or in case of getting
SA_AIS_ERR_BAD_HANDLE.



Complete diffstat:
--
 src/smf/smfd/SmfUtils.cc | 12 
 1 file changed, 12 insertions(+)


Testing Commands:
-
*** LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES ***


Testing, Expected Results:
--
*** PASTE COMMAND OUTPUTS / TEST RESULTS ***


Conditions of Submission:
-
Ack from peer reviewers


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.gitconfig file (i.e. user.name, user.email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1/1] smf: add retry machanism to adminop utils [#2956]

2018-11-06 Thread Vu Minh Nguyen
Execution of the campaign will get failed if getting timeout
during performing admin operation.

This ticket adds some retries in such case or in case of getting
SA_AIS_ERR_BAD_HANDLE.
---
 src/smf/smfd/SmfUtils.cc | 12 
 1 file changed, 12 insertions(+)

diff --git a/src/smf/smfd/SmfUtils.cc b/src/smf/smfd/SmfUtils.cc
index c2931c84b..b777d2d3c 100644
--- a/src/smf/smfd/SmfUtils.cc
+++ b/src/smf/smfd/SmfUtils.cc
@@ -254,14 +254,17 @@ bool SmfImmUtils::initialize(void) {
 bool SmfImmUtils::finalize(void) {
   if (m_ownerHandle != 0) {
 (void)immutil_saImmOmAdminOwnerFinalize(m_ownerHandle);
+m_ownerHandle = 0;
   }
 
   if (m_accessorHandle != 0) {
 (void)immutil_saImmOmAccessorFinalize(m_accessorHandle);
+m_accessorHandle = 0;
   }
 
   if (m_omHandle != 0) {
 (void)immutil_saImmOmFinalize(m_omHandle);
+m_omHandle = 0;
   }
 
   return true;
@@ -584,6 +587,7 @@ SaAisErrorT SmfImmUtils::callAdminOperation(
 TRACE("contains NO parameters");
   }
 
+retry_admop:
   rc = immutil_saImmOmAdminOwnerSet(m_ownerHandle, objectNames, SA_IMM_ONE);
   if (rc != SA_AIS_OK) {
 LOG_NO("Fail to set admin owner, rc=%s, dn=[%s]", saf_error(rc),
@@ -606,6 +610,14 @@ SaAisErrorT SmfImmUtils::callAdminOperation(
 retry--;
   }
 
+  // Handle recovery and retry the admin operation.
+  if (retry && (rc == SA_AIS_ERR_TIMEOUT || rc == SA_AIS_ERR_BAD_HANDLE)) {
+finalize();
+initialize();
+sleep(2);
+goto retry_admop;
+  }
+
   if (retry <= 0) {
 LOG_NO(
 "Fail to invoke admin operation, too many SA_AIS_ERR_TRY_AGAIN, giving 
up. dn=[%s], opId=[%u]",
-- 
2.18.0



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 3/4] clm: add new test case saClmClusterNodeGetAsync() of apitest [#2914]

2018-11-06 Thread Mohan Kanakam
---
 src/clm/apitest/tet_saClmClusterNodeGetAsync.cc | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/src/clm/apitest/tet_saClmClusterNodeGetAsync.cc 
b/src/clm/apitest/tet_saClmClusterNodeGetAsync.cc
index 67d876f..c5bcee9 100644
--- a/src/clm/apitest/tet_saClmClusterNodeGetAsync.cc
+++ b/src/clm/apitest/tet_saClmClusterNodeGetAsync.cc
@@ -239,6 +239,23 @@ void saClmClusterNodeGetAsync_09() {
   test_validate(rc, SA_AIS_ERR_INIT);
 }
 
+void saClmClusterNodeGetAsync_10() {
+  nodeId = ncs_get_node_id();
+  invocation = 300;
+  safassert(ClmTest::saClmInitialize(, , 
_1),
+SA_AIS_OK);
+  safassert(ClmTest::saClmFinalize(clmHandle), SA_AIS_OK);
+  rc = ClmTest::saClmClusterNodeGetAsync(clmHandle, invocation, nodeId);
+  test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
+
+  safassert(
+  ClmTest::saClmInitialize_4(, , _4),
+  SA_AIS_OK);
+  safassert(ClmTest::saClmFinalize(clmHandle), SA_AIS_OK);
+  rc = ClmTest::saClmClusterNodeGetAsync(clmHandle, invocation, nodeId);
+  test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
+}
+
 __attribute__((constructor)) static void
 saClmClusterNodeGetAsyncAsync_constructor() {
   test_suite_add(6, "Test case for saClmClusterNodeGetAsync");
@@ -260,4 +277,6 @@ saClmClusterNodeGetAsyncAsync_constructor() {
 "saClmClusterNodeGetAsync with nodeId as 
SA_CLM_LOCAL_NODE_ID");
   test_case_add(6, saClmClusterNodeGetAsync_09,
 "saClmClusterNodeGetAsync with null callback");
+  test_case_add(6, saClmClusterNodeGetAsync_10,
+   "saClmClusterNodeGetAsync with finalized handle");
 }
-- 
2.7.4



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0/4] Review Request for clm: add new test cases in clm apitest [#2914]

2018-11-06 Thread Mohan Kanakam
Summary: clm: add new test case of API saClmClusterNotificationFree_4() of 
apitest [#2914]
Review request for Ticket(s): 2914-1
Peer Reviewer(s):Anders, Hans, Ravi 
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-2914-1
Base revision: f8a6848a1cdbff0b518c3db951e4689e260226c7
Personal repository: git://git.code.sf.net/u/mohan-hasoln/review


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision 9a6bf69135567cdceded5cd89b0a22138b7c116a
Author: Mohan Kanakam 
Date:   Tue, 6 Nov 2018 15:41:15 +0530

clm: add new test case in saClmResponse_4() of apitest [#2914]



revision afd96329f2b2cd6211e0dae90a6e46881d140092
Author: Mohan Kanakam 
Date:   Tue, 6 Nov 2018 15:15:32 +0530

clm: add new test case saClmClusterNodeGetAsync() of apitest [#2914]



revision 71b52f9c79477fe8ee567123b68ebf52cd6ee433
Author: Mohan Kanakam 
Date:   Tue, 6 Nov 2018 15:05:34 +0530

clm: add new test case of API saClmClusterNodeGet_4() of apitest [#2914]



revision eda88ade8b2d87ba657465ef17d73cb553082551
Author: Mohan Kanakam 
Date:   Tue, 6 Nov 2018 14:39:02 +0530

clm: add new test case of API saClmClusterNotificationFree_4() of apitest 
[#2914]



Complete diffstat:
--
 src/clm/apitest/tet_saClmClusterNodeGet.cc  | 21 +
 src/clm/apitest/tet_saClmClusterNodeGetAsync.cc | 19 +++
 src/clm/apitest/tet_saClmClusterNotificationFree.cc | 14 ++
 src/clm/apitest/tet_saClmResponse.cc|  9 +
 4 files changed, 63 insertions(+)


Testing Commands:
-
./clmtest

Testing, Expected Results:
--
5  PASSED   saClmClusterNotificationFree with finalized handle
10  PASSED/PASSEDsaClmClusterNodeGet & saClmClusterNodeGet_4 with Finalized 
handle
10  PASSED/PASSEDsaClmClusterNodeGetAsync with finalized handle
6  PASSED   saClmResponse with Finalized handle


Conditions of Submission:
-
Ack from mainatiners

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.gitconfig file (i.e. user.name, user.email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service 

[devel] [PATCH 4/4] clm: add new test case in saClmResponse_4() of apitest [#2914]

2018-11-06 Thread Mohan Kanakam
---
 src/clm/apitest/tet_saClmResponse.cc | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/clm/apitest/tet_saClmResponse.cc 
b/src/clm/apitest/tet_saClmResponse.cc
index 8ccb64e..bff8bd5 100644
--- a/src/clm/apitest/tet_saClmResponse.cc
+++ b/src/clm/apitest/tet_saClmResponse.cc
@@ -242,6 +242,14 @@ void saClmResponse_05() {
   test_validate(rc, SA_AIS_ERR_INVALID_PARAM);
 }
 
+void saClmResponse_06() {
+  safassert(ClmTest::saClmInitialize_4(, nullptr, _4),
+   SA_AIS_OK);
+  safassert(ClmTest::saClmFinalize(clmHandle), SA_AIS_OK);
+  rc = ClmTest::saClmResponse_4(clmHandle, 100, SA_CLM_CALLBACK_RESPONSE_OK);
+  test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
+}
+
 __attribute__((constructor)) static void saClmResponse_constructor() {
   test_suite_add(8, "Test case for saClmResponse");
 
@@ -251,4 +259,5 @@ __attribute__((constructor)) static void 
saClmResponse_constructor() {
 
   test_case_add(8, saClmResponse_04, "saClmResponse with invalid param");
   test_case_add(8, saClmResponse_05, "saClmResponse with invalid param");
+  test_case_add(8, saClmResponse_06, "saClmResponse with Finalized handle");
 }
-- 
2.7.4



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 2/4] clm: add new test case of API saClmClusterNodeGet_4() of apitest [#2914]

2018-11-06 Thread Mohan Kanakam
---
 src/clm/apitest/tet_saClmClusterNodeGet.cc | 21 +
 1 file changed, 21 insertions(+)

diff --git a/src/clm/apitest/tet_saClmClusterNodeGet.cc 
b/src/clm/apitest/tet_saClmClusterNodeGet.cc
index 8c84884..f80712e 100644
--- a/src/clm/apitest/tet_saClmClusterNodeGet.cc
+++ b/src/clm/apitest/tet_saClmClusterNodeGet.cc
@@ -194,6 +194,24 @@ void saClmClusterNodeGet_09() {
   test_validate(rc, SA_AIS_OK);
 }
 
+void saClmClusterNodeGet_10() {
+  nodeId = ncs_get_node_id();
+  safassert(
+  ClmTest::saClmInitialize(, _1, _1),
+  SA_AIS_OK);
+  safassert(ClmTest::saClmFinalize(clmHandle), SA_AIS_OK);
+  rc = ClmTest::saClmClusterNodeGet(clmHandle, nodeId, timeout, 
_1);
+  test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
+  nodeId = ncs_get_node_id();
+  safassert(
+  ClmTest::saClmInitialize_4(, _4, _4),
+  SA_AIS_OK);
+  safassert(ClmTest::saClmFinalize(clmHandle), SA_AIS_OK);
+  rc = ClmTest::saClmClusterNodeGet_4(clmHandle, nodeId, timeout,
+  _4);
+  test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
+}
+
 __attribute__((constructor)) static void saClmClusterNodeGet_constructor() {
   test_suite_add(5, "Test case for saClmClusterNodeGet");
   test_case_add(5, saClmClusterNodeGet_01,
@@ -221,4 +239,7 @@ __attribute__((constructor)) static void 
saClmClusterNodeGet_constructor() {
   test_case_add(5, saClmClusterNodeGet_09,
 "saClmClusterNodeGet & saClmClusterNodeGet_4"
 " with nodeId as SA_CLM_LOCAL_NODE_ID");
+  test_case_add(
+  5, saClmClusterNodeGet_10,
+  "saClmClusterNodeGet & saClmClusterNodeGet_4 with Finalized handle");
 }
-- 
2.7.4



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1/4] clm: add new test case of API saClmClusterNotificationFree_4() of apitest [#2914]

2018-11-06 Thread Mohan Kanakam
---
 src/clm/apitest/tet_saClmClusterNotificationFree.cc | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/src/clm/apitest/tet_saClmClusterNotificationFree.cc 
b/src/clm/apitest/tet_saClmClusterNotificationFree.cc
index a4df9e7..4b4d087 100644
--- a/src/clm/apitest/tet_saClmClusterNotificationFree.cc
+++ b/src/clm/apitest/tet_saClmClusterNotificationFree.cc
@@ -70,6 +70,18 @@ void saClmClusterNotificationFree_04() {
   test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
 }
 
+void saClmClusterNotificationFree_05() {
+  notificationBuffer_4.numberOfItems = 1;
+  notificationBuffer_4.notification = (SaClmClusterNotificationT_4 *)malloc(
+  sizeof(SaClmClusterNotificationT_4) * 
notificationBuffer_4.numberOfItems);
+
+  safassert(ClmTest::saClmInitialize_4(, nullptr, _4),
+   SA_AIS_OK);
+  safassert(ClmTest::saClmFinalize(clmHandle), SA_AIS_OK);
+  rc = ClmTest::saClmClusterNotificationFree_4(
+  clmHandle, notificationBuffer_4.notification);
+  test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
+}
 __attribute__((constructor)) static void
 saClmClusterNotificationFree_constructor() {
   test_suite_add(10, "Test case for saClmClusterNotificationFree");
@@ -81,4 +93,6 @@ saClmClusterNotificationFree_constructor() {
 "saClmClusterNotificationFree with invalid param");
   test_case_add(10, saClmClusterNotificationFree_04,
 "saClmClusterNotificationFree with bad handle");
+  test_case_add(10, saClmClusterNotificationFree_05,
+"saClmClusterNotificationFree with finalized handle");
 }
-- 
2.7.4



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel