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> <version>9.0.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>jetty-setuid-osx</artifactId> <artifactId>libsetuid_osx</artifactId>
<name>Jetty :: SetUID OSX Native</name> <name>Jetty :: SetUID OSX Native</name>
<packaging>so</packaging> <packaging>so</packaging>
<properties> <properties>

View File

@ -10,7 +10,6 @@
<name>Jetty :: SetUID Test</name> <name>Jetty :: SetUID Test</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<build> <build>
<defaultGoal>test</defaultGoal>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
@ -19,6 +18,7 @@
<skip>true</skip> <skip>true</skip>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
@ -32,6 +32,10 @@
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
</dependency>
</dependencies> </dependencies>
<profiles> <profiles>
<profile> <profile>
@ -44,9 +48,9 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-setuid-linux</artifactId> <artifactId>libsetuid_linux</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
<type>pom</type> <type>so</type>
</dependency> </dependency>
</dependencies> </dependencies>
</profile> </profile>
@ -54,15 +58,44 @@
<id>env-mac</id> <id>env-mac</id>
<activation> <activation>
<os> <os>
<name>mac</name> <family>mac</family>
</os> </os>
</activation> </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> <dependencies>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty.setuid</groupId>
<artifactId>jetty-setuid-osx</artifactId> <artifactId>libsetuid_osx</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
<type>pom</type> <type>so</type>
</dependency> </dependency>
</dependencies> </dependencies>
</profile> </profile>

View File

@ -23,6 +23,7 @@ import org.eclipse.jetty.setuid.SetUID;
import java.io.File; import java.io.File;
import org.eclipse.jetty.setuid.Passwd; import org.eclipse.jetty.setuid.Passwd;
import org.eclipse.jetty.setuid.Group; import org.eclipse.jetty.setuid.Group;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
public class TestSetuid extends TestCase public class TestSetuid extends TestCase
{ {
@ -34,7 +35,7 @@ public class TestSetuid extends TestCase
try try
{ {
// TODO use the dependency plugin to grab the proper lib and put it into place, no relative goop // 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(); String libPath = lib.getCanonicalPath();
System.setProperty("jetty.libsetuid.path", libPath); System.setProperty("jetty.libsetuid.path", libPath);

View File

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