Skip to content

Commit

Permalink
Add integration test for ghost file entry handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
dranuhl authored and ctron committed Nov 29, 2021
1 parent 676736c commit fa22f57
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
91 changes: 91 additions & 0 deletions src/it/test16-ghost/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>de.dentrassi.maven.rpm.test</groupId>
<artifactId>test16-ghost</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Test Package #16</name>
<description>
Test ghost file entry handling
</description>

<url>http://dentrassi.de</url>

<organization>
<name>Jens Reimann</name>
<url>http://dentrassi.de</url>
</organization>

<licenses>
<license>
<name>Eclipse Public License - v 1.0</name>
<distribution>repo</distribution>
<url>https://www.eclipse.org/legal/epl-v10.html</url>
</license>
</licenses>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<skipSigning>true</skipSigning>
</properties>

<build>

<plugins>
<plugin>
<groupId>de.dentrassi.maven</groupId>
<artifactId>rpm</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<goals>
<goal>rpm</goal>
</goals>
<configuration>
<group>Application/Misc</group>

<outputFileName>test16.rpm</outputFileName>

<entries>
<entry>
<name>/tmp/ghost-file-entry</name>
<ghost>true</ghost>
<user>root</user>
<group>root</group>
<mode>0644</mode>
</entry>
</entries>

<signature>
<keyId>${keyId}</keyId>
<keyringFile>${user.home}/.gnupg/secring.gpg</keyringFile>
<passphrase>${passphrase}</passphrase>
<hashAlgorithm>SHA1</hashAlgorithm>
<skip>${skipSigning}</skip>
</signature>

</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>sign</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<skipSigning>false</skipSigning>
</properties>
</profile>
</profiles>

</project>
16 changes: 16 additions & 0 deletions src/it/test16-ghost/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

def flags ( options ) {
Process proc = ('rpm -l ' + options + ' -qp ' + basedir + "/target/test16.rpm").execute();
return proc.in.getText().trim();
}

def all_files = flags("");
println "Suggests: " + all_files;

def noghost_files = flags("--noghost");
println "Recommends: " + noghost_files;

return
all_files == "./tmp/ghost-file-entry" &&
noghost_files == ""
;

0 comments on commit fa22f57

Please sign in to comment.