osaf/libs/agents/saf/ntfa/ntfa_api.c      |   2 +-
 osaf/libs/common/ntfsv/ntfsv_mem.c        |   2 +-
 osaf/services/saf/ntfsv/ntfs/NtfLogger.cc |   2 +-
 tests/ntfsv/tet_ntf_clm.c                 |  92 ++++++++++++++++++------------
 tests/ntfsv/tet_saNtfFinalize.c           |   5 +-
 5 files changed, 60 insertions(+), 43 deletions(-)


List of changes:
-Changed LOG_ER to LOG_NO observed while running ntftests.
-Corrected test no 4 in Finalize test suite.
-Changed NTF-CLM suite number from 38 to 40, as 38 is already in use in 
Headless suite.

diff --git a/osaf/libs/agents/saf/ntfa/ntfa_api.c 
b/osaf/libs/agents/saf/ntfa/ntfa_api.c
--- a/osaf/libs/agents/saf/ntfa/ntfa_api.c
+++ b/osaf/libs/agents/saf/ntfa/ntfa_api.c
@@ -119,7 +119,7 @@ static SaAisErrorT checkNtfValue(v_data*
                        size_t length_to_copy;
                        void *p;
                        if (value->ptrVal.dataSize < 
(osaf_extended_name_length(ptr) + 2)) {
-                               LOG_ER("The allocated memory is not large 
enough,"
+                               LOG_NO("The allocated memory is not large 
enough,"
                                                " the object will be truncated 
(%s)"
                                                , 
osaf_extended_name_borrow(ptr));
                                length_to_copy = value->ptrVal.dataSize - 2;    
        
diff --git a/osaf/libs/common/ntfsv/ntfsv_mem.c 
b/osaf/libs/common/ntfsv/ntfsv_mem.c
--- a/osaf/libs/common/ntfsv/ntfsv_mem.c
+++ b/osaf/libs/common/ntfsv/ntfsv_mem.c
@@ -1272,7 +1272,7 @@ SaAisErrorT ntfsv_sanamet_copy(SaNameT* 
 bool ntfsv_sanamet_is_valid(const SaNameT* pName)
 {
        if (!osaf_is_extended_name_valid(pName)) {
-               LOG_ER("Environment variable SA_ENABLE_EXTENDED_NAMES "
+               LOG_NO("Environment variable SA_ENABLE_EXTENDED_NAMES "
                        "is not set, or not using extended name api");
                return false;
        }
diff --git a/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc 
b/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc
--- a/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc
+++ b/osaf/services/saf/ntfsv/ntfs/NtfLogger.cc
@@ -252,7 +252,7 @@ SaAisErrorT NtfLogger::logNotification(N
                                        &logRecord);
         if (SA_AIS_OK != errorCode)
         {
-            LOG_ER("Failed to log an alarm or security alarm notification 
(%d)", errorCode);
+            LOG_NO("Failed to log an alarm or security alarm notification 
(%d)", errorCode);
             if (errorCode == SA_AIS_ERR_LIBRARY || errorCode == 
SA_AIS_ERR_BAD_HANDLE) {
                 LOG_ER("Fatal error SA_AIS_ERR_LIBRARY or 
SA_AIS_ERR_BAD_HANDLE; exiting (%d)...", errorCode);
                 exit(EXIT_FAILURE);
diff --git a/tests/ntfsv/tet_ntf_clm.c b/tests/ntfsv/tet_ntf_clm.c
--- a/tests/ntfsv/tet_ntf_clm.c
+++ b/tests/ntfsv/tet_ntf_clm.c
@@ -45,16 +45,12 @@ int lock_clm_node(void)
 {
        int rc = 0;
        rc = system(lock_cmd);
-       if (rc != 0)
-               printf("lock of CLM node failed, maybe active controller.\n");
        return rc;
 }
 int unlock_clm_node(void)
 {
        int rc = 0;
        rc = system(unlock_cmd);
-       if (rc != 0)
-               printf("UNLOCK of CLM node failed.\n");
        return rc;
 }
 
@@ -458,44 +454,64 @@ void ntf_clm_22()
        //printf("lock_cmd:'%s'\n",lock_cmd);
        //printf("unlock_cmd:'%s'\n",unlock_cmd);
 
-       /* Check if CLM node lock is allowed on this node.
-          (On active controller clm lock/shutdown is not allowed.).*/
-       if (lock_clm_node() != 0)
-               return;
-       if (unlock_clm_node() != 0)
-               return;
 
-       test_suite_add(38, "Ntf CLM Integration test suite\n");
+       //Add these test cases on other than active controller.
+       int rc = 0;
+       char role[80];
+       rc = system("which rdegetrole");
+       if (rc == 0) {
+               printf("This is a controller node\n");
+               //Command rdegetrole exists means a controller.
+               memset(buffer, '\0', sizeof(buffer));
+               memset(role, '\0', sizeof(role));
+               strcpy(buffer, "rdegetrole");
+               fp = popen(buffer,"r");
+               if (fgets(role, sizeof(role), fp) != NULL)
+               {
+                       if ((ptr = strchr(role, '\n')) != NULL)
+                               *ptr = '\0';
+                       if (!strcmp((char *) role, "ACTIVE")) {
+                               //printf("Active controller node\n");
+                               pclose(fp);
+                               return;
+                       }
+               } 
+               pclose(fp);
+       } else {
+               printf("This is a payload node\n");
+       }
+
+       test_suite_add(40, "Ntf CLM Integration test suite\n");
 
        //API with A0101 initialization should work.
-       test_case_add(38,ntf_clm_A0101_01, "Send Object Ntf with A0101 init on 
CLM locked node - SA_AIS_OK");
-       test_case_add(38,ntf_clm_A0101_02, "Send Attribute Ntf with A0101 on 
CLM locked node - SA_AIS_OK");
-       test_case_add(38,ntf_clm_A0101_03, "Send State Change Ntf with A0101 on 
CLM locked node - SA_AIS_OK");
-       test_case_add(38,ntf_clm_A0101_04, "Send Alarm Ntf with A0101 init on 
CLM locked node - SA_AIS_OK");
-       test_case_add(38,ntf_clm_A0101_05, "Send Security Ntf with A0101 on CLM 
locked node - SA_AIS_OK");
+       test_case_add(40,ntf_clm_A0101_01, "Send Object Ntf with A0101 init on 
CLM locked node - SA_AIS_OK");
+       test_case_add(40,ntf_clm_A0101_02, "Send Attribute Ntf with A0101 on 
CLM locked node - SA_AIS_OK");
+       test_case_add(40,ntf_clm_A0101_03, "Send State Change Ntf with A0101 on 
CLM locked node - SA_AIS_OK");
+       test_case_add(40,ntf_clm_A0101_04, "Send Alarm Ntf with A0101 init on 
CLM locked node - SA_AIS_OK");
+       test_case_add(40,ntf_clm_A0101_05, "Send Security Ntf with A0101 on CLM 
locked node - SA_AIS_OK");
 
        //Each API with A0102 initialization.
-       test_case_add(38,ntf_clm_01, "saNtfInitialize() with A0102 on CLM 
locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_02, "saNtfSelectionObjectGet() with A0102 on 
CLM locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_03, "saNtfDispatch() with A0102 on CLM locked 
node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_04, "saNtfFinalize() with A0102 on CLM locked 
node - SA_AIS_OK");
-       test_case_add(38,ntf_clm_05, "saNtfStateChangeNotificationAllocate() 
with A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_06, 
"saNtfObjectCreateDeleteNotificationAllocate() with A0102 on CLM locked node - 
SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_07, 
"saNtfAttributeChangeNotificationAllocate() with A0102 on CLM locked node - 
SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_08, "saNtfAlarmNotificationAllocate() with 
A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_09, "saNtfSecurityAlarmNotificationAllocate() 
with A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_10, "saNtfNotificationSend() with A0102 on CLM 
locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_11, "saNtfNotificationFree() with A0102 on CLM 
locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_12, 
"saNtfStateChangeNotificationFilterAllocate() with A0102 on CLM locked node - 
SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_13, 
"saNtfObjectCreateDeleteNotificationFilterAllocate() with A0102 on CLM locked 
node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_14, 
"saNtfAttributeChangeNotificationFilterAllocate() with A0102 on CLM locked node 
- SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_15, "saNtfAlarmNotificationFilterAllocate() 
with A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_16, 
"saNtfSecurityAlarmNotificationFilterAllocate() with A0102 on CLM locked node - 
SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_17, "saNtfNotificationFilterFree() with A0102 
on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_18, "saNtfNotificationSubscribe() with A0102 
on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_19, "saNtfNotificationUnsubscribe() with A0102 
on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_20, "saNtfNotificationReadInitialize() with 
A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_21, "saNtfNotificationReadNext() with A0102 on 
CLM locked node - SA_AIS_ERR_UNAVAILABLE");
-       test_case_add(38,ntf_clm_22, "saNtfNotificationReadFinalize() with 
A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_01, "saNtfInitialize() with A0102 on CLM 
locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_02, "saNtfSelectionObjectGet() with A0102 on 
CLM locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_03, "saNtfDispatch() with A0102 on CLM locked 
node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_04, "saNtfFinalize() with A0102 on CLM locked 
node - SA_AIS_OK");
+       test_case_add(40,ntf_clm_05, "saNtfStateChangeNotificationAllocate() 
with A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_06, 
"saNtfObjectCreateDeleteNotificationAllocate() with A0102 on CLM locked node - 
SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_07, 
"saNtfAttributeChangeNotificationAllocate() with A0102 on CLM locked node - 
SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_08, "saNtfAlarmNotificationAllocate() with 
A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_09, "saNtfSecurityAlarmNotificationAllocate() 
with A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_10, "saNtfNotificationSend() with A0102 on CLM 
locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_11, "saNtfNotificationFree() with A0102 on CLM 
locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_12, 
"saNtfStateChangeNotificationFilterAllocate() with A0102 on CLM locked node - 
SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_13, 
"saNtfObjectCreateDeleteNotificationFilterAllocate() with A0102 on CLM locked 
node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_14, 
"saNtfAttributeChangeNotificationFilterAllocate() with A0102 on CLM locked node 
- SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_15, "saNtfAlarmNotificationFilterAllocate() 
with A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_16, 
"saNtfSecurityAlarmNotificationFilterAllocate() with A0102 on CLM locked node - 
SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_17, "saNtfNotificationFilterFree() with A0102 
on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_18, "saNtfNotificationSubscribe() with A0102 
on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_19, "saNtfNotificationUnsubscribe() with A0102 
on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_20, "saNtfNotificationReadInitialize() with 
A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_21, "saNtfNotificationReadNext() with A0102 on 
CLM locked node - SA_AIS_ERR_UNAVAILABLE");
+       test_case_add(40,ntf_clm_22, "saNtfNotificationReadFinalize() with 
A0102 on CLM locked node - SA_AIS_ERR_UNAVAILABLE");
 
 }
diff --git a/tests/ntfsv/tet_saNtfFinalize.c b/tests/ntfsv/tet_saNtfFinalize.c
--- a/tests/ntfsv/tet_saNtfFinalize.c
+++ b/tests/ntfsv/tet_saNtfFinalize.c
@@ -77,8 +77,9 @@ void saNtfFinalize_04()
     pthread_join(thread, NULL);
     printf("    Return value from thread:%u\n",ret2);
 
-    //saNtfUnsubscribe() may fail with expected return value BAD_HANDLE or 
TRY_AGAIN.
-    if ((ret2 == SA_AIS_ERR_BAD_HANDLE) || (ret2 == SA_AIS_ERR_TRY_AGAIN))
+    //saNtfUnsubscribe() may fail with expected return value BAD_HANDLE or 
TRY_AGAIN or NOT_EXIST.
+    if ((ret2 == SA_AIS_ERR_BAD_HANDLE) || (ret2 == SA_AIS_ERR_TRY_AGAIN) ||
+                   (ret2 == SA_AIS_ERR_NOT_EXIST))
            ret2 = SA_AIS_OK;
     safassert(ret2,SA_AIS_OK);
     test_validate(ret1, SA_AIS_OK);

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to