- **status**: unassigned --> accepted
- **assigned_to**: elunlen


---

** [tickets:#2505] ntf: Test cases fail on SC nodes**

**Status:** accepted
**Milestone:** 5.17.08
**Created:** Tue Jun 20, 2017 08:58 AM UTC by elunlen
**Last Updated:** Tue Jun 20, 2017 08:58 AM UTC
**Owner:** elunlen


The following code is not correct. The rdegetrole command can be found on all 
nodes. However if it is used on a PL node it will report Fail insted of ACTIVE 
or STANDBY

On PL node:
> rdegetrole
rda_get_role failed

In file tet_ntf_clm.c:

// 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");
        }



---

Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/opensaf/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/opensaf/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-tickets mailing list
Opensaf-tickets@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

Reply via email to