ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: AMBARI-10180. Repo validation doesn't pass on debian7 (aonishuk)
Date Tue, 24 Mar 2015 14:16:28 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 3b8e577db -> 86f5870e6


AMBARI-10180. Repo validation doesn't pass on debian7 (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/86f5870e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/86f5870e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/86f5870e

Branch: refs/heads/trunk
Commit: 86f5870e6775474adfca5880f4368890c978829b
Parents: 3b8e577
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Tue Mar 24 16:16:16 2015 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Tue Mar 24 16:16:16 2015 +0200

----------------------------------------------------------------------
 .../server/configuration/Configuration.java     | 12 ++++++++----
 .../server/state/stack/LatestRepoCallable.java  |  4 +++-
 .../ambari/server/state/stack/OsFamily.java     | 20 +++++++++++++++++++-
 .../apache/ambari/server/view/ViewRegistry.java |  5 ++++-
 .../resources/stacks/HDP/2.3/repos/repoinfo.xml | 12 ------------
 .../ambari/server/resources/TestResources.java  |  4 ++++
 .../server/security/CertGenerationTest.java     |  4 ++++
 .../server/security/SslExecutionTest.java       |  7 +++++++
 .../KerberosOperationHandlerFactoryTest.java    |  4 ++++
 .../kerberos/KerberosServerActionTest.java      |  5 +++++
 .../MITKerberosOperationHandlerTest.java        |  5 +++++
 .../server/upgrade/UpgradeCatalog151Test.java   |  3 +++
 .../server/upgrade/UpgradeCatalog160Test.java   |  2 ++
 .../server/upgrade/UpgradeCatalog161Test.java   |  2 ++
 .../server/upgrade/UpgradeCatalog170Test.java   |  2 ++
 .../server/upgrade/UpgradeCatalog200Test.java   |  4 ++++
 16 files changed, 76 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index cfdcb95..c3ad685 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -33,6 +33,7 @@ import org.apache.ambari.server.orm.PersistenceType;
 import org.apache.ambari.server.security.ClientSecurityType;
 import org.apache.ambari.server.security.authorization.LdapServerProperties;
 import org.apache.ambari.server.security.encryption.CredentialProvider;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.apache.ambari.server.utils.ShellCommandUtil;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.RandomStringUtils;
@@ -40,6 +41,7 @@ import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.inject.Inject;
 import com.google.inject.Singleton;
 
 
