[devel] [PATCH 0/1] Review Request for amfd: Do not create absent assignment if number of assignment exceeds [#2968]

2018-11-21 Thread Minh Chau
Summary: amfd: Do not create absent assignment if number of assignment exceeds 
[#2968]
Review request for Ticket(s): 2968
Peer Reviewer(s): Hans, Nagu, Gary
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-2968
Base revision: c43ae9d97d169cc4a3b57da14ed9191dca8dfba5
Personal repository: git://git.code.sf.net/u/minh-chau/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 72ff674dea7f796b8d957ed7ecaccb0d404f6360
Author: Minh Chau 
Date:   Thu, 22 Nov 2018 10:19:58 +1100

amfd: Do not create absent assignment if number of assignment exceeds [#2968]



Complete diffstat:
--
 src/amf/amfd/sg_2n_fsm.cc | 2 +-
 src/amf/amfd/siass.cc | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)


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


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


Conditions of Submission:
-
*** HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC ***


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 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] amfd: Do not create absent assignment if number of assignment exceeds [#2968]

2018-11-21 Thread Minh Chau
---
 src/amf/amfd/sg_2n_fsm.cc | 2 +-
 src/amf/amfd/siass.cc | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/amf/amfd/sg_2n_fsm.cc b/src/amf/amfd/sg_2n_fsm.cc
index 72edf9d..a218786 100644
--- a/src/amf/amfd/sg_2n_fsm.cc
+++ b/src/amf/amfd/sg_2n_fsm.cc
@@ -127,7 +127,7 @@ AVD_SU_SI_STATE avd_su_fsm_state_determine(AVD_SU *su) {
   absent_flag, excessive_flag);
   if (absent_flag == true) {
 fsm_state = AVD_SU_SI_STATE_ABSENT;
-  } if (excessive_flag == true) {
+  } else if (excessive_flag == true) {
 fsm_state = AVD_SU_SI_STATE_EXCESSIVE;
   } else if (true == modify_flag) {
 /* Rule 1. => If any one of the SUSI is Mod, then SU will be said to be
diff --git a/src/amf/amfd/siass.cc b/src/amf/amfd/siass.cc
index c3f04a6..ffde7b1 100644
--- a/src/amf/amfd/siass.cc
+++ b/src/amf/amfd/siass.cc
@@ -348,6 +348,9 @@ bool avd_susi_validate_absent_assignment(AVD_SU *su, AVD_SI 
*si,
   su->sg_of_su->any_assignment_assigned() == false) {
 goto done;
   }
+  // Skip if any excessive assignment exists
+  if (su->sg_of_su->any_assignment_excessive())
+goto done;
   // Support: 2N, NoRed, NwayActive. Not support: NpM, Nway
   if (su->sg_of_su->sg_redundancy_model == SA_AMF_NPM_REDUNDANCY_MODEL ||
   su->sg_of_su->sg_redundancy_model == SA_AMF_N_WAY_REDUNDANCY_MODEL) {
-- 
2.7.4



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


Re: [devel] [PATCH 0/1] Review Request for log: add new test cases in log apitest [#2915]

2018-11-21 Thread mohan
Hi Lennart,
Thanks for your feedback.
I incorporated those comments and re floated in a single patch.
 
Thanks Mohan
High Availability Solutions Pvt. Ltd.
www.hasolutions.in

 
 
- Original Message - Subject: [PATCH 0/1] Review Request for 
log: add new test cases in log apitest [#2915]
From: "Mohan Kanakam" 
Date: 11/21/18 3:41 pm
To: lennart.l...@ericsson.com, vu.m.ngu...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net, "Mohan Kanakam" 

Summary: log: add new test cases in log apitest v3 [#2915]
 Review request for Ticket(s): 2915
 Peer Reviewer(s):lennart, vu 
 Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
 Affected branch(es): develop
 Development branch: ticket-2915
 Base revision: f8a6848a1cdbff0b518c3db951e4689e260226c7
 Personal repository: git://git.code.sf.net/u/mohan-hasoln/review
 
 
 Impacted area Impact y/n
 
 Docs n
 Build system n
 RPM/packaging n
 Configuration files n
 Startup scripts n
 SAF services n
 OpenSAF services n
 Core libraries n
 Samples n
 Tests y
 Other n
 
 
 Comments (indicate scope for each "y" above):
 -
 *** EXPLAIN/COMMENT THE PATCH SERIES HERE ***
 
 revision 689a6074b8451f09ae40782523f6dc4e1a240f21
 Author: Mohan Kanakam 
 Date: Wed, 21 Nov 2018 14:23:05 +0530
 
 log: add new test cases in log apitest v3 [#2915]
 
 
 
 Complete diffstat:
 --
 src/log/apitest/tet_saLogDispatch.c | 46 +++-
 src/log/apitest/tet_saLogFinalize.c | 40 +-
 src/log/apitest/tet_saLogInitialize.c | 72 -
 src/log/apitest/tet_saLogSelectionObjectGet.c | 41 +-
 src/log/apitest/tet_saLogStreamClose.c | 57 +++-
 src/log/apitest/tet_saLogStreamOpen_2.c | 77 +++
 src/log/apitest/tet_saLogWriteLogAsync.c | 77 +++
 7 files changed, 332 insertions(+), 78 deletions(-)
 
 
 Testing Commands:
 -
 ./logtest
 
 Testing, Expected Results:
 --
 12 PASSED saLogInitialize() with version as NULL
 13 PASSED saLogInitialize() with handle as null, version as null
 14 PASSED saLogInitialize() with handle as null and callbk as null
 15 PASSED saLogInitialize() with handle, cbk and version as null values
 18 PASSED saLogSelectionObjectGet() with finalized log handle
 20 PASSED saLogDispatch() with finalized handle
 21 PASSED saLogDispatch() with invalid handle
 24 PASSED saLogFinalize() with finalized log handle
 22 PASSED saLogStreamOpen with invalid handle,logStreamName to NULL pointer,
 logFileCreateAttributes to NULL pointer and logStreamOpenFlags to ZERO(0)
 54 PASSED saLogStreamClose with invalid handle
 55 PASSED saLogStreamClose with uninitialized handle
 52 PASSED saLogWriteLogAsync() with invalid logStreamHandle
 
 Conditions of Submission:
 -
 Ack from maintainers
 
 Arch Built Started Linux distro
 ---
 mips n 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 

[devel] [PATCH 0/1] Review Request for log: add new test cases in log apitest [#2915]

2018-11-21 Thread Mohan Kanakam
Summary: log: add new test cases in log apitest v3 [#2915]
Review request for Ticket(s): 2915
Peer Reviewer(s):lennart, vu 
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-2915
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 689a6074b8451f09ae40782523f6dc4e1a240f21
Author: Mohan Kanakam 
Date:   Wed, 21 Nov 2018 14:23:05 +0530

log: add new test cases in log apitest v3 [#2915]



Complete diffstat:
--
 src/log/apitest/tet_saLogDispatch.c   | 46 +++-
 src/log/apitest/tet_saLogFinalize.c   | 40 +-
 src/log/apitest/tet_saLogInitialize.c | 72 -
 src/log/apitest/tet_saLogSelectionObjectGet.c | 41 +-
 src/log/apitest/tet_saLogStreamClose.c| 57 +++-
 src/log/apitest/tet_saLogStreamOpen_2.c   | 77 +++
 src/log/apitest/tet_saLogWriteLogAsync.c  | 77 +++
 7 files changed, 332 insertions(+), 78 deletions(-)


Testing Commands:
-
./logtest

Testing, Expected Results:
--
12  PASSED   saLogInitialize() with  version as NULL
13  PASSED   saLogInitialize() with handle as null, version as null
14  PASSED   saLogInitialize() with handle as null and callbk as null
15  PASSED   saLogInitialize() with handle, cbk and version as null values
18  PASSED   saLogSelectionObjectGet() with finalized log handle
20  PASSED   saLogDispatch() with finalized handle
21  PASSED   saLogDispatch() with invalid handle
24  PASSED   saLogFinalize() with finalized log handle
22  PASSED   saLogStreamOpen with invalid handle,logStreamName to NULL pointer,
logFileCreateAttributes to NULL pointer and logStreamOpenFlags to ZERO(0)
54  PASSED   saLogStreamClose with invalid handle
55  PASSED   saLogStreamClose with uninitialized handle
52  PASSED   saLogWriteLogAsync() with invalid logStreamHandle

Conditions of Submission:
-
Ack from maintainers

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 

[devel] [PATCH 1/1] log: add new test cases in log apitest v3 [#2915]

2018-11-21 Thread Mohan Kanakam
---
 src/log/apitest/tet_saLogDispatch.c   | 46 +++-
 src/log/apitest/tet_saLogFinalize.c   | 40 +-
 src/log/apitest/tet_saLogInitialize.c | 72 -
 src/log/apitest/tet_saLogSelectionObjectGet.c | 41 +-
 src/log/apitest/tet_saLogStreamClose.c| 57 +++-
 src/log/apitest/tet_saLogStreamOpen_2.c   | 77 +++
 src/log/apitest/tet_saLogWriteLogAsync.c  | 77 +++
 7 files changed, 332 insertions(+), 78 deletions(-)

diff --git a/src/log/apitest/tet_saLogDispatch.c 
b/src/log/apitest/tet_saLogDispatch.c
index 4419e05..f366ef2 100644
--- a/src/log/apitest/tet_saLogDispatch.c
+++ b/src/log/apitest/tet_saLogDispatch.c
@@ -17,7 +17,11 @@
 
 #include "logtest.h"
 
-void saLogDispatch_01(void)
+/* Object to test: saLogDispatch() API
+ * Test: Dispatching with valid handle and flag
+ * Result: Shall pass with return code SA_AIS_OK
+ */
+void saLogDispatch_with_valid_hdl(void)
 {
rc = logInitialize();
if (rc == SA_AIS_OK)
@@ -25,3 +29,43 @@ void saLogDispatch_01(void)
test_validate(rc, SA_AIS_OK);
logFinalize();
 }
+
+/* Object to test: saLogDispatch() API:
+ * Test: Dispatching with finalized log handle
+ * step1:Call logInitialize()
+ * step2:call logFinalize()
+ * step3:Now call the saLogDispatch() with logHandle
+ * Result: Shall fail with return code SA_AIS_ERR_BAD_HANDLE
+ */
+void saLogDispatch_with_finalized_handle(void)
+{
+   rc = logInitialize();
+   logFinalize();
+   rc = saLogDispatch(logHandle, SA_DISPATCH_ALL);
+   test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
+}
+
+/* Object to test: saLogDispatch() API:
+ * Test: Dispatching with invalid handle(0)
+ * Result: Shall fail with return code SA_AIS_ERR_BAD_HANDLE
+ */
+void saLogDispatch_with_invalid_handle(void)
+{
+   rc = logInitialize();
+   if (rc == SA_AIS_OK)
+   rc = saLogDispatch(0, SA_DISPATCH_ALL);
+   test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
+   logFinalize();
+}
+
+__attribute__((constructor)) static void saLibraryLifeCycle_constructor(void)
+{
+   test_suite_add(1, "Library Life Cycle");
+   test_case_add(1, saLogDispatch_with_valid_hdl, "saLogDispatch() OK");
+   test_case_add(
+   1, saLogDispatch_with_finalized_handle,
+   "saLogDispatch() with finalized handle");
+   test_case_add(
+   1, saLogDispatch_with_invalid_handle,
+   "saLogDispatch() with invalid handle");
+}
diff --git a/src/log/apitest/tet_saLogFinalize.c 
b/src/log/apitest/tet_saLogFinalize.c
index 7b23a98..a9b4408 100644
--- a/src/log/apitest/tet_saLogFinalize.c
+++ b/src/log/apitest/tet_saLogFinalize.c
@@ -17,7 +17,13 @@
 
 #include "logtest.h"
 
-void saLogFinalize_01(void)
+/* Object to test: saLogFinalize() API:
+ * Test: Finalizing with valid handle
+ * step1:Call saLogInitialize() API and it returns SA_AIS_OK
+ * step2:Now call the saLogFinalize() with logHandle
+ * Result: Shall PASS with return code SA_AIS_OK
+ */
+void saLogFinalize_with_valid_hdl(void)
 {
rc = logInitialize();
if (rc == SA_AIS_OK)
@@ -25,8 +31,38 @@ void saLogFinalize_01(void)
test_validate(rc, SA_AIS_OK);
 }
 
-void saLogFinalize_02(void)
+/* Object to test: saLogFinalize() API:
+ * Test: Finalizing with invalid handle(0)
+ * Result: Shall fail with return code SA_AIS_ERR_BAD_HANDLE
+ */
+void saLogFinalize_with_invalid_handle(void)
 {
rc = saLogFinalize(0);
test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
 }
+
+/* Object to test: saLogFinalize() API:
+ * Test: Finalizing with finalized handle
+ * step1:Call saLogInitialize() API and it returns SA_AIS_OK
+ * step2:call logFinalize()
+ * step3:Now call the saLogFinalize() with logHandle
+ * Result: Shall fail with return code SA_AIS_ERR_BAD_HANDLE
+ */
+void saLogFinalize_with_finalized_handle(void)
+{
+   SaVersionT log_version = kLogVersion;
+   rc = saLogInitialize(, , _version);
+   logFinalize();
+   rc = saLogFinalize(logHandle);
+   test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
+}
+
+__attribute__((constructor)) static void saLibraryLifeCycle_constructor(void)
+{
+   test_suite_add(1, "Library Life Cycle");
+   test_case_add(1, saLogFinalize_with_valid_hdl, "saLogFinalize() OK");
+   test_case_add(1, saLogFinalize_with_invalid_handle,
+ "saLogFinalize() with NULL log handle");
+   test_case_add(1, saLogFinalize_with_finalized_handle,
+ "saLogFinalize() with finalized log handle");
+}
diff --git a/src/log/apitest/tet_saLogInitialize.c 
b/src/log/apitest/tet_saLogInitialize.c
index 3d31c8e..de2595a 100644
--- a/src/log/apitest/tet_saLogInitialize.c
+++ b/src/log/apitest/tet_saLogInitialize.c
@@ -108,12 +108,54 @@ void saLogInitialize_11(void)
test_validate(rc, SA_AIS_OK);
 }
 
-extern void saLogSelectionObjectGet_01(void);
-extern void