Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config/global_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ def get_32b_arch_identifiers_in_scriptlets(arch):
TEMURIN = "temurin"

LIST_OF_PROPRIETARY_VENDORS = [IBM, ORACLE]
LIST_OF_OPEN_VENDORS_EXCEPT_ITW = [OPENJDK, ADOPTIUM]
LIST_OF_OPEN_VENDORS_EXCEPT_ITW = [OPENJDK, TEMURIN]
LIST_OF_OPEN_VENDORS = LIST_OF_OPEN_VENDORS_EXCEPT_ITW + [ITW]
LIST_OF_POSSIBLE_VENDORS = LIST_OF_PROPRIETARY_VENDORS + LIST_OF_OPEN_VENDORS
LIST_OF_POSSIBLE_VENDORS_WITHOUT_ITW = LIST_OF_PROPRIETARY_VENDORS + LIST_OF_OPEN_VENDORS_EXCEPT_ITW
LIST_OF_LEGACY_VERSIONS = ["1.7.0", "1.8.0"]
LIST_OF_NEW_VERSIONS = ["11", "17", "latest"]
LIST_OF_LEGACY_VERSIONS = ["1.7.0", "1.8.0", "8", "11"]
LIST_OF_NEW_VERSIONS = ["17", "21", "25", "latest"]
LIST_OF_POSSIBLE_VERSIONS = [ITW] + LIST_OF_LEGACY_VERSIONS + LIST_OF_NEW_VERSIONS
LIST_OF_POSSIBLE_VERSIONS_WITHOUT_ITW = LIST_OF_LEGACY_VERSIONS + LIST_OF_NEW_VERSIONS
2 changes: 1 addition & 1 deletion testcases/alternativesTests/binaries_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def setCSCH(self):
return
else:
raise ex.UnknownJavaVersionException("Unknown Oracle java version")
elif rpms.getVendor() == gc.ADOPTIUM:
elif rpms.getVendor() == gc.TEMURIN:
if int(rpms.getMajorVersionSimplified()) == 8:
self.csch = tcc.Temurin8(BinariesTest.instance)
return
Expand Down
17 changes: 10 additions & 7 deletions testcases/alternativesTests/binaries_test_config_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,8 @@ class Temurin8(bsm.BinarySlaveTestMethods):
def _get_subpackages_with_binaries(self):
return [tc.JRE, tc.JDK]

def _get_binary_directory_name(self, name):
return tc.JVM_DIR + "/{}/bin".format(ns.get_package_name(name))
def _get_binary_directory_path(self, name):
return tc.JVM_DIR + "/" + ns.get_package_name(name)

def _get_jre_subpackage(self):
return [tc.JRE]
Expand All @@ -565,12 +565,12 @@ def _check_binaries_against_hardcoded_list(self, binaries, subpackage):
if not tu.passed_or_failed(self, subpackage in hardcoded_binaries.keys(), "Binaries in unexpected subpackage: "
+ subpackage):
return
tu.passed_or_failed(self, sorted(binaries) == sorted(hardcoded_binaries[subpackage]),
missing_binaries = tu.two_lists_diff(hardcoded_binaries[subpackage], binaries)
extra_binaries = tu.two_lists_diff(binaries, hardcoded_binaries[subpackage])
is_same = sorted(binaries) == sorted(hardcoded_binaries[subpackage])
tu.passed_or_failed(self, is_same,
"Hardcode check: binaries are not as expected in {} subpackage. Missing binaries: {}."
" Extra binaries: {}".format(subpackage, tu.two_lists_diff(hardcoded_binaries[subpackage],
binaries),
tu.two_lists_diff(binaries,
hardcoded_binaries[subpackage])))
" Extra binaries: {}".format(subpackage, missing_binaries,extra_binaries))
return


Expand All @@ -584,6 +584,9 @@ class Temurin11(Temurin8):
JRE_BINARIES = ["java", "keytool", "pack200", "rmid", "unpack200",
"jjs", "rmiregistry", "jfr", "jrunscript", "jaotc"]

