From 8bbfd3be4ccb9f09e3bb94186563362a07a1656d Mon Sep 17 00:00:00 2001 From: Jesse McConnell Date: Fri, 14 Sep 2012 17:54:35 -0500 Subject: [PATCH] setuid passing test on osx --- jetty-setuid/jetty-setuid-osx/pom.xml | 2 +- jetty-setuid/jetty-setuid-test/pom.xml | 47 ++++++++++++++++--- .../org/eclipse/jetty/setuid/TestSetuid.java | 3 +- jetty-setuid/pom.xml | 2 +- 4 files changed, 44 insertions(+), 10 deletions(-) diff --git a/jetty-setuid/jetty-setuid-osx/pom.xml b/jetty-setuid/jetty-setuid-osx/pom.xml index dd12041452e..fae0a24289a 100644 --- a/jetty-setuid/jetty-setuid-osx/pom.xml +++ b/jetty-setuid/jetty-setuid-osx/pom.xml @@ -6,7 +6,7 @@ 9.0.0-SNAPSHOT 4.0.0 - jetty-setuid-osx + libsetuid_osx Jetty :: SetUID OSX Native so diff --git a/jetty-setuid/jetty-setuid-test/pom.xml b/jetty-setuid/jetty-setuid-test/pom.xml index c3f2e70904e..84ec87e30c4 100644 --- a/jetty-setuid/jetty-setuid-test/pom.xml +++ b/jetty-setuid/jetty-setuid-test/pom.xml @@ -10,7 +10,6 @@ Jetty :: SetUID Test jar - test org.apache.maven.plugins @@ -19,6 +18,7 @@ true + @@ -32,6 +32,10 @@ junit test + + org.eclipse.jetty.toolchain + jetty-test-helper + @@ -44,9 +48,9 @@ org.eclipse.jetty - jetty-setuid-linux + libsetuid_linux ${project.version} - pom + so @@ -54,15 +58,44 @@ env-mac - mac + mac + + + + maven-dependency-plugin + + + copy + generate-resources + + copy + + + + + org.eclipse.jetty.setuid + libsetuid_osx + ${project.version} + so + true + target/native + libsetuid.so + + + + + + + + - org.eclipse.jetty - jetty-setuid-osx + org.eclipse.jetty.setuid + libsetuid_osx ${project.version} - pom + so diff --git a/jetty-setuid/jetty-setuid-test/src/test/java/org/eclipse/jetty/setuid/TestSetuid.java b/jetty-setuid/jetty-setuid-test/src/test/java/org/eclipse/jetty/setuid/TestSetuid.java index 6c8bf3930f8..cf5d8598e97 100644 --- a/jetty-setuid/jetty-setuid-test/src/test/java/org/eclipse/jetty/setuid/TestSetuid.java +++ b/jetty-setuid/jetty-setuid-test/src/test/java/org/eclipse/jetty/setuid/TestSetuid.java @@ -23,6 +23,7 @@ import org.eclipse.jetty.setuid.SetUID; import java.io.File; import org.eclipse.jetty.setuid.Passwd; import org.eclipse.jetty.setuid.Group; +import org.eclipse.jetty.toolchain.test.MavenTestingUtils; public class TestSetuid extends TestCase { @@ -34,7 +35,7 @@ public class TestSetuid extends TestCase try { // TODO use the dependency plugin to grab the proper lib and put it into place, no relative goop - File lib = new File("../../modules/native/target/libsetuid.so"); + File lib = MavenTestingUtils.getTargetFile("native/libsetuid.so"); String libPath = lib.getCanonicalPath(); System.setProperty("jetty.libsetuid.path", libPath); diff --git a/jetty-setuid/pom.xml b/jetty-setuid/pom.xml index 548ddb70b62..c6d0669eeba 100644 --- a/jetty-setuid/pom.xml +++ b/jetty-setuid/pom.xml @@ -12,7 +12,7 @@ jetty-setuid-java jetty-setuid-native - + jetty-setuid-test