setuid passing test on osx

This commit is contained in:
Jesse McConnell 2012-09-14 17:54:35 -05:00
parent 7ea30a07e6
commit 8bbfd3be4c
4 changed files with 44 additions and 10 deletions

View File

@ -6,7 +6,7 @@
<version>9.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jetty-setuid-osx</artifactId>
<artifactId>libsetuid_osx</artifactId>
<name>Jetty :: SetUID OSX Native</name>
<packaging>so</packaging>
<properties>

View File

@ -10,7 +10,6 @@
<name>Jetty :: SetUID Test</name>
<packaging>jar</packaging>
<build>
<defaultGoal>test</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -19,6 +18,7 @@
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
@ -32,6 +32,10 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
</dependency>
</dependencies>
<profiles>
<profile>
@ -44,9 +48,9 @@
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-setuid-linux</artifactId>
<artifactId>libsetuid_linux</artifactId>
<version>${project.version}</version>
<type>pom</type>
<type>so</type>
</dependency>
</dependencies>
</profile>
@ -54,15 +58,44 @@
<id>env-mac</id>
<activation>
<os>
<name>mac</name>
<family>mac</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty.setuid</groupId>
<artifactId>libsetuid_osx</artifactId>
<version>${project.version}</version>
<type>so</type>
<overWrite>true</overWrite>
<outputDirectory>target/native</outputDirectory>
<destFileName>libsetuid.so</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-setuid-osx</artifactId>
<groupId>org.eclipse.jetty.setuid</groupId>
<artifactId>libsetuid_osx</artifactId>
<version>${project.version}</version>
<type>pom</type>
<type>so</type>
</dependency>
</dependencies>
</profile>

View File

@ -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);

View File

@ -12,7 +12,7 @@
<modules>
<module>jetty-setuid-java</module>
<module>jetty-setuid-native</module>
<!-- module>jetty-setuid-test</module -->
<module>jetty-setuid-test</module>
</modules>
<profiles>
<profile>