use of com.yahoo.config.model.api.ConfigChangeAction in project vespa by vespa-engine.
the class ConfigValueChangeValidatorTest method requireThatValidatorHandlesModelsWithDifferentTopology.
@Test
public void requireThatValidatorHandlesModelsWithDifferentTopology() {
MockRoot oldRoot = createRootWithChildren(new SimpleConfigProducer("p1", 0).withChildren(new ServiceWithAnnotation("s1", 1)), new SimpleConfigProducer("p2", 0).withChildren(new ServiceWithAnnotation("s2", 1)));
MockRoot newRoot = createRootWithChildren(new ServiceWithAnnotation("s1", 2), new ServiceWithAnnotation("s2", 2), new ServiceWithAnnotation("s3", 2));
List<ConfigChangeAction> changes = getConfigChanges(oldRoot, newRoot);
assertTrue(changes.isEmpty());
assertEmptyLog();
}
use of com.yahoo.config.model.api.ConfigChangeAction in project vespa by vespa-engine.
the class VespaModelFactory method createAndValidateModel.
@Override
public ModelCreateResult createAndValidateModel(ModelContext modelContext, boolean ignoreValidationErrors) {
validateXml(modelContext, ignoreValidationErrors);
DeployState deployState = createDeployState(modelContext, true);
VespaModel model = buildModel(deployState);
List<ConfigChangeAction> changeActions = validateModel(model, deployState, ignoreValidationErrors);
return new ModelCreateResult(model, changeActions);
}
use of com.yahoo.config.model.api.ConfigChangeAction in project vespa by vespa-engine.
the class ContainerRestartValidatorTest method validator_returns_empty_list_for_containers_with_restart_on_deploy_disabled_where_previously_enabled.
@Test
public void validator_returns_empty_list_for_containers_with_restart_on_deploy_disabled_where_previously_enabled() {
VespaModel current = createModel(true);
VespaModel next = createModel(false);
List<ConfigChangeAction> result = validateModel(current, next);
assertTrue(result.isEmpty());
}
use of com.yahoo.config.model.api.ConfigChangeAction in project vespa by vespa-engine.
the class StartupCommandChangeValidatorTest method requireThatDifferentStartupCommandIsDetected.
@Test
public void requireThatDifferentStartupCommandIsDetected() {
MockRoot oldRoot = createRootWithChildren(new ServiceStub("evilservice", "rm -rf /"));
MockRoot newRoot = createRootWithChildren(new ServiceStub("evilservice", "rm -rf *"));
List<ConfigChangeAction> changes = getStartupCommandChanges(oldRoot, newRoot);
assertEquals(1, changes.size());
assertEquals("evilservice", changes.get(0).getServices().get(0).getConfigId());
}
Aggregations