Compare commits
20 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa142264da | ||
|
|
cdde8ee0c4 | ||
|
|
ab75ca899d | ||
|
|
bacaa3fac6 | ||
|
|
04ea350a32 | ||
|
|
0155ec6aad | ||
|
|
08ba815c91 | ||
|
|
d9697fe3e6 | ||
|
|
435956e755 | ||
|
|
fb7e6ae5b3 | ||
|
|
aa94813c36 | ||
|
|
94b1bd7545 | ||
|
|
3716dc184a | ||
|
|
fd9733cb95 | ||
|
|
131a09bfe4 | ||
|
|
433737f45d | ||
|
|
49efc441d9 | ||
|
|
ed326c9eb1 | ||
|
|
6cb24ea1a1 | ||
|
|
efe08cfac1 |
7 changed files with 27 additions and 49 deletions
24
README.md
24
README.md
|
|
@ -1,5 +1,23 @@
|
|||
# Deprecated
|
||||
# javapackages-validator-tests
|
||||
|
||||
This repository is deprecated.
|
||||
This repository contains the `.fmf` test files referenced by packages that are tested by _javapackages-validator_ tool.
|
||||
|
||||
Javapackages tests were moved to https://gitlab.com/redhat/centos-stream/tests/javapackages
|
||||
## Versioning
|
||||
|
||||
The version scheme is based on Fedora versions (`f<NUM>`).
|
||||
Changes made to a single branch must be backwards compatible or fix a bug.
|
||||
Breaking changes can be made to a branch that corresponds to the Rawhide branch at the time of submission.
|
||||
Packages then explicitly update their git reference and new versions of the package will be tested with the new tests.
|
||||
|
||||
This approach ensures that changes to old versions of packages will not be tested with possibly incompatible tests.
|
||||
|
||||
## Forking
|
||||
|
||||
If you wish to fork this project and add your own tests, you should follow these steps:
|
||||
|
||||
1. Add a source directory (e.g. `src`) with your own validators.
|
||||
2. Add a text [service file](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ServiceLoader.html) named `org.fedoraproject.javapackages.validator.Validator` into the same directory.
|
||||
This file contains fully-qualified class names of validators which you want to use, one name per line.
|
||||
|
||||
Javapackages-validator will run all the validators listed in the service file, unless they have been explicitly filtered using per-package configuration.
|
||||
This is explained in the project documentation.
|
||||
|
|
|
|||
|
|
@ -68,10 +68,7 @@ public class FilesValidatorJP extends FilesValidator {
|
|||
prefixes.put("javacc", List.of(Prefix.USR_BIN));
|
||||
prefixes.put("java_cup", List.of(Prefix.USR_BIN));
|
||||
prefixes.put("jflex", List.of(Prefix.USR_BIN));
|
||||
prefixes.put("jline", List.of(Prefix.USR_LIB_BUILD_ID));
|
||||
prefixes.put("junit5", List.of(Prefix.USR_BIN));
|
||||
prefixes.put("maven", List.of(Prefix.ETC_PKG, Prefix.ETC_JAVA, Prefix.JPBINDING, Prefix.USR_BIN));
|
||||
prefixes.put("maven4", List.of(Prefix.ETC_PKG, Prefix.ETC_JAVA, Prefix.JPBINDING, Prefix.USR_BIN));
|
||||
prefixes.put("modello", List.of(Prefix.USR_BIN));
|
||||
prefixes.put("objectweb-asm", List.of(Prefix.USR_BIN));
|
||||
prefixes.put("xerces-j2", List.of(Prefix.USR_BIN));
|
||||
|
|
@ -84,9 +81,7 @@ public class FilesValidatorJP extends FilesValidator {
|
|||
static {
|
||||
exceptionalFiles.put("aqute-bnd", List.of("/etc/ant.d/aqute-bnd"));
|
||||
exceptionalFiles.put("maven", List.of("/etc/m2.conf"));
|
||||
exceptionalFiles.put("maven4", List.of("/etc/m24.conf"));
|
||||
exceptionalFiles.put("jansi", List.of("/usr/lib/jansi", "/usr/lib/jansi/libjansi.so", "/usr/lib/java/jansi"));
|
||||
exceptionalFiles.put("jline", List.of("/usr/lib/jline", "/usr/lib/jline/libjlinenative.so", "/usr/lib/java/jline"));
|
||||
}
|
||||
|
||||
private static boolean namesRelated(String lhs, String rhs) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class RpmFilesizeValidatorJP extends RpmFilesizeValidator {
|
|||
}
|
||||
|
||||
if (Common.getPackageName(rpm).equals("javapackages-bootstrap")) {
|
||||
return sizeBytes <= 60_000_000;
|
||||
return sizeBytes <= 40_000_000;
|
||||
}
|
||||
|
||||
// javadoc rpms
|
||||
|
|
@ -33,6 +33,6 @@ public class RpmFilesizeValidatorJP extends RpmFilesizeValidator {
|
|||
}
|
||||
}
|
||||
|
||||
return sizeBytes <= 4_000_000;
|
||||
return sizeBytes <= 3_500_000;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ public class ValidatorFactoryGeneric implements ValidatorFactory {
|
|||
new JavaExclusiveArchValidatorJP(),
|
||||
new MavenMetadataValidator(),
|
||||
new NoBootstrapValidator(),
|
||||
new JpmsProvidesValidatorJP(),
|
||||
new NVRJarMetadataValidator(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
package tests;
|
||||
|
||||
import static io.kojan.runit.api.RUnit.*;
|
||||
import static io.kojan.runit.api.matcher.RUnitMatchers.*;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
|
||||
import io.kojan.javadeptools.rpm.RpmInfo;
|
||||
import io.kojan.runit.api.ExcludeFileName;
|
||||
import io.kojan.runit.api.ExcludeSource;
|
||||
import io.kojan.runit.api.ExcludeSymlink;
|
||||
import io.kojan.runit.api.FileTest;
|
||||
import io.kojan.runit.api.IncludeFileName;
|
||||
|
||||
@DisplayName("/jpackage_script")
|
||||
public class JPackageScriptCheck {
|
||||
@FileTest
|
||||
@IncludeFileName("/usr/bin/.*")
|
||||
@ExcludeSource
|
||||
@ExcludeSymlink
|
||||
@ExcludeFileName("/usr/bin/ant")
|
||||
public void testJPackageScript(RpmInfo rpm, byte[] bytes) {
|
||||
assumeThat("The binary is a script with a shebang", bytes.length, greaterThan(1));
|
||||
assumeThat("The binary is a script with a shebang", bytes[0], is((byte)'#'));
|
||||
assumeThat("The binary is a script with a shebang", bytes[1], is((byte)'!'));
|
||||
String content = new String(bytes, StandardCharsets.UTF_8);
|
||||
assumeThat("The script was generated with %jpackage_script", content,
|
||||
containsString(". /usr/share/java-utils/java-functions\n"));
|
||||
assertThat("The script explicitly sets JAVA_HOME to Java 21", content,
|
||||
containsString("\nJAVA_HOME=\"${JAVA_HOME:-/usr/lib/jvm/jre-21-openjdk}\"\n"));
|
||||
assertThat("Requires on java-21-openjdk-headless are present", rpm, requires("java-21-openjdk-headless"));
|
||||
assertThat("Requires on javapackages-tools are present", rpm, requires("javapackages-tools"));
|
||||
}
|
||||
}
|
||||
|
|
@ -23,6 +23,7 @@ public class JavadocCheck {
|
|||
@IncludeBinary(".*-javadoc")
|
||||
public void javadocFiles(RpmInfo rpm, Path path) {
|
||||
assertThat("Javadoc package contains only javadoc content", path.toString(),
|
||||
anyOf(startsWith("/usr/share/javadoc/"), startsWith("/usr/share/licenses/")));
|
||||
anyOf(startsWith("/usr/share/doc/"), // provisional for c10s
|
||||
startsWith("/usr/share/javadoc/"), startsWith("/usr/share/licenses/")));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ public class LicenseCheck {
|
|||
private static final Set<String> PUBLIC_DOMAIN_PACKAGES = Set.of( //
|
||||
"aopalliance", //
|
||||
"plexus-utils", //
|
||||
"plexus-utils4", //
|
||||
"xz-java", //
|
||||
"javapackages-bootstrap" // special case, as it it bundles all the above
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue