Search in sources :

Example 31 with AgentData

use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.

the class AgentsFileTest method testLoad_onlyPublicAddress.

@Test
public void testLoad_onlyPublicAddress() {
    writeText("192.168.1.1", agentsFile);
    registry = load(agentsFile);
    assertEquals(1, registry.agentCount());
    AgentData agentData = registry.getFirstAgent();
    assertEquals("192.168.1.1", agentData.getPublicAddress());
    assertEquals("192.168.1.1", agentData.getPrivateAddress());
}
Also used : AgentData(com.hazelcast.simulator.coordinator.registry.AgentData) Test(org.junit.Test)

Example 32 with AgentData

use of com.hazelcast.simulator.coordinator.registry.AgentData in project hazelcast-simulator by hazelcast.

the class Wizard method createSshCopyIdScript.

void createSshCopyIdScript(SimulatorProperties simulatorProperties) {
    Registry registry = loadComponentRegister(agentFile, true);
    String userName = simulatorProperties.getUser();
    ensureExistingFile(SSH_COPY_ID_FILE);
    writeText("#!/bin/bash" + NEW_LINE + NEW_LINE, SSH_COPY_ID_FILE);
    for (AgentData agent : registry.getAgents()) {
        String publicAddress = agent.getPublicAddress();
        appendText(format("ssh-copy-id -i ~/.ssh/id_rsa.pub %s@%s%n", userName, publicAddress), SSH_COPY_ID_FILE);
    }
    execute(format("chmod u+x %s", SSH_COPY_ID_FILE.getAbsoluteFile()));
    echo("Please execute './%s' to copy your public RSA key to all remote machines.", SSH_COPY_ID_FILE.getName());
}
Also used : AgentData(com.hazelcast.simulator.coordinator.registry.AgentData) Registry(com.hazelcast.simulator.coordinator.registry.Registry)

Aggregations

AgentData (com.hazelcast.simulator.coordinator.registry.AgentData)32 Test (org.junit.Test)10 Registry (com.hazelcast.simulator.coordinator.registry.Registry)7 ThreadSpawner (com.hazelcast.simulator.utils.ThreadSpawner)5 CommandLineExitException (com.hazelcast.simulator.utils.CommandLineExitException)3 WorkerParameters (com.hazelcast.simulator.agent.workerprocess.WorkerParameters)2 SimulatorProperties (com.hazelcast.simulator.common.SimulatorProperties)2 AgentData.publicAddressesString (com.hazelcast.simulator.coordinator.registry.AgentData.publicAddressesString)2 BashCommand (com.hazelcast.simulator.utils.BashCommand)2 VendorDriver (com.hazelcast.simulator.vendors.VendorDriver)2 File (java.io.File)2 ArrayList (java.util.ArrayList)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 Map (java.util.Map)2 Before (org.junit.Before)2 ConfigFileTemplate (com.hazelcast.simulator.coordinator.ConfigFileTemplate)1 WorkerData (com.hazelcast.simulator.coordinator.registry.WorkerData)1 SimulatorAddress (com.hazelcast.simulator.protocol.core.SimulatorAddress)1 FileUtils.ensureExistingFile (com.hazelcast.simulator.utils.FileUtils.ensureExistingFile)1