Search in sources :

Example 1 with RPSystem

use of com.emc.storageos.recoverpoint.objectmodel.RPSystem in project coprhd-controller by CoprHD.

the class RecoverPointClientIntegrationTest method testGetAllArrays.

@Test
public void testGetAllArrays() {
    RPSystem rpSystem = new RPSystem();
    RPSite site = new RPSite();
    Set<RPSite> siteList = new HashSet<RPSite>();
    site.setCredentials(RP_USERNAME, RP_PASSWORD);
    site.setSiteManagementIPv4(RPSiteToUse);
    siteList.add(site);
    rpSystem.setSites(siteList);
    rpSystem.setName(RPSystemName);
    setup();
    logger.info("Testing RecoverPoint Service getArraysForCluster");
    // NOSONAR
    site.setSiteManagementIPv4(RPSiteToUse);
    try {
        Map<String, Set<String>> returnList;
        setupClient(RPSiteToUse, RP_USERNAME, RP_PASSWORD);
        returnList = rpClient.getArraysForClusters();
        if (returnList.size() == 0) {
            logger.info("getArraysForCluster FAILED");
            fail();
        }
    } catch (Exception e) {
        logger.error(e.toString());
        logger.info("TestGetAllArrays FAILED");
        fail();
    }
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) RPSystem(com.emc.storageos.recoverpoint.objectmodel.RPSystem) RPSite(com.emc.storageos.recoverpoint.objectmodel.RPSite) URISyntaxException(java.net.URISyntaxException) RecoverPointException(com.emc.storageos.recoverpoint.exceptions.RecoverPointException) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 2 with RPSystem

use of com.emc.storageos.recoverpoint.objectmodel.RPSystem in project coprhd-controller by CoprHD.

the class RecoverPointClientIntegrationTest method testGetAllSites.

@Test
public void testGetAllSites() {
    RPSystem rpSystem = new RPSystem();
    RPSite site = new RPSite();
    Set<RPSite> siteList = new HashSet<RPSite>();
    site.setCredentials(RP_USERNAME, RP_PASSWORD);
    site.setSiteManagementIPv4(RPSiteToUse);
    siteList.add(site);
    rpSystem.setSites(siteList);
    rpSystem.setName(RPSystemName);
    setup();
    logger.info("Testing RecoverPoint Service getAllSites");
    // NOSONAR
    site.setSiteManagementIPv4(RPSiteToUse);
    try {
        Set<RPSite> returnList;
        setupClient(RPSiteToUse, RP_USERNAME, RP_PASSWORD);
        returnList = rpClient.getAssociatedRPSites();
        if (returnList.isEmpty()) {
            logger.info("getAssociatedRPSites FAILED");
            fail();
        }
    } catch (Exception e) {
        logger.error(e.toString());
        logger.info("TestGetAllSites FAILED");
        fail();
    }
    logger.info("Setting sitename to RPA IP address");
    setup();
    // NOSONAR
    site.setSiteManagementIPv4(SITE_MGMT_IPV4);
    try {
        Set<RPSite> returnList;
        setupClient(RPSiteToUse, RP_USERNAME, RP_PASSWORD);
        returnList = rpClient.getAssociatedRPSites();
        if (returnList.isEmpty()) {
            logger.info("getAssociatedRPSites FAILED");
            fail();
        }
    } catch (Exception e) {
        logger.error(e.toString());
        logger.info("TestGetAllSites FAILED");
        fail();
    }
}
Also used : RPSystem(com.emc.storageos.recoverpoint.objectmodel.RPSystem) RPSite(com.emc.storageos.recoverpoint.objectmodel.RPSite) URISyntaxException(java.net.URISyntaxException) RecoverPointException(com.emc.storageos.recoverpoint.exceptions.RecoverPointException) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 3 with RPSystem

use of com.emc.storageos.recoverpoint.objectmodel.RPSystem in project coprhd-controller by CoprHD.

the class RecoverPointClientIntegrationTest method testRecoverPointServiceGetSiteWWNs.

@Test
public void testRecoverPointServiceGetSiteWWNs() {
    RPSystem rpSystem = new RPSystem();
    RPSite site = new RPSite();
    Set<RPSite> siteList = new HashSet<RPSite>();
    site.setCredentials(RP_USERNAME, RP_PASSWORD);
    site.setSiteManagementIPv4(RPSiteToUse);
    siteList.add(site);
    rpSystem.setSites(siteList);
    rpSystem.setName(RPSystemName);
    setup();
    logger.info("Testing RecoverPoint Service getAllSites");
    // NOSONAR
    site.setSiteManagementIPv4(RPSiteToUse);
    try {
        Set<RPSite> returnList;
        setupClient(RPSiteToUse, RP_USERNAME, RP_PASSWORD);
        returnList = rpClient.getAssociatedRPSites();
        if (returnList.isEmpty()) {
            logger.info("getAssociatedRPSites FAILED");
            fail();
        }
        for (RPSite rpSite : returnList) {
            boolean foundError = false;
            logger.info("Testing RecoverPoint Get Site WWNs");
            Map<String, Map<String, String>> WWNs = null;
            WWNs = rpClient.getInitiatorWWNs(rpSite.getInternalSiteName());
            if (WWNs == null || WWNs.size() < 1) {
                foundError = true;
                fail("No WWNs were returned");
            }
            if (!foundError) {
                logger.info("TestRecoverPointServiceGetSiteWWNs PASSED.  Found " + WWNs.size() + " Initiator WWNs");
            }
        }
    } catch (Exception e) {
        logger.error(e.toString());
        logger.info("TestGetAllSites FAILED");
        fail();
    }
}
Also used : RPSystem(com.emc.storageos.recoverpoint.objectmodel.RPSystem) RPSite(com.emc.storageos.recoverpoint.objectmodel.RPSite) Map(java.util.Map) URISyntaxException(java.net.URISyntaxException) RecoverPointException(com.emc.storageos.recoverpoint.exceptions.RecoverPointException) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

RecoverPointException (com.emc.storageos.recoverpoint.exceptions.RecoverPointException)3 RPSite (com.emc.storageos.recoverpoint.objectmodel.RPSite)3 RPSystem (com.emc.storageos.recoverpoint.objectmodel.RPSystem)3 URISyntaxException (java.net.URISyntaxException)3 HashSet (java.util.HashSet)3 Test (org.junit.Test)3 Map (java.util.Map)1 Set (java.util.Set)1