def check_java_cgi(self, args=None):
return


class Temurin17(Temurin11):
JDK_BINARIES = ["javac", "jdeps", "javadoc", "jfr", "jstack", "jstat",
Expand Down
2 changes: 1 addition & 1 deletion testcases/alternativesTests/binaries_test_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def all_jre_in_sdk_check(self, args=None):
tu.passed_or_failed(self, True, "")
except ValueError:
tu.passed_or_failed(self, False, "Binary " + j + " is present in JRE, but is missing in SDK.")
self.installed_binaries[current_subpkg] = sdk
#self.installed_binaries[current_subpkg] = sdk
return

def _extract_suffix_from_subpkg(self, subpkg):
Expand Down
36 changes: 34 additions & 2 deletions testcases/alternativesTests/permissions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,38 @@ class OpenJdkPostChange(OpenJdk8):
def _get_target_java_directory(self, name):
return pkgsplit.get_jvm_dir_post_change(name)

class Temurin(BaseTest):
def _get_target_java_directory(self, name):
return "-".join(["java", pkgsplit.get_major_ver(name), pkgsplit.get_vendor(name), pkgsplit.get_subpackage_only(name)])

def _test_fill_in(self, file, filetype, expected_permission):
"""
This method takes as an argument path to a file, type of the file for logs, expected permission and checks,
if it matches results from chroot. It also documents any fails or successful checks.
For Temurin I decided to be more permissive and allow it to have either same or lower permission for a file, then openjdk counterpart.
"""
out, res = DefaultPodman().executeCommand(['stat -c "%a" ' + file])
if out == "775" and "ibm" in file:
PermissionTest.instance.log("Skipping " + file + ". Some unzipped Ibm packages are acting wierdly in podman. "
"Howewer, in installed JDK, the permissions are correct.",
vc.Verbosity.TEST)
return
if res != 0:
passed_or_failed(self, False, filetype + " link is broken, could not find " + file)
return
else:
PermissionTest.instance.log(filetype + " {} exists. Checking permissions... ".format(file),
vc.Verbosity.PODMAN)
for p in range(3):
if not (int(out[p]) <= int(expected_permission[p])):
passed_or_failed(self, False, "Permissions of {} not as expected, should be {} but is "
"{}.".format(file, expected_permission, out))
return
PermissionTest.instance.log(filetype + " {} with permissions {}. Check "
"successful.".format(file, out), vc.Verbosity.PODMAN)
passed_or_failed(self, True, "")
return


class Oracle(BaseTest):
pass
Expand Down Expand Up @@ -319,8 +351,8 @@ def setCSCH(self):
# TODO might be worth to check also other subdirectories
self.csch = BaseTest()
return
if rpms.getVendor() == gc.ADOPTIUM:
self.csch = BaseTest()
if rpms.getVendor() == gc.TEMURIN:
self.csch = Temurin()
return
raise UnknownJavaVersionException("Unknown JDK version!!!")

Expand Down
10 changes: 6 additions & 4 deletions testcases/linkTests/subdirectory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def _subdirectory_test(self, pkgs):
name = os.path.basename(pkg)
_subpkg = rename_default_subpkg(pkgsplit.get_subpackage_only(name))
if _subpkg not in self._get_expected_subdirectories(name).keys():
continue
pass
if not DefaultPodman().run_all_scriptlets_for_install(pkg):
SubdirectoryTest.instance.log("Skipping subdirectory test for {}".format(_subpkg), vc.Verbosity.TEST)
continue
Expand Down Expand Up @@ -212,8 +212,10 @@ def _get_main_subdir(self, name):
return "java" + "-" + self._get_major_version() + "-" + self.rpms.getVendor()
class Temurin(OpenJdk11):
def _get_expected_subdirectories(self, name):
subdirs = {JRE: ["-".join([gc.TEMURIN, self.rpms.getMajorVersionSimplified(), JRE])],
JDK: ["-".join([gc.TEMURIN, self.rpms.getMajorVersionSimplified(), JDK])]}
subdirs = {}
for subpkg in [JRE, JDK]:
subdirs[subpkg] =["-".join([gc.JAVA_STRING, self.rpms.getMajorVersionSimplified(), gc.TEMURIN, subpkg]),
"-".join([gc.TEMURIN, self.rpms.getMajorVersionSimplified(), subpkg.lower()])]
return subdirs

def _get_expected_link(self, name):
Expand Down Expand Up @@ -334,7 +336,7 @@ def setCSCH(self):
elif rpms.getVendor() == gc.ITW:
self.csch = ITW()
return
elif rpms.getVendor() == gc.ADOPTIUM:
elif rpms.getVendor() == gc.TEMURIN:
self.csch = Temurin()
return

Expand Down
5 changes: 2 additions & 3 deletions testcases/manpagesTests/manpage_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import config.global_config as gc
import utils.test_constants as tc
import config.verbosity_config as vc
import utils.pkg_name_split as ns


MANPAGE_SUFFIX = ".1.gz"
Expand Down Expand Up @@ -538,7 +537,7 @@ def manpage_file_check(self, bins, subpackage=None, plugin_bin_content=None, man

def _get_manpages_without_postscript(self, default_mans, subpkg):
return self._clean_default_mpges(default_mans,
mexe.DefaultPodman().execute_ls(tc.JVM_DIR + "/" + self.rpms.getMajorPackage() + "-" + subpkg + "/man/man1")[0]
mexe.DefaultPodman().execute_ls(tc.JVM_DIR + "/" + "-".join([gc.JAVA_STRING, self.rpms.getMajorVersionSimplified(), self.rpms.getVendor(), subpkg]) + "/man/man1")[0]
.split())


Expand Down Expand Up @@ -628,7 +627,7 @@ def setCSCH(self):
elif rpms.getVendor() == gc.IBM_SEMERU:
self.csch = OpenJdk21Semeru()
return
elif rpms.getVendor() == gc.ADOPTIUM:
elif rpms.getVendor() == gc.TEMURIN:
if int(rpms.getMajorVersionSimplified()) == 8:
self.csch = Temurin8()
return
Expand Down
2 changes: 1 addition & 1 deletion testcases/nameTest/initibuild_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def setCSCH(self):
if rpms.getJava() == gc.ITW:
self.log("Set ItwVersionCheck")
self.csch = testcases.nameTest.connfigs.initbuild_config.ItwVersionCheck()
elif rpms.getVendor() == gc.ADOPTIUM:
elif rpms.getVendor() == gc.TEMURIN:
self.log("Set TemurinCheck")
self.csch = testcases.nameTest.connfigs.initbuild_config.TemurinCheck()
else:
Expand Down
4 changes: 2 additions & 2 deletions testcases/nameTest/name_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self):
super().__init__()

def aMatchesB(self, a, b):
return self.csch.checkRegex(a)
return self.csch.checkRegex(a)

def checkFilesAgainstValues(self, values, function):
return self.checkFilesAgainstComparator(values, function, aInB)
Expand Down Expand Up @@ -107,7 +107,7 @@ def setCSCH(self):
self.log("Set ItwRegexCheck")
self.csch = testcases.nameTest.connfigs.nametest_config.ItwRegexCheck()
return
if config.runtime_config.RuntimeConfig().getRpmList().getJava() == gc.TEMURIN:
if config.runtime_config.RuntimeConfig().getRpmList().getVendor() == gc.TEMURIN:
self.log("Set Temurin Regex Check")
self.csch = testcases.nameTest.connfigs.nametest_config.TemurinRegexCheck()
return
Expand Down
2 changes: 1 addition & 1 deletion testcases/nameTest/subpackages_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def setCSCH(self):
elif rpms.getVendor() == gc.IBM_SEMERU:
self.csch = OpenJdkLatest()
return
elif rpms.getVendor() == gc.ADOPTIUM:
elif rpms.getVendor() == gc.TEMURIN:
self.csch = BaseTemurinPackages()
return
raise ex.UnknownJavaVersionException("Java version or OS was not recognized by this framework.")
Expand Down
2 changes: 1 addition & 1 deletion testcases/priorityTest/postinstall_master_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def setCSCH(self):
return
else:
raise ex.UnknownJavaVersionException("Unknown Oracle java version.")
elif rpms.getVendor() == gc.ADOPTIUM:
elif rpms.getVendor() == gc.TEMURIN:
self.csch = Temurin()
return
else:
Expand Down
11 changes: 9 additions & 2 deletions testcases/priorityTest/priority_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
PREFIX_210 = "210"
PREFIX_1700 = "1700"
PREFIX_2100 = "2100"
PREFIX_1161 = "1161"
PREFIX_1712 = "1712"
LEN_4 = 4
LEN_5 = 5
LEN_6 = 6
Expand Down Expand Up @@ -224,6 +226,11 @@ def __init__(self):
super().__init__(LEN_4, PREFIX_111)


class Temurin17(MajorCheck):
def __init__(self):
super().__init__(LEN_4, PREFIX_1712)


class PriorityCheck(utils.core.base_xtest.BaseTest):
instance = None

Expand Down Expand Up @@ -273,8 +280,8 @@ def setCSCH(self):
elif rpms.getVendor() == gc.ITW:
self.csch = IcedTeaWeb()
return
elif rpms.getVendor() == gc.ADOPTIUM:
self.csch = Temurin()
elif rpms.getVendor() == gc.TEMURIN:
self.csch = Temurin17()
return
else:
raise ex.UnknownJavaVersionException("Unknown platform, java was not identified.")
Expand Down
28 changes: 20 additions & 8 deletions testcases/rpmTests/ghost_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import utils.test_constants as tc
import utils.core.configuration_specific as cs
import config.runtime_config as rc
import config.global_config as gc



class GhostTest(bt.BaseTest):
Expand All @@ -21,15 +23,19 @@ def test_ghosts(self):
def setCSCH(self):
arch = self.getCurrentArch()
rpms = rc.RuntimeConfig().getRpmList()
if int(rpms.getMajorVersionSimplified()) == 8:
if tc.is_arch_jitarch(arch) and "ppc" not in arch:
self.csch = Ojdk8JIT()
return
else:
self.csch = Ojdk8NonJIT()
if rpms.getVendor() == gc.OPENJDK:
if int(rpms.getMajorVersionSimplified()) == 8:
if tc.is_arch_jitarch(arch) and "ppc" not in arch:
self.csch = Ojdk8JIT()
return
else:
self.csch = Ojdk8NonJIT()
return
elif int(rpms.getMajorVersionSimplified()) == 11:
self.csch = Ojdk11JIT()
return
elif int(rpms.getMajorVersionSimplified()) == 11:
self.csch = Ojdk11JIT()
elif rpms.getVendor() == gc.TEMURIN:
self.csch = Temurin()
return
else:
self.csch = OjdklatestJIT()
Expand Down Expand Up @@ -186,6 +192,12 @@ def _get_hardcoded_ghosts(self, file):
# ghosts.add("/usr/lib/jvm/" + nvra + debugsuffix + "/lib/server/classes.jsa")
return ghosts

class Temurin(OjdklatestJIT):
def _get_hardcoded_ghosts(self, file):
ghosts = super(Temurin, self)._get_hardcoded_ghosts(file)
ghosts.add("/usr/lib/jvm/java-{}-temurin-{}".format(ns.get_major_ver(file), ns.get_subpackage_only(file)))
return ghosts


def testAll():
return GhostTest().execute_tests()
Expand Down
2 changes: 1 addition & 1 deletion testcases/rpmTests/provides_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def setCSCH(self):
self.log("Set ItwVersionCheck")
self.csch = ITWeb(ProvidesTest.instance)
return
elif rpms.getVendor() == gc.ADOPTIUM:
elif rpms.getVendor() == gc.TEMURIN:
self.csch = Temurin(ProvidesTest.instance)
return
else:
Expand Down
2 changes: 1 addition & 1 deletion testcases/rpmTests/requires_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self):

