Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 85F412009C6 for ; Tue, 17 May 2016 01:46:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 847B8160A16; Mon, 16 May 2016 23:46:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8B315160A19 for ; Tue, 17 May 2016 01:46:03 +0200 (CEST) Received: (qmail 93775 invoked by uid 500); 16 May 2016 23:46:02 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 93758 invoked by uid 99); 16 May 2016 23:46:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 May 2016 23:46:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7E265DFB79; Mon, 16 May 2016 23:46:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jonathanhurley@apache.org To: commits@ambari.apache.org Date: Mon, 16 May 2016 23:46:02 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] ambari git commit: AMBARI-16687 - Configuration Tasks Are Being Skipped During Upgrade (jonathanhurley) archived-at: Mon, 16 May 2016 23:46:05 -0000 Repository: ambari Updated Branches: refs/heads/branch-2.4 ac151fb53 -> 1209a706d http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml index 45e2f94..1287d57 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml @@ -53,6 +53,18 @@ replace-with="" /> + + + ranger-hbase-audit + + + + + + + + + @@ -68,6 +80,10 @@ tez-site + + tez-site + + @@ -158,6 +174,43 @@ + + ranger-hive-audit + + + + + + + + + + + + hive-site + hive.server2.thrift.port + 10010 + + + hive-site + hive.server2.http.port + 10011 + + + + + + hive-site + hive.server2.thrift.port + 10000 + + + hive-site + hive.server2.http.port + 10001 + + + @@ -170,72 +223,203 @@ + + + webhcat-site + + + + + + + + + + + + + + + + ranger-env + + + + + admin-properties + + + + + + + ranger-admin-site + + + + + + + + + + + + + + + + + ranger-kms-audit + + + + + + + + + + + + + + + + + hdfs-site + + + + + + + ranger-hdfs-audit + + + + + + + + + + + + + + + + + spark-defaults + + + + + + + + + spark-thrift-sparkconf + + + + + + + + + - - - - - - hdfs-site - - - - - - - - - - - - - spark-defaults - - - - - - - - - spark-thrift-sparkconf - - - - - - - - - - - - - - - - - - oozie-site - - - - - - - - - - - kafka-broker - - - - - - + + + + + oozie-site + + + + + + + + + + + kafka-broker + + + + + + ranger-kafka-audit + + + + + + + + + + + + + + + + + + ranger-yarn-audit + + + + + + + + + + + + + + + + + ranger-storm-audit + + + + + + + + + + + + + + + + + ranger-knox-audit + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml index 7873853..56cd6d0 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml @@ -34,7 +34,6 @@ - http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml index 1cd2ffa..1e040e6 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml @@ -51,7 +51,6 @@ - http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml index f71ef1a..dd0e456 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml @@ -27,6 +27,12 @@ tez-site + + + tez-site + + + @@ -60,8 +66,20 @@ + + ranger-hive-audit + + + + + + + + + + @@ -76,6 +94,154 @@ + + + + + + ranger-env + + + + + admin-properties + + + + + + + ranger-admin-site + + + + + + + + + + + + + + + + + ranger-kms-audit + + + + + + + + + + + + + + + + + ranger-hdfs-audit + + + + + + + + + + + + + + + + + ranger-yarn-audit + + + + + + + + + + + + + + + + + ranger-kafka-audit + + + + + + + + + + + + + + + + + ranger-storm-audit + + + + + + + + + + + + + + + + + ranger-hbase-audit + + + + + + + + + + + + + + + + + ranger-knox-audit + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml index 9c6a02d..6e27da6 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml @@ -509,7 +509,6 @@ - @@ -712,18 +711,12 @@ - - - - - - @@ -738,8 +731,6 @@ - - @@ -796,7 +787,6 @@ - http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml index a7dbba3..5211276 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml @@ -19,18 +19,6 @@ - - - - - - tez-site - - - - - - @@ -59,183 +47,9 @@ 10001 - - - ranger-hive-audit - - - - - - - - - - - - - - - webhcat-site - - - - - - - - - - - - - - - - ranger-env - - - - - admin-properties - - - - - - - ranger-admin-site - - - - - - - - - - - - - - - - - ranger-hdfs-audit - - - - - - - - - - - - - - - - - ranger-hbase-audit - - - - - - - - - - - - - - - - - ranger-knox-audit - - - - - - - - - - - - - - - - - ranger-storm-audit - - - - - - - - - - - - - - - - - ranger-yarn-audit - - - - - - - - - - - - - - ranger-kafka-audit - - - - - - - - - - - - - - - - - ranger-kms-audit - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml index 2e5c002..5616cb4 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml @@ -283,10 +283,6 @@ - - - - http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml index 1745de8..d755516 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml @@ -643,8 +643,6 @@ - - http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java index 92043f0..8f53f6a 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java @@ -304,7 +304,8 @@ public class UpgradeResourceProviderTest { assertEquals("This is a manual task with a placeholder of placeholder-rendered-properly", parseSingleMessage(zookeeperUpgradeItems.get(0).getText())); assertEquals("Restarting ZooKeeper Server on h1", zookeeperUpgradeItems.get(1).getText()); - assertEquals("Skipping Configuration Task 2.2.0", zookeeperUpgradeItems.get(2).getText()); + assertEquals("Updating configuration zookeeper-newconfig", + zookeeperUpgradeItems.get(2).getText()); assertEquals("Service Check ZooKeeper", zookeeperUpgradeItems.get(3).getText()); assertEquals("Verifying Skipped Failures", zookeeperUpgradeItems.get(4).getText()); @@ -352,7 +353,8 @@ public class UpgradeResourceProviderTest { List zookeeperUpgradeItems = zookeeperGroup.getItems(); assertEquals(3, zookeeperUpgradeItems.size()); assertEquals("Restarting ZooKeeper Server on h1", zookeeperUpgradeItems.get(0).getText()); - assertEquals("Skipping Configuration Task 2.2.0", zookeeperUpgradeItems.get(1).getText()); + assertEquals("Updating configuration zookeeper-newconfig", + zookeeperUpgradeItems.get(1).getText()); assertEquals("Service Check ZooKeeper", zookeeperUpgradeItems.get(2).getText()); UpgradeGroupEntity postClusterGroup = upgradeGroups.get(1); @@ -397,7 +399,8 @@ public class UpgradeResourceProviderTest { assertEquals(4, zookeeperUpgradeItems.size()); assertEquals("Restarting ZooKeeper Server on h1", zookeeperUpgradeItems.get(0).getText()); - assertEquals("Skipping Configuration Task 2.2.0", zookeeperUpgradeItems.get(1).getText()); + assertEquals("Updating configuration zookeeper-newconfig", + zookeeperUpgradeItems.get(1).getText()); assertEquals("Service Check ZooKeeper", zookeeperUpgradeItems.get(2).getText()); assertEquals("Verifying Skipped Failures", zookeeperUpgradeItems.get(3).getText()); @@ -1236,7 +1239,7 @@ public class UpgradeResourceProviderTest { group.getItems().get(0).getText().contains("placeholder of placeholder-rendered-properly")); assertTrue(group.getItems().get(1).getText().contains("Restarting")); - assertTrue(group.getItems().get(2).getText().contains("Skipping")); + assertTrue(group.getItems().get(2).getText().contains("Updating")); assertTrue(group.getItems().get(3).getText().contains("Service Check")); ActionManager am = injector.getInstance(ActionManager.class); http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java index 771f830..1ca486e 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java @@ -25,7 +25,6 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicReference; import org.apache.ambari.server.audit.AuditLogger; -import org.apache.ambari.server.audit.AuditLoggerDefaultImpl; import org.apache.ambari.server.configuration.Configuration; import org.apache.ambari.server.controller.ControllerModule; import org.easymock.EasyMock; @@ -35,6 +34,8 @@ import com.google.inject.AbstractModule; public class InMemoryDefaultTestModule extends AbstractModule { + Properties properties = new Properties(); + /** * Saves all {@link ControllerModule} logic, but changes bean discovery mechanism. * In this implementation scan for {@link org.apache.ambari.server.EagerSingleton} @@ -59,8 +60,6 @@ public class InMemoryDefaultTestModule extends AbstractModule { } } - Properties properties = new Properties(); - @Override protected void configure() { String stacks = "src/test/resources/stacks"; @@ -72,11 +71,25 @@ public class InMemoryDefaultTestModule extends AbstractModule { sharedResourcesDir = ClassLoader.getSystemClassLoader().getResource("").getPath(); } - properties.setProperty(Configuration.SERVER_PERSISTENCE_TYPE_KEY, "in-memory"); - properties.setProperty(Configuration.METADATA_DIR_PATH, stacks); - properties.setProperty(Configuration.SERVER_VERSION_FILE, version); - properties.setProperty(Configuration.OS_VERSION_KEY, "centos5"); - properties.setProperty(Configuration.SHARED_RESOURCES_DIR_KEY, sharedResourcesDir); + if (!properties.containsKey(Configuration.SERVER_PERSISTENCE_TYPE_KEY)) { + properties.setProperty(Configuration.SERVER_PERSISTENCE_TYPE_KEY, "in-memory"); + } + + if (!properties.containsKey(Configuration.METADATA_DIR_PATH)) { + properties.setProperty(Configuration.METADATA_DIR_PATH, stacks); + } + + if (!properties.containsKey(Configuration.SERVER_VERSION_FILE)) { + properties.setProperty(Configuration.SERVER_VERSION_FILE, version); + } + + if (!properties.containsKey(Configuration.OS_VERSION_KEY)) { + properties.setProperty(Configuration.OS_VERSION_KEY, "centos5"); + } + + if (!properties.containsKey(Configuration.SHARED_RESOURCES_DIR_KEY)) { + properties.setProperty(Configuration.SHARED_RESOURCES_DIR_KEY, sharedResourcesDir); + } try { install(new BeanDefinitionsCachingTestControllerModule(properties)); @@ -88,6 +101,14 @@ public class InMemoryDefaultTestModule extends AbstractModule { } } + /** + * Gets the properties that will be used to initialize the system. If a + * property is placed here which {@link #configure()} also sets, then + * {@link #configure()} will not set it, and instead take the property that + * the test has set. + * + * @return + */ public Properties getProperties() { return properties; } http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java new file mode 100644 index 0000000..0c45347 --- /dev/null +++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java @@ -0,0 +1,192 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.ambari.server.state.stack; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import org.apache.ambari.server.api.services.AmbariMetaInfo; +import org.apache.ambari.server.configuration.Configuration; +import org.apache.ambari.server.controller.internal.UpgradeResourceProvider.ConfigurationPackBuilder; +import org.apache.ambari.server.orm.GuiceJpaInitializer; +import org.apache.ambari.server.orm.InMemoryDefaultTestModule; +import org.apache.ambari.server.state.StackId; +import org.apache.ambari.server.state.StackInfo; +import org.apache.ambari.server.state.stack.UpgradePack.ProcessingComponent; +import org.apache.ambari.server.state.stack.upgrade.ClusterGrouping; +import org.apache.ambari.server.state.stack.upgrade.ClusterGrouping.ExecuteStage; +import org.apache.ambari.server.state.stack.upgrade.ConfigureTask; +import org.apache.ambari.server.state.stack.upgrade.Direction; +import org.apache.ambari.server.state.stack.upgrade.Grouping; +import org.apache.ambari.server.state.stack.upgrade.Task; +import org.apache.ambari.server.state.stack.upgrade.Task.Type; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.persist.PersistService; + +import junit.framework.Assert; + +/** + * Tests that for every upgrade pack found, that all referenced configuration + * IDs exist in the {@code config-upgrade.xml} which will be used/created. + */ +public class ConfigUpgradeValidityTest { + + private static final Logger LOG = LoggerFactory.getLogger(ConfigUpgradeValidityTest.class); + + private Injector injector; + private AmbariMetaInfo ambariMetaInfo; + + private int validatedConfigCount = 0; + + @Before + public void before() throws Exception { + validatedConfigCount = 0; + + // ensure that we use the real stacks + InMemoryDefaultTestModule testModule = new InMemoryDefaultTestModule(); + testModule.getProperties().put(Configuration.METADATA_DIR_PATH, "src/main/resources/stacks"); + + injector = Guice.createInjector(testModule); + injector.getInstance(GuiceJpaInitializer.class); + + ambariMetaInfo = injector.getInstance(AmbariMetaInfo.class); + } + + @After + public void teardown() { + injector.getInstance(PersistService.class).stop(); + } + + /** + * Tests that every ID specified in an upgrade pack actually exists in the + * created {@link ConfigUpgradePack}. + * + * @throws Exception + */ + @Test + public void testConfigurationDefinitionsExist() throws Exception { + Collection stacks = ambariMetaInfo.getStacks(); + Assert.assertFalse(stacks.isEmpty()); + + for( StackInfo stack : stacks ){ + if (!stack.isActive()) { + LOG.info("Skipping configuration validity test for {}", new StackId(stack)); + continue; + } + + Map upgradePacks = ambariMetaInfo.getUpgradePacks(stack.getName(), stack.getVersion()); + for (String key : upgradePacks.keySet()) { + UpgradePack upgradePack = upgradePacks.get(key); + StackId sourceStack = new StackId(stack); + + ConfigUpgradePack configUpgradePack = ConfigurationPackBuilder.build(upgradePack, + sourceStack); + + // do configure tasks in the group section + List groups = upgradePack.getGroups(Direction.UPGRADE); + for( Grouping group : groups ){ + if( group instanceof ClusterGrouping ){ + ClusterGrouping clusterGrouping = (ClusterGrouping)group; + if( null != clusterGrouping.executionStages ){ + for( ExecuteStage executionStage : clusterGrouping.executionStages ){ + if( executionStage.task.getType() == Type.CONFIGURE ){ + ConfigureTask configureTask = (ConfigureTask) executionStage.task; + assertIdDefinitionExists(configureTask.id, configUpgradePack, upgradePack, + sourceStack); + } + } + } + } + } + + // do tasks in the "processing" section + Map> tasks = upgradePack.getTasks(); + for( Map value : tasks.values() ){ + for( ProcessingComponent processingComponent : value.values() ){ + if (null != processingComponent.preTasks) { + for (Task preTask : processingComponent.preTasks) { + if (preTask.getType() == Type.CONFIGURE) { + ConfigureTask configureTask = (ConfigureTask) preTask; + assertIdDefinitionExists(configureTask.id, configUpgradePack, upgradePack, + sourceStack); + } + } + + if (null != processingComponent.tasks) { + for (Task task : processingComponent.tasks) { + if (task.getType() == Type.CONFIGURE) { + ConfigureTask configureTask = (ConfigureTask) task; + assertIdDefinitionExists(configureTask.id, configUpgradePack, upgradePack, + sourceStack); + } + } + } + + if (null != processingComponent.postTasks) { + for (Task postTask : processingComponent.postTasks) { + if (postTask.getType() == Type.CONFIGURE) { + ConfigureTask configureTask = (ConfigureTask) postTask; + assertIdDefinitionExists(configureTask.id, configUpgradePack, upgradePack, + sourceStack); + } + } + } + } + } + } + } + } + + // make sure we actually checked a bunch of configs :) + Assert.assertTrue(validatedConfigCount > 100); + } + + /** + * Asserts that an ID exists in a {@link ConfigUpgradePack}, throwing an + * informative message if it does not. + * + * @param id + * @param configUpgradePack + * @param upgradePack + * @param sourceStackId + */ + private void assertIdDefinitionExists(String id, ConfigUpgradePack configUpgradePack, + UpgradePack upgradePack, StackId sourceStackId) { + Assert.assertNotNull(id); + + if (configUpgradePack.enumerateConfigChangesByID().containsKey(id)) { + validatedConfigCount++; + + LOG.info("Validated {} from upgrade pack {} for {}", id, upgradePack.getTargetStack(), + sourceStackId); + + return; + } + + Assert.fail(String.format("Missing %s in upgrade from %s to %s (%s)", id, sourceStackId, + upgradePack.getTargetStack(), upgradePack.getType())); + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/config-upgrade.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/config-upgrade.xml b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/config-upgrade.xml index cb034d0..44f9e02 100644 --- a/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/config-upgrade.xml +++ b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/config-upgrade.xml @@ -40,6 +40,12 @@ hdfs-site + + + hdfs-site + + + hdfs-site myproperty http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test.xml b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test.xml index 623b45c..6dc143a 100644 --- a/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test.xml +++ b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test.xml @@ -146,7 +146,7 @@ - + http://git-wip-us.apache.org/repos/asf/ambari/blob/1209a706/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_partial.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_partial.xml b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_partial.xml index 4932e92..23e8bbc 100644 --- a/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_partial.xml +++ b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_test_partial.xml @@ -159,7 +159,7 @@ - +