static void ensureIsRemoteSetup(SimulatorProperties properties, String action) { if (isLocal(properties)) { throw new CommandLineExitException(format("Cannot execute '%s' in local setup", action)); } }
public static boolean isCloudProvider(SimulatorProperties properties) { return (!isLocal(properties) && !isStatic(properties)); }
public static boolean isLocal(SimulatorProperties properties) { return isLocal(properties.getCloudProvider()); }
public void run() { if (isLocal(simulatorProperties)) { cleanLocal(); } else { cleanRemote(); } }
public void run() { if (isLocal(simulatorProperties)) { downloadLocal(); } else { downloadRemote(); } }
private ComponentRegistry newComponentRegistry(SimulatorProperties simulatorProperties) { ComponentRegistry componentRegistry; if (isLocal(simulatorProperties)) { componentRegistry = new ComponentRegistry(); componentRegistry.addAgent("localhost", "localhost"); } else { componentRegistry = loadComponentRegister(getAgentsFile()); } if (options.has(dedicatedMemberMachinesSpec)) { componentRegistry.assignDedicatedMemberMachines(options.valueOf(dedicatedMemberMachinesSpec)); } return componentRegistry; }
copyResourceFile(workDir, "test.properties", "testSuite"); if (isLocal(cloudProvider)) { return;
void sshConnectionCheck(SimulatorProperties simulatorProperties, Bash bash) { if (isLocal(simulatorProperties)) { throw new CommandLineExitException("SSH is not supported for local setups."); } ComponentRegistry componentRegistry = loadComponentRegister(agentFile, true); String userName = simulatorProperties.getUser(); for (AgentData agentData : componentRegistry.getAgents()) { String publicAddress = agentData.getPublicAddress(); echo("Connecting to %s@%s...", userName, publicAddress); bash.ssh(publicAddress, "echo ok 2>&1"); } echo("Connected successfully to all remote machines!"); }