Skip to content

Commit

Permalink
add openssl libraries for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
niudasky committed May 5, 2016
1 parent 6deb3ab commit 44f7fb2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@
<version>4.3.4</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative</artifactId>
<version>1.1.33.Fork15</version> <!-- 1.1.33.Fork14 and newer need netty >= 4.1.x -->
<classifier>${os.detected.classifier}</classifier>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -211,6 +220,13 @@
</plugin>
<!-- skip validation end -->
</plugins>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.4.0.Final</version>
</extension>
</extensions>
</build>

<profiles>
Expand Down
10 changes: 7 additions & 3 deletions src/test/java/com/floragunn/searchguard/SGTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,16 @@ public class SGTests extends AbstractUnitTest {
protected boolean allowOpenSSL = Boolean.parseBoolean(System.getenv("SG_ALLOW_OPENSSL"));

@Test
public void testDiscoveryWithoutInitialization() throws Exception {
public void testEnsureOpenSSLAvailability() {

if(allowOpenSSL) {
Assert.assertTrue(OpenSsl.isAvailable());
Assert.assertTrue(String.valueOf(OpenSsl.unavailabilityCause()), OpenSsl.isAvailable());
}

}

@Test
public void testDiscoveryWithoutInitialization() throws Exception {

final Settings settings = Settings.settingsBuilder().put("searchguard.ssl.transport.enabled", true)
.put(SSLConfigConstants.SEARCHGUARD_SSL_HTTP_ENABLE_OPENSSL_IF_AVAILABLE, allowOpenSSL)
.put(SSLConfigConstants.SEARCHGUARD_SSL_TRANSPORT_ENABLE_OPENSSL_IF_AVAILABLE, allowOpenSSL)
Expand Down

0 comments on commit 44f7fb2

Please sign in to comment.