@@ -49,6 +51,9 @@ import com.google.inject.Singleton;
  */
 @Singleton
 public class Configuration {
+  
+  @Inject
+  private OsFamily osFamily;
 
   public static final String CONFIG_FILE = "ambari.properties";
   public static final String BOOTSTRAP_DIR = "bootstrap.dir";
@@ -298,8 +303,6 @@ public class Configuration {
   private static final String SERVER_PERSISTENCE_TYPE_DEFAULT = "local";
   private static final String SERVER_CONNECTION_MAX_IDLE_TIME = "server.connection.max.idle.millis";
 
-  private static final String UBUNTU_OS = "ubuntu12";
-
   /**
    * Default for repo validation suffixes.
    */
@@ -1139,10 +1142,11 @@ public class Configuration {
   /**
    * @return a string array of suffixes used to validate repo URLs.
    */
-  public String[] getRepoValidationSuffixes(String osFamily) {
+  public String[] getRepoValidationSuffixes(String osType) {
+    String osFamily = this.osFamily.find_family(osType);
     String repoSuffixes;
 
-    if(osFamily.equals(UBUNTU_OS)) {
+    if(osFamily.equals(OsFamily.UBUNTU_FAMILY)) {
       repoSuffixes = properties.getProperty(REPO_SUFFIX_KEY_UBUNTU,
           REPO_SUFFIX_UBUNTU);
     } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
index 373be33..9eb2387 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
@@ -108,7 +108,9 @@ public class LatestRepoCallable implements Callable<Void> {
               // Agents do the reverse action (take the base url, and append <name>.repo)
 
               String repo_file_format;
-              if(ri.getOsType().equals("ubuntu12")) {
+              String osFamily = os_family.find_family(ri.getOsType());
+              
+              if(osFamily.equals(OsFamily.UBUNTU_FAMILY)) {
                 repo_file_format = "list";
               } else {
                 repo_file_format = "repo";

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
index 22b6005..2df3fcf 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
@@ -41,6 +41,8 @@ import org.apache.commons.io.IOUtils;
  */
 @Singleton
 public class OsFamily {
+    public final static String UBUNTU_FAMILY = "ubuntu";
+    
     private final String os_pattern = "([^\\d]*)([\\d]*)";
     private final String OS_DISTRO = "distro";
     private final String OS_VERSION = "versions";
@@ -124,7 +126,7 @@ public class OsFamily {
     }
 
     /**
-     * Finds the family for the specific OS
+     * Finds the family for the specific OS + it's version number
      * @param os the OS
      * @return the family, or <code>null</code> if not defined
      */
@@ -138,6 +140,22 @@ public class OsFamily {
       }
       return null;
     }
+    
+    /**
+     * Finds the family for the specific OS
+     * @param os the OS
+     * @return the family, or <code>null</code> if not defined
+     */
+    public String find_family(String os) {
+      Map<String,String>  pos = parse_os(os);
+      for ( String family : osMap.keySet()) {
+        Map<String, Set<String>> fam = osMap.get(family);
+        if (fam.get(OS_DISTRO).contains(pos.get(OS_DISTRO)) && fam.get(OS_VERSION).contains(pos.get(OS_VERSION))){
+          return family;
+        }
+      }
+      return null;
+    }
 
     /**
      * Form list of all supported os types

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
index 7eccd66..419ba02 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
@@ -23,6 +23,7 @@ import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.persist.Transactional;
+
 import org.apache.ambari.server.api.resources.ResourceInstanceFactoryImpl;
 import org.apache.ambari.server.api.resources.SubResourceDefinition;
 import org.apache.ambari.server.api.resources.ViewExternalSubResourceDefinition;
@@ -33,6 +34,7 @@ import org.apache.ambari.server.configuration.ComponentSSLConfiguration;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.AmbariServer;
 import org.apache.ambari.server.controller.AmbariSessionManager;
+import org.apache.ambari.server.controller.ControllerModule;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.spi.ResourceProvider;
 import org.apache.ambari.server.orm.dao.MemberDAO;
@@ -84,6 +86,7 @@ import org.springframework.security.core.GrantedAuthority;
 import javax.inject.Inject;
 import javax.inject.Provider;
 import javax.inject.Singleton;
+
 import java.beans.IntrospectionException;
 import java.io.File;
 import java.util.Collection;
@@ -257,7 +260,7 @@ public class ViewRegistry {
       String archivePath = args[1];
 
       try {
-        Injector injector = Guice.createInjector();
+        Injector injector = Guice.createInjector(new ControllerModule());
 
         ViewExtractor      extractor      = injector.getInstance(ViewExtractor.class);
         ViewArchiveUtility archiveUtility = injector.getInstance(ViewArchiveUtility.class);

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/main/resources/stacks/HDP/2.3/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/repos/repoinfo.xml
index 4d200fa..646b2c0 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/repos/repoinfo.xml
@@ -77,16 +77,4 @@
       <reponame>HDP-UTILS</reponame>
     </repo>
   </os>
-  <os family="ubuntu7">
-    <repo>
-      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/debian6/2.x/updates/2.3.0.0</baseurl>
-      <repoid>HDP-2.3</repoid>
-      <reponame>HDP</reponame>
-    </repo>
-    <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/debian6</baseurl>
-      <repoid>HDP-UTILS-1.1.0.20</repoid>
-      <reponame>HDP-UTILS</reponame>
-    </repo>
-  </os>
 </reposinfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/test/java/org/apache/ambari/server/resources/TestResources.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/resources/TestResources.java
b/ambari-server/src/test/java/org/apache/ambari/server/resources/TestResources.java
index 32d77dc..509a2ec 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/resources/TestResources.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/resources/TestResources.java
@@ -26,6 +26,7 @@ import java.util.Properties;
 import junit.framework.TestCase;
 
 import org.apache.ambari.server.configuration.Configuration;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.apache.commons.io.FileUtils;
 import org.junit.After;
 import org.junit.Before;
@@ -37,6 +38,8 @@ import com.google.inject.Guice;
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 
+import static org.easymock.EasyMock.createNiceMock;
+
 public class TestResources extends TestCase {
 	
   private static ResourceManager resMan;
@@ -76,6 +79,7 @@ public class TestResources extends TestCase {
     protected void configure() {
       bind(Properties.class).toInstance(buildTestProperties());
       bind(Configuration.class).toConstructor(getConfigurationConstructor());
+      bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
 	  requestStaticInjection(TestResources.class);
 	}
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/test/java/org/apache/ambari/server/security/CertGenerationTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/security/CertGenerationTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/security/CertGenerationTest.java
index 10645b9..15b4cbc 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/security/CertGenerationTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/security/CertGenerationTest.java
@@ -25,7 +25,9 @@ import java.util.Properties;
 import java.util.Random;
 
 import com.google.common.io.Files;
+
 import org.apache.ambari.server.configuration.Configuration;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.apache.ambari.server.utils.ShellCommandUtil;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
@@ -40,6 +42,7 @@ import com.google.inject.Guice;
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 
+import static org.easymock.EasyMock.createNiceMock;
 import junit.framework.TestCase;
 
 public class CertGenerationTest {
@@ -67,6 +70,7 @@ public class CertGenerationTest {
     protected void configure() {
       bind(Properties.class).toInstance(buildTestProperties());
       bind(Configuration.class).toConstructor(getConfigurationConstructor());
+      bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       requestStaticInjection(CertGenerationTest.class);
     }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/test/java/org/apache/ambari/server/security/SslExecutionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/security/SslExecutionTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/security/SslExecutionTest.java
index 0e2b704..95a3f0a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/security/SslExecutionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/security/SslExecutionTest.java
@@ -21,17 +21,23 @@ import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
 import com.google.inject.Inject;
 import com.google.inject.Injector;
+
 import org.apache.ambari.server.configuration.Configuration;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.junit.*;
 import org.junit.rules.TemporaryFolder;
+
+import static org.easymock.EasyMock.createNiceMock;
 import static org.junit.Assert.assertTrue;
 
 import java.io.*;
 import java.lang.reflect.Constructor;
 import java.util.Properties;
 
+import static org.easymock.EasyMock.createNiceMock;
+
 public class SslExecutionTest {
 
   private static Log LOG = LogFactory.getLog(SslExecutionTest.class);
@@ -52,6 +58,7 @@ public class SslExecutionTest {
     protected void configure() {
       bind(Properties.class).toInstance(buildTestProperties());
       bind(Configuration.class).toConstructor(getConfigurationConstructor());
+      bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       requestStaticInjection(SslExecutionTest.class);
     }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactoryTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactoryTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactoryTest.java
index 4620150..2751b21 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactoryTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactoryTest.java
@@ -21,9 +21,11 @@ package org.apache.ambari.server.serveraction.kerberos;
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.easymock.EasyMock;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -31,6 +33,7 @@ import org.junit.Test;
 
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.createNiceMock;
 
 public class KerberosOperationHandlerFactoryTest {
 
@@ -47,6 +50,7 @@ public class KerberosOperationHandlerFactoryTest {
         replay(configuration);
 
         bind(Configuration.class).toInstance(configuration);
+        bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       }
     });
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerActionTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerActionTest.java
index 2efa640..b0345aa 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerActionTest.java
@@ -21,7 +21,9 @@ package org.apache.ambari.server.serveraction.kerberos;
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
+
 import junit.framework.Assert;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.actionmanager.HostRoleCommand;
 import org.apache.ambari.server.actionmanager.HostRoleStatus;
@@ -29,6 +31,7 @@ import org.apache.ambari.server.agent.CommandReport;
 import org.apache.ambari.server.agent.ExecutionCommand;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -42,6 +45,7 @@ import java.util.concurrent.ConcurrentMap;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
+import static org.easymock.EasyMock.createNiceMock;
 
 public class KerberosServerActionTest {
 
@@ -89,6 +93,7 @@ public class KerberosServerActionTest {
         });
 
         bind(Clusters.class).toInstance(clusters);
+        bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       }
     });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandlerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandlerTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandlerTest.java
index 1e05f8c..9b9a28c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandlerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/MITKerberosOperationHandlerTest.java
@@ -21,10 +21,13 @@ package org.apache.ambari.server.serveraction.kerberos;
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
+
 import junit.framework.Assert;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.apache.ambari.server.utils.ShellCommandUtil;
 import org.easymock.EasyMock;
 import org.easymock.IAnswer;
@@ -38,6 +41,7 @@ import java.util.Map;
 import static org.easymock.EasyMock.anyObject;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.createNiceMock;
 
 public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTest {
 
@@ -66,6 +70,7 @@ public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTes
 
         bind(Clusters.class).toInstance(EasyMock.createNiceMock(Clusters.class));
         bind(Configuration.class).toInstance(configuration);
+        bind(OsFamily.class).toInstance(EasyMock.createNiceMock(OsFamily.class));
       }
     });
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog151Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog151Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog151Test.java
index 17bd478..b47f411 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog151Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog151Test.java
@@ -21,9 +21,11 @@ import com.google.inject.Binder;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Module;
+
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.DBAccessor;
 import org.apache.ambari.server.orm.dao.MetainfoDAO;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.easymock.EasyMock;
 import org.junit.Assert;
 import org.junit.Test;
@@ -99,6 +101,7 @@ public class UpgradeCatalog151Test {
       @Override
       public void configure(Binder binder) {
         binder.bind(DBAccessor.class).toInstance(dbAccessor);
+        binder.bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       }
     };
     Injector injector = Guice.createInjector(module);

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java
index 05b6d4c..303fa3a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java
@@ -41,6 +41,7 @@ import java.util.Map;
 
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.DBAccessor;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.easymock.Capture;
 import org.junit.Assert;
 import org.junit.Test;
@@ -129,6 +130,7 @@ public class UpgradeCatalog160Test {
       @Override
       public void configure(Binder binder) {
         binder.bind(DBAccessor.class).toInstance(dbAccessor);
+        binder.bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       }
     };
     Injector injector = Guice.createInjector(module);

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
index 10d4f7d..240edb4 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
@@ -50,6 +50,7 @@ import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.DBAccessor;
 import org.apache.ambari.server.orm.entities.ClusterEntity;
 import org.apache.ambari.server.state.State;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.easymock.Capture;
 import org.junit.Assert;
 import org.junit.Test;
@@ -209,6 +210,7 @@ public class UpgradeCatalog161Test {
       @Override
       public void configure(Binder binder) {
         binder.bind(DBAccessor.class).toInstance(dbAccessor);
+        binder.bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       }
     };
     Injector injector = Guice.createInjector(module);

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
index b51cac2..6fa3e0a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
@@ -116,6 +116,7 @@ import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.Config;
 import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.StackId;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.apache.ambari.server.view.ViewRegistry;
 import org.easymock.Capture;
 import org.easymock.IAnswer;
@@ -620,6 +621,7 @@ public class UpgradeCatalog170Test {
       @Override
       public void configure(Binder binder) {
         binder.bind(DBAccessor.class).toInstance(dbAccessor);
+        binder.bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       }
     };
     Injector injector = Guice.createInjector(module);

http://git-wip-us.apache.org/repos/asf/ambari/blob/86f5870e/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java
index cb318c1..9c39749 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java
@@ -77,6 +77,7 @@ import org.apache.ambari.server.state.RepositoryInfo;
 import org.apache.ambari.server.state.SecurityState;
 import org.apache.ambari.server.state.SecurityType;
 import org.apache.ambari.server.state.StackId;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.easymock.Capture;
 import org.easymock.EasyMockSupport;
 import org.junit.After;
@@ -409,6 +410,7 @@ public class UpgradeCatalog200Test {
         bind(Clusters.class).toInstance(mockClusters);
         bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class));
         bind(EntityManager.class).toInstance(createNiceMock(EntityManager.class));
+        bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       }
     });
 
@@ -481,6 +483,7 @@ public class UpgradeCatalog200Test {
         bind(Clusters.class).toInstance(mockClusters);
 
         bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class));
+        bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       }
     });
 
@@ -590,6 +593,7 @@ public class UpgradeCatalog200Test {
       @Override
       public void configure(Binder binder) {
         binder.bind(DBAccessor.class).toInstance(dbAccessor);
+        binder.bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
       }
     };
 


Mime
View raw message