forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for ppc64le architecture (opensearch-project#5459) (opens…
…earch-project#6224) Signed-off-by: Andriy Redko <[email protected]> Co-authored-by: Priya Seth <[email protected]>
- Loading branch information
1 parent
1007831
commit 0cc049d
Showing
13 changed files
with
127 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
buildSrc/src/test/java/org/opensearch/gradle/ArchitectureTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.gradle; | ||
|
||
import org.opensearch.gradle.test.GradleUnitTestCase; | ||
|
||
public class ArchitectureTests extends GradleUnitTestCase { | ||
|
||
final String architecture = System.getProperty("os.arch", ""); | ||
|
||
public void testCurrentArchitecture() { | ||
assertEquals(Architecture.X64, currentArchitecture("amd64")); | ||
assertEquals(Architecture.X64, currentArchitecture("x86_64")); | ||
assertEquals(Architecture.ARM64, currentArchitecture("aarch64")); | ||
assertEquals(Architecture.PPC64LE, currentArchitecture("ppc64le")); | ||
} | ||
|
||
public void testInvalidCurrentArchitecture() { | ||
assertThrows("can not determine architecture from [", IllegalArgumentException.class, () -> currentArchitecture("fooBar64")); | ||
} | ||
|
||
/** | ||
* Determines the return value of {@link Architecture#current()} based on a string representing a potential OS Architecture. | ||
* | ||
* @param osArchToTest An expected value of the {@code os.arch} system property on another architecture. | ||
* @return the value of the {@link Architecture} enum which would have resulted with the given value. | ||
* @throws IllegalArgumentException if the string is not mapped to a value of the {@link Architecture} enum. | ||
*/ | ||
private Architecture currentArchitecture(String osArchToTest) throws IllegalArgumentException { | ||
// Test new architecture | ||
System.setProperty("os.arch", osArchToTest); | ||
try { | ||
return Architecture.current(); | ||
} finally { | ||
// Restore actual architecture property value | ||
System.setProperty("os.arch", this.architecture); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
// This file is intentionally blank. All configuration of the | ||
// distribution is done in the parent project. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
// This file is intentionally blank. All configuration of the | ||
// export is done in the parent project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters