Skip to content

Commit

Permalink
Add Redhad Enterprise 7 Support
Browse files Browse the repository at this point in the history
- update finder to support Redhat and Oracle distributions
  • Loading branch information
Tomasz Forys committed Jan 12, 2022
1 parent 45f3751 commit c5ee8f6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ private static ImmutablePlatformMatchRules rules(Command command) {
.finder(new CentosRedhatPackageResolver(command))
.build();

ImmutablePlatformMatchRule redhatRule = PlatformMatchRule.builder()
.match(PlatformMatch.withOs(OS.Linux)
.withVersion(RedhatVersion.values()))
.finder(new CentosRedhatPackageResolver(command))
.build();

ImmutablePlatformMatchRule oracleRule = PlatformMatchRule.builder()
.match(PlatformMatch.withOs(OS.Linux)
.withVersion(OracleVersion.values()))
.finder(new CentosRedhatPackageResolver(command))
.build();

ImmutablePlatformMatchRule amazonRule = PlatformMatchRule.builder()
.match(PlatformMatch.withOs(OS.Linux)
.withVersion(AmazonVersion.values()))
Expand Down Expand Up @@ -179,6 +191,8 @@ private static ImmutablePlatformMatchRules rules(Command command) {
linuxMintRule,
debianRule,
centosRule,
redhatRule,
oracleRule,
amazonRule,
legacy32,
legacy64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import de.flapdoodle.os.linux.CentosVersion;
import de.flapdoodle.os.linux.DebianVersion;
import de.flapdoodle.os.linux.LinuxMintVersion;
import de.flapdoodle.os.linux.OracleVersion;
import de.flapdoodle.os.linux.RedhatVersion;
import de.flapdoodle.os.linux.UbuntuVersion;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down Expand Up @@ -62,6 +64,20 @@ public void legacy64Bit(String version) {
.resolvesTo("/linux/mongodb-linux-x86_64-{}.tgz");
}

@Test
public void resolveRedhatPackage() {
assertThat(linuxWith(CommonArchitecture.X86_64)
.withVersion(RedhatVersion.Redhat_7), "5.0.2")
.resolvesTo("/linux/mongodb-linux-x86_64-rhel70-{}.tgz");
}

@Test
public void resolveOraclePackage() {
assertThat(linuxWith(CommonArchitecture.X86_64)
.withVersion(OracleVersion.Oracle_6), "4.4.9")
.resolvesTo("/linux/mongodb-linux-x86_64-rhel62-{}.tgz");
}

@Test
public void resolveCentosPackage() {
assertThat(linuxWith(CommonArchitecture.X86_64)
Expand Down

0 comments on commit c5ee8f6

Please sign in to comment.