def setCSCH(self):
rpms = rc.RuntimeConfig().getRpmList()
if rpms.getVendor() == gc.ADOPTIUM:
if rpms.getVendor() == gc.TEMURIN:
self.csch = Temurin(self)
return
self.csch = Default(self)
Expand Down
6 changes: 3 additions & 3 deletions testcases/scripletTests/scriplet_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _get_expected_scriptlets(self, pkg):

class TemurinScriptletCsch(GenericScriptletCsch):
def _get_expected_scriptlets(self, pkg):
return [rpmbu.POSTINSTALL, rpmbu.PREUNINSTALL]
return [rpmbu.POSTINSTALL, rpmbu.PREUNINSTALL, rpmbu.POSTTRANS]


class SemeruSriptletCsch(GenericScriptletCsch):
Expand Down Expand Up @@ -101,7 +101,7 @@ def check_allScripletsPReturnsZero(self, pkgs):
self.log("is " + str(len(content)) + " lines long")
self.log("executing " + scriplet + " in " + ntpath.basename(pkg))
arg = "1" if scriplet in ScripletStarterFinisher.installScriptlets else "0"
o, r = DefaultPodman().executeScriptlet(pkg, scriplet, arg)
o, r = DefaultPodman().executeScriptlet(pkg, scriplet, script_arg=arg)
self.log(scriplet + " returned " + str(r) + " of " + ntpath.basename(pkg))
tu.passed_or_failed(self, r == 0,
"scriptlet {} returning non zero value for {}".format(scriplet, pkg)
Expand All @@ -110,7 +110,7 @@ def check_allScripletsPReturnsZero(self, pkgs):

def setCSCH(self):
rpms = rc.RuntimeConfig().getRpmList()
if rpms.getVendor() == gc.ADOPTIUM:
if rpms.getVendor() == gc.TEMURIN:
self.csch = TemurinScriptletCsch()
elif rpms.getVendor() == gc.IBM and int(rpms.getMajorVersionSimplified()) >= 21:
self.csch = SemeruSriptletCsch()
Expand Down
11 changes: 10 additions & 1 deletion testcases/virtualDeps/obsolete_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import utils.core.base_xtest
import outputControl.logging_access as la
import utils.test_utils as tu
import utils.test_constants as tc
import config.global_config as gc


class Base(cs.JdkConfiguration):
Expand Down Expand Up @@ -48,11 +50,15 @@ class JdkRhel(Base):
def _checkJreObsolete(self, obsoletes=None):
self._document("Jdks in rhel must NOT obsolete anything. Possible exceptions: " +
",".join(JdkRhel.jreExceptionsObsolete))
tu.passed_or_failed(self, len(set(obsoletes)-set(JdkRhel.jreExceptionsObsolete)) == 0,
tu.passed_or_failed(self, len(set(obsoletes)-set(self.jreExceptionsObsolete)) == 0,
"Number of obsoletes and obsoleteExceptions is not same.",
"this test is checking only count of obsoletes vs count of exceptions, needs rework")
return self.passed, self.failed

class TemurinRhel(JdkRhel):
jreExceptionsObsolete = ["-".join([gc.TEMURIN, config.runtime_config.RuntimeConfig().getRpmList().getMajorVersionSimplified(), tc.JRE]),
"-".join([gc.TEMURIN, config.runtime_config.RuntimeConfig().getRpmList().getMajorVersionSimplified(), tc.JDK])]


class ObsolateTest(utils.core.base_xtest.BaseTest):

Expand All @@ -67,6 +73,9 @@ def setCSCH(self):
if config.runtime_config.RuntimeConfig().getRpmList().isItw() :
self.csch = ITW()
return
elif config.runtime_config.RuntimeConfig().getRpmList().getVendor() == gc.TEMURIN:
self.csch = TemurinRhel()
return
else:
self.csch = JdkRhel()

Expand Down
Loading