Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,6 @@
<value>120</value>
<display-name>Retry Interval</display-name>
<description>Retry interval to apply database patches in seconds.</description>
<on-ambari-upgrade add="false"/>
</property>
</configuration>
5 changes: 5 additions & 0 deletions ambari-server/src/main/resources/version_definition.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,23 @@

<xs:simpleType name="family-type">
<xs:restriction base="xs:string">

<xs:enumeration value="redhat6" />
<xs:enumeration value="redhat7" />
<xs:enumeration value="redhat8" />
<xs:enumeration value="redhat9" />
<xs:enumeration value="fedora36" />
<xs:enumeration value="fedora38" />
<xs:enumeration value="redhat-ppc6" />
<xs:enumeration value="redhat-ppc7" />
<xs:enumeration value="debian6" /><!-- //test-->
<xs:enumeration value="debian10" />
<xs:enumeration value="debian11" />
<xs:enumeration value="ubuntu14" /><!-- //test-->
<xs:enumeration value="ubuntu20" />
<xs:enumeration value="ubuntu22" />
<xs:enumeration value="suse11" />
<xs:enumeration value="suse11sp3" /><!-- //test-->
<xs:enumeration value="suse12" />
<xs:enumeration value="amazonlinux2" />
<xs:enumeration value="openeuler22" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doAnswer;
Expand Down Expand Up @@ -339,8 +340,8 @@ public void testHostInfoCachingSingleHost() throws StackAdvisorException {
// in second handling case NPE will be fired during result processing
doReturn(Response.status(200).entity(String.format(SINGLE_HOST_RESPONSE, "hostName1")).build())
.doReturn(null)
.when(command).handleRequest(any(HttpHeaders.class), any(String.class), any(UriInfo.class), any(Request.Type.class),
any(MediaType.class), any(ResourceInstance.class));
.when(command).handleRequest(nullable(HttpHeaders.class), nullable(String.class), any(UriInfo.class), any(Request.Type.class),
nullable(MediaType.class), any(ResourceInstance.class));

StackAdvisorRequest request = StackAdvisorRequestBuilder.
forStack(null, null).ofType(StackAdvisorRequest.StackAdvisorRequestType.CONFIGURATIONS).
Expand All @@ -367,12 +368,17 @@ public void testHostInfoCachingTwoHost() throws StackAdvisorException {
TestStackAdvisorCommand command = spy(new TestStackAdvisorCommand(file, recommendationsArtifactsLifetime,
ServiceInfo.ServiceAdvisorType.PYTHON, 1,
stackAdvisorRunner, ambariMetaInfo, hostInfoCache));

doReturn(Response.status(200).entity(String.format(SINGLE_HOST_RESPONSE, "hostName1")).build())
.doReturn(Response.status(200).entity(String.format(SINGLE_HOST_RESPONSE, "hostName2")).build())
.doReturn(null)
.when(command).handleRequest(any(HttpHeaders.class), any(String.class), any(UriInfo.class), any(Request.Type.class),
any(MediaType.class), any(ResourceInstance.class));
.when(command).handleRequest(
nullable(HttpHeaders.class),
nullable(String.class),
any(UriInfo.class),
any(Request.Type.class),
nullable(MediaType.class),
any(ResourceInstance.class)
);

StackAdvisorRequest request = StackAdvisorRequestBuilder.
forStack(null, null).ofType(StackAdvisorRequest.StackAdvisorRequestType.CONFIGURATIONS).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ public class HostsMasterMaintenanceCheckTest {
@Before
public void setup() throws Exception {
m_services.clear();

Mockito.when(m_repositoryVersion.getRepositoryType()).thenReturn(RepositoryType.STANDARD);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public Clusters get() {

m_services.clear();

Mockito.when(m_repositoryVersion.getRepositoryType()).thenReturn(RepositoryType.STANDARD);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ public Clusters get() {
final Cluster cluster = Mockito.mock(Cluster.class);
Mockito.when(clusters.getCluster(CLUSTER_NAME)).thenReturn(cluster);

Mockito.when(m_repositoryVersion.getId()).thenReturn(1L);
Mockito.when(m_repositoryVersion.getRepositoryType()).thenReturn(RepositoryType.STANDARD);

Mockito.when(m_repositoryVersionEntity.getRepositoryXml()).thenReturn(m_vdfXml);
Mockito.when(m_vdfXml.getMissingDependencies(Mockito.eq(cluster), Mockito.any(AmbariMetaInfo.class))).thenReturn(m_missingDependencies);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ public void setup() throws Exception {
String version = "1.0.0.0-1234";

Mockito.when(m_repositoryVersion.getId()).thenReturn(1L);
Mockito.when(m_repositoryVersion.getRepositoryType()).thenReturn(RepositoryType.STANDARD);

Mockito.when(m_repositoryVersionEntity.getType()).thenReturn(RepositoryType.STANDARD);
Mockito.when(m_repositoryVersionEntity.getVersion()).thenReturn("2.2.0.0-1234");
Mockito.when(m_repositoryVersionEntity.getStackId()).thenReturn(new StackId("HDP", "2.2"));
Mockito.when(m_repositoryVersionEntity.getRepositoryXml()).thenReturn(m_vdfXml);
Mockito.when(m_vdfXml.getClusterSummary(Mockito.any(Cluster.class), Mockito.any(AmbariMetaInfo.class))).thenReturn(m_clusterVersionSummary);
Mockito.when(m_clusterVersionSummary.getAvailableServiceNames()).thenReturn(m_services.keySet());
Expand Down
Loading