use of com.emc.storageos.util.DummyDbClient in project coprhd-controller by CoprHD.
the class VPlexHDSMaskingOrchestratorTest method main.
public static void main(String[] args) {
VdcUtil.setDbClient(new DummyDbClient());
PropertyConfigurator.configure("log4j.properties");
_log.info("Beginning logging");
PortAllocatorTestContext contextPrototype = new PortAllocatorTestContext();
StoragePortsAllocator.setContextPrototype(contextPrototype);
VPlexHDSMaskingOrchestrator orca = new VPlexHDSMaskingOrchestrator(null, null);
VPlexBackendManager bemgr = new VPlexBackendManager();
orca.setSimulation(true);
URI arrayURI = URI.create("hdsArray");
Map<String, Set<String>> directorToInitiators = new HashMap<String, Set<String>>();
Map<String, URI> initiatorIdToNetwork = new HashMap<String, URI>();
Map<String, Initiator> initiatorMap = new HashMap<String, Initiator>();
PortAllocationContext context = null;
Map<URI, NetworkLite> networkMap = new HashMap<URI, NetworkLite>();
Map<URI, List<StoragePort>> allocatablePorts = new HashMap<URI, List<StoragePort>>();
URI varray1 = URI.create("varray1");
context = getNet1Ports(networkMap, allocatablePorts);
context = getNet2Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net2", null);
Set<Map<String, Map<URI, Set<Initiator>>>> initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
// orca.getInitiatorGroups(directorToInitiators, initiatorIdToNetwork, initiatorMap);
Set<Map<URI, List<List<StoragePort>>>> portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet1Ports(networkMap, allocatablePorts);
context = getNet0Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net0", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet3Ports(networkMap, allocatablePorts);
context = getNet4Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet3Ports(networkMap, allocatablePorts);
context = getNet4Ports(networkMap, allocatablePorts);
context = getNet4XPorts(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", "net4X");
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet5Ports(networkMap, allocatablePorts);
context = getNet6Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net5", "net6", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet7Ports(networkMap, allocatablePorts);
context = getNet8Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net7", "net8", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet573APorts(networkMap, allocatablePorts);
context = getNet573BPorts(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net573A", "net573B", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
}
use of com.emc.storageos.util.DummyDbClient in project coprhd-controller by CoprHD.
the class VPlexXtremIOMaskingOrchestratorTest method main.
public static void main(String[] args) throws InterruptedException {
VdcUtil.setDbClient(new DummyDbClient());
PropertyConfigurator.configure("log4j.properties");
_log.info("Beginning logging");
PortAllocatorTestContext contextPrototype = new PortAllocatorTestContext();
StoragePortsAllocator.setContextPrototype(contextPrototype);
VplexXtremIOMaskingOrchestrator orca = new VplexXtremIOMaskingOrchestrator(null, null);
VPlexBackendManager bemgr = new VPlexBackendManager();
orca.setSimulation(true);
URI arrayURI = URI.create("vmaxArray");
Map<String, Set<String>> directorToInitiators = new HashMap<String, Set<String>>();
Map<String, URI> initiatorIdToNetwork = new HashMap<String, URI>();
Map<String, Initiator> initiatorMap = new HashMap<String, Initiator>();
PortAllocationContext context = null;
Map<URI, NetworkLite> networkMap = new HashMap<URI, NetworkLite>();
Map<URI, List<StoragePort>> allocatablePorts = new HashMap<URI, List<StoragePort>>();
URI varray1 = URI.create("varray1");
// single VPLEX Engine
/**
* Single VPLEX Engine (2 Directors)
* Single X-brick (2 SCs, 4 storage ports), 2 networks
* SC ports spread across networks
*/
context = getNet1Ports(networkMap, allocatablePorts);
context = getNet2Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net2", null);
Set<Map<String, Map<URI, Set<Initiator>>>> initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
// orca.getInitiatorGroups(directorToInitiators, initiatorIdToNetwork, initiatorMap);
int directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
Set<Map<URI, List<List<StoragePort>>>> portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
/**
* Single VPLEX Engine (2 Directors)
* Dual X-bricks (4 SCs, 8 storage ports), 2 networks
* ports spread across networks
*/
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet3Ports(networkMap, allocatablePorts);
context = getNet4Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
/**
* Single VPLEX Engine (2 Directors)
* Dual X-bricks (4 SCs, 8 storage ports), 2 networks
* network-1 has X-brick 1's ports; network-2 has X-brick 2's ports;
*/
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet5Ports(networkMap, allocatablePorts);
context = getNet6Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net5", "net6", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
/**
* Single VPLEX Engine (2 Directors)
* Quad X-bricks (8 SCs, 16 storage ports), 2 networks
* ports spread across networks
*/
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet7Ports(networkMap, allocatablePorts);
context = getNet8Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net7", "net8", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
/**
* Single VPLEX Engine (2 Directors)
* Dual X-bricks (4 SCs, 3 ports from X-brick 1, 3 ports from X-brick 2), 2 networks
* ports spread across networks with second network having only 2 ports
*/
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNetAPorts(networkMap, allocatablePorts);
context = getNetBPorts(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1(directorToInitiators, initiatorIdToNetwork, initiatorMap, "netA", "netB", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
// Dual VPLEX Engine
/**
* Dual VPLEX Engine (4 Directors)
* Single X-brick (2 SCs, 4 storage ports), 2 networks
* SC ports spread across networks
*/
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet1Ports(networkMap, allocatablePorts);
context = getNet2Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1DualEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net2", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
/**
* Dual VPLEX Engine (4 Directors)
* Dual X-bricks (4 SCs, 8 storage ports), 2 networks
* ports spread across networks
*/
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet3Ports(networkMap, allocatablePorts);
context = getNet4Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1DualEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
/**
* Dual VPLEX Engine (4 Directors)
* Quad X-bricks (8 SCs, 16 storage ports), 2 networks
* ports spread across networks
*/
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet7Ports(networkMap, allocatablePorts);
context = getNet8Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1DualEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net7", "net8", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
// Quad VPLEX Engine
/**
* Quad VPLEX Engine (8 Directors)
* Single X-brick (2 SCs, 4 storage ports), 2 networks
* SC ports spread across networks
*/
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet1Ports(networkMap, allocatablePorts);
context = getNet2Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1QuadEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net1", "net2", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
/**
* Quad VPLEX Engine (8 Directors)
* Dual X-bricks (4 SCs, 8 storage ports), 2 networks
* ports spread across networks
*/
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet3Ports(networkMap, allocatablePorts);
context = getNet4Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1QuadEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3", "net4", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
/**
* Quad VPLEX Engine (8 Directors)
* Quad X-bricks (8 SCs, 16 storage ports), 2 networks
* ports spread across networks
*/
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
context = getNet7Ports(networkMap, allocatablePorts);
context = getNet8Ports(networkMap, allocatablePorts);
logNetworks(allocatablePorts);
getInitiatorsVplex154Clus1QuadEngines(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net7", "net8", null);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), null, null, null);
makeExportMasks(arrayURI, orca, portGroups, initiatorGroups, networkMap);
/**
* Switch affinity tests
*/
context.reinitialize();
networkMap.clear();
allocatablePorts.clear();
Map<URI, Map<String, List<StoragePort>>> portSwitchMap = new HashMap<URI, Map<String, List<StoragePort>>>();
PortAllocationContext context1 = getNet3PortsSA(networkMap, allocatablePorts, portSwitchMap);
PortAllocationContext context2 = getNet4PortsSA(networkMap, allocatablePorts, portSwitchMap);
Map<URI, PortAllocationContext> contextMap = new HashMap<URI, PortAllocationContext>();
contextMap.put(context1._initiatorNetwork.getId(), context1);
contextMap.put(context2._initiatorNetwork.getId(), context2);
logNetworks(allocatablePorts);
Map<URI, String> initiatorSwitchMap = new HashMap<URI, String>();
getInitiatorsVplex154Clus1DualEnginesSA(directorToInitiators, initiatorIdToNetwork, initiatorMap, "net3SA", "net4SA", initiatorSwitchMap);
initiatorGroups = bemgr.getInitiatorGroups("test", directorToInitiators, initiatorIdToNetwork, initiatorMap, false, true);
directorCount = bemgr.getVplexDirectorCount(initiatorGroups);
orca.setVplexDirectorCount(directorCount);
Map<URI, Map<String, Integer>> switchPortNumber = getSwitchToPortNumber(networkMap.keySet(), 2);
portGroups = orca.getPortGroups(allocatablePorts, networkMap, varray1, initiatorGroups.size(), switchPortNumber, contextMap, null);
makeExportMasksSA(arrayURI, orca, portGroups, initiatorGroups, networkMap, initiatorSwitchMap, portSwitchMap);
}
use of com.emc.storageos.util.DummyDbClient in project coprhd-controller by CoprHD.
the class BiosCommandResultTest method setUp.
@Before
public void setUp() throws Exception {
_isi = new IsilonFileStorageDevice();
IsilonApiFactory factory = new IsilonApiFactory();
factory.init();
_isi.setIsilonApiFactory(factory);
_isi.setDbClient(new DummyDbClient() {
@Override
public List<URI> queryByConstraint(Constraint constraint) throws DatabaseException {
return new ArrayList<>();
}
});
// storage device object for tests to use
_device = new StorageSystem();
_device.setIpAddress(ip);
_device.setPortNumber(Integer.parseInt(portNumber));
_device.setUsername(userName);
_device.setPassword(password);
_pool = new StoragePool();
}
use of com.emc.storageos.util.DummyDbClient in project coprhd-controller by CoprHD.
the class StoragePortsAllocatorTest method main.
public static void main(String[] args) throws Exception {
for (String arg : args) {
if (arg.equals("vmaxonly")) {
vmaxonly = true;
}
if (arg.equals("vnxonly")) {
vnxonly = true;
}
if (arg.equals("vplexonly")) {
vplexonly = true;
}
}
VdcUtil.setDbClient(new DummyDbClient());
PropertyConfigurator.configure("log4j.properties");
_log.info("Beginning logging");
testFC();
testIP();
System.out.println("Empty transport zone, should throw PlacementException");
PortAllocationContext ctx = createEmptyTzone();
StoragePortsAllocator allocator = new StoragePortsAllocator();
try {
alloc(allocator, 1, ctx, true);
} catch (PlacementException ex) {
System.out.println("caught PlacementException: " + ex.toString());
}
System.out.println("done");
_log.info(pass ? "PASSED" : "FAILED");
}
Aggregations