@Override public String verifyRMRegistrationResponseForNodeLabels( RegisterNodeManagerResponse regNMResponse) { StringBuilder successfulNodeLabelsRegistrationMsg = new StringBuilder(""); if (regNMResponse.getAreNodeLabelsAcceptedByRM()) { successfulNodeLabelsRegistrationMsg .append(" and with following Node label(s) : {") .append(StringUtils.join(",", previousNodeLabels)).append("}"); } else { // case where provider is set but RM did not accept the Node Labels String errorMsgFromRM = regNMResponse.getDiagnosticsMessage(); LOG.error( "NodeLabels sent from NM while registration were rejected by RM. " + ((errorMsgFromRM == null) ? "Seems like RM is configured with Centralized Labels." : "And with message " + regNMResponse.getDiagnosticsMessage())); } return successfulNodeLabelsRegistrationMsg.toString(); }
@Override public String verifyRMRegistrationResponseForNodeLabels( RegisterNodeManagerResponse regNMResponse) { StringBuilder successfulNodeLabelsRegistrationMsg = new StringBuilder(""); if (regNMResponse.getAreNodeLabelsAcceptedByRM()) { successfulNodeLabelsRegistrationMsg .append(" and with following Node label(s) : {") .append(StringUtils.join(",", previousNodeLabels)).append("}"); } else { // case where provider is set but RM did not accept the Node Labels String errorMsgFromRM = regNMResponse.getDiagnosticsMessage(); LOG.error( "NodeLabels sent from NM while registration were rejected by RM. " + ((errorMsgFromRM == null) ? "Seems like RM is configured with Centralized Labels." : "And with message " + regNMResponse.getDiagnosticsMessage())); } return successfulNodeLabelsRegistrationMsg.toString(); }
.append("registered with capability: ").append(capability); message.append(", assigned nodeId ").append(nodeId); if (response.getAreNodeLabelsAcceptedByRM()) { message.append(", node labels { ").append( StringUtils.join(",", nodeLabels) + " } ");
"Node Labels should not accepted by RM If its configured with " + "Central configuration", response.getAreNodeLabelsAcceptedByRM()); if (rm != null) { rm.stop();
Assert.assertNotNull(response.getDiagnosticsMessage()); Assert.assertFalse("Node Labels should not accepted by RM If Invalid", response.getAreNodeLabelsAcceptedByRM());
Assert.assertNotNull(response.getDiagnosticsMessage()); Assert.assertFalse("Node Labels should not accepted by RM If Invalid", response.getAreNodeLabelsAcceptedByRM());
NodeLabelsUtils.convertToStringSet(registerReq.getNodeLabels())); Assert.assertTrue("Valid Node Labels were not accepted by RM", response.getAreNodeLabelsAcceptedByRM()); rm.stop();