use of com.thoughtworks.go.remote.AgentIdentifier in project gocd by gocd.
the class AgentInstanceTest method shouldSyncIPWithConfig.
@Test
public void shouldSyncIPWithConfig() {
AgentInstance original = AgentInstance.createFromConfig(agentConfig, systemEnvironment, mock(AgentStatusChangeListener.class));
original.update(new AgentRuntimeInfo(new AgentIdentifier("CCeDev01", "10.18.5.2", "uuid2"), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false));
assertThat(original.agentConfig(), is(new AgentConfig("uuid2", "CCeDev01", "10.18.5.2")));
}
use of com.thoughtworks.go.remote.AgentIdentifier in project gocd by gocd.
the class AgentInstanceTest method shouldUpdateIPForPhysicalMachineWhenUpChanged.
@Test
public void shouldUpdateIPForPhysicalMachineWhenUpChanged() throws Exception {
AgentInstance agentInstance = AgentInstance.createFromConfig(agentConfig, systemEnvironment, mock(AgentStatusChangeListener.class));
agentInstance.update(new AgentRuntimeInfo(new AgentIdentifier("ccedev01", "10.18.7.52", "uuid"), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false));
assertThat(agentInstance.agentConfig().getIpAddress(), is("10.18.7.52"));
}
use of com.thoughtworks.go.remote.AgentIdentifier in project gocd by gocd.
the class AgentInstanceTest method shouldChangeIpWhenSameAgentIpChanged.
@Test
public void shouldChangeIpWhenSameAgentIpChanged() throws Exception {
AgentInstance instance = AgentInstance.createFromConfig(agentConfig, systemEnvironment, mock(AgentStatusChangeListener.class));
AgentRuntimeInfo info = new AgentRuntimeInfo(new AgentIdentifier("ccedev01", "10.18.7.52", "uuid"), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false);
assertThat(instance.isIpChangeRequired(info.getIpAdress()), is(true));
}
use of com.thoughtworks.go.remote.AgentIdentifier in project gocd by gocd.
the class BuildVariablesTest method setup.
@Before
public void setup() {
AgentIdentifier agentIdentifier = new AgentIdentifier("duloc", "127.0.0.1", "uuid");
AgentRuntimeInfo runtimeInfo = new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, "/home/lord-farquaad/builds", "cookie", false);
bvs = new BuildVariables(runtimeInfo, new TestingClock(new Date(0)));
}
use of com.thoughtworks.go.remote.AgentIdentifier in project gocd by gocd.
the class StageServiceIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
dbHelper.onSetUp();
pipelineConfig = PipelineMother.withSingleStageWithMaterials(PIPELINE_NAME, STAGE_NAME, withBuildPlans("unit", "dev", "blah"));
pipelineConfig.getFirstStageConfig().setFetchMaterials(false);
pipelineConfig.getFirstStageConfig().setCleanWorkingDir(true);
configFileHelper.usingCruiseConfigDao(goConfigDao);
configFileHelper.onSetUp();
configFileHelper.addPipeline(PIPELINE_NAME, STAGE_NAME);
savedPipeline = scheduleHelper.schedule(pipelineConfig, BuildCause.createWithModifications(modifyOneFile(pipelineConfig), ""), GoConstants.DEFAULT_APPROVED_BY);
stage = savedPipeline.getStages().first();
job = stage.getJobInstances().first();
job.setAgentUuid(UUID);
jobInstanceDao.updateAssignedInfo(job);
AgentIdentifier agentIdentifier = new AgentIdentifier("localhost", "127.0.0.1", UUID);
agentService.updateRuntimeInfo(new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false));
receivedState = null;
receivedResult = null;
receivedStageResult = null;
notifier.disableUpdates();
}
Aggregations