Search in sources :

Example 1 with HealthMonitorService

use of com.emc.storageos.systemservices.impl.resource.HealthMonitorService in project coprhd-controller by CoprHD.

the class DiagnosticsExecTest method testNodeDiagnostics.

@Test
public void testNodeDiagnostics() {
    HealthMonitorService healthMonitorService = new HealthMonitorService();
    DiagnosticsRestRep resp = healthMonitorService.getDiagnostics(null, "1", null);
    Assert.assertNotNull(resp);
    Assert.assertNotNull(resp.getNodeDiagnosticsList());
    Set<String> testNames = new HashSet<String>();
    for (NodeDiagnostics diag : resp.getNodeDiagnosticsList()) {
        Assert.assertTrue(diag.getNodeId() != null && !diag.getNodeId().isEmpty());
        Assert.assertTrue(diag.getIp() != null && !diag.getIp().isEmpty());
        Assert.assertNotNull(diag.getDiagTests());
        for (DiagTest test : diag.getDiagTests()) {
            testNames.add(test.getName());
            Assert.assertTrue(test.getStatus() != null && !test.getStatus().isEmpty());
            if (test.getTestParams() != null) {
                for (TestParam param : test.getTestParams()) {
                    Assert.assertTrue(param.getKey() != null && !param.getKey().isEmpty());
                    Assert.assertTrue(param.getValue() != null && !param.getValue().isEmpty());
                }
            }
        }
        Assert.assertTrue(testNames.containsAll(DIAG_TESTS));
    }
}
Also used : HealthMonitorService(com.emc.storageos.systemservices.impl.resource.HealthMonitorService) TestParam(com.emc.vipr.model.sys.healthmonitor.TestParam) DiagnosticsRestRep(com.emc.vipr.model.sys.healthmonitor.DiagnosticsRestRep) DiagTest(com.emc.vipr.model.sys.healthmonitor.DiagTest) NodeDiagnostics(com.emc.vipr.model.sys.healthmonitor.NodeDiagnostics) HashSet(java.util.HashSet) Test(org.junit.Test) DiagTest(com.emc.vipr.model.sys.healthmonitor.DiagTest)

Aggregations

HealthMonitorService (com.emc.storageos.systemservices.impl.resource.HealthMonitorService)1 DiagTest (com.emc.vipr.model.sys.healthmonitor.DiagTest)1 DiagnosticsRestRep (com.emc.vipr.model.sys.healthmonitor.DiagnosticsRestRep)1 NodeDiagnostics (com.emc.vipr.model.sys.healthmonitor.NodeDiagnostics)1 TestParam (com.emc.vipr.model.sys.healthmonitor.TestParam)1 HashSet (java.util.HashSet)1 Test (org.junit.Test)1