diff --git a/src/main/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTask.java b/src/main/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTask.java index ba7c801fe..3d858e961 100644 --- a/src/main/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTask.java +++ b/src/main/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTask.java @@ -277,6 +277,8 @@ protected PlatformDetails computeLabels( PREFERRED_LINUX_OS_NAMES.put("linuxmint", "LinuxMint"); PREFERRED_LINUX_OS_NAMES.put("ol", "OracleServer"); PREFERRED_LINUX_OS_NAMES.put("opensuse", "openSUSE"); + PREFERRED_LINUX_OS_NAMES.put("opensuse-leap", "openSUSE"); + PREFERRED_LINUX_OS_NAMES.put("opensuse-tumbleweed", "openSUSE"); PREFERRED_LINUX_OS_NAMES.put("raspbian", "Raspbian"); PREFERRED_LINUX_OS_NAMES.put("Red Hat Enterprise Linux", "RedHatEnterprise"); PREFERRED_LINUX_OS_NAMES.put("Red Hat Enterprise Linux Server", "RedHatEnterprise"); diff --git a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskLsbReleaseTest.java b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskLsbReleaseTest.java index 0dbd4c6cf..40af809f8 100644 --- a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskLsbReleaseTest.java +++ b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskLsbReleaseTest.java @@ -106,6 +106,12 @@ private static String computeExpectedName(String filename) { if (filename.contains("sles")) { return "SUSE"; } + if (filename.contains("opensuse-leap")) { + return "openSUSE"; + } + if (filename.contains("opensuse-tumbleweed")) { + return "openSUSE"; + } return filename.toLowerCase(Locale.ENGLISH); } diff --git a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskReleaseTest.java b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskReleaseTest.java index 80d3e5e27..737e220bd 100644 --- a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskReleaseTest.java +++ b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskReleaseTest.java @@ -100,6 +100,9 @@ private static String computeExpectedName(String filename) { if (filename.contains("linuxmint")) { return "LinuxMint"; } + if (filename.contains("opensuse")) { + return "openSUSE"; + } if (filename.contains("oraclelinux")) { return "OracleServer"; } diff --git a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskTest.java b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskTest.java index ab13a4a4d..a57741c96 100644 --- a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskTest.java +++ b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskTest.java @@ -64,6 +64,7 @@ private void assertPlatformDetails(PlatformDetails details) { is("AmazonAMI"), is("CentOS"), is("Debian"), + is("openSUSE"), is("Raspbian"), is("Ubuntu"))); // Yes, this is a dirty trick to detect the hardware architecture on some JVM's diff --git a/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-leap/15.2/Dockerfile b/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-leap/15.2/Dockerfile new file mode 100644 index 000000000..2f748c355 --- /dev/null +++ b/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-leap/15.2/Dockerfile @@ -0,0 +1,2 @@ +FROM opensuse/leap:15.2 +RUN zypper --non-interactive install -y lsb-release diff --git a/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-leap/15.2/lsb_release-a b/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-leap/15.2/lsb_release-a new file mode 100644 index 000000000..3a6430c2d --- /dev/null +++ b/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-leap/15.2/lsb_release-a @@ -0,0 +1,5 @@ +LSB Version: n/a +Distributor ID: openSUSE +Description: openSUSE Leap 15.2 +Release: 15.2 +Codename: n/a diff --git a/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-leap/15.2/os-release b/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-leap/15.2/os-release new file mode 100644 index 000000000..1494bc552 --- /dev/null +++ b/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-leap/15.2/os-release @@ -0,0 +1,10 @@ +NAME="openSUSE Leap" +VERSION="15.2" +ID="opensuse-leap" +ID_LIKE="suse opensuse" +VERSION_ID="15.2" +PRETTY_NAME="openSUSE Leap 15.2" +ANSI_COLOR="0;32" +CPE_NAME="cpe:/o:opensuse:leap:15.2" +BUG_REPORT_URL="https://bugs.opensuse.org" +HOME_URL="https://www.opensuse.org/" diff --git a/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-tumbleweed/20201004/Dockerfile b/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-tumbleweed/20201004/Dockerfile new file mode 100644 index 000000000..dfad6b8ed --- /dev/null +++ b/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-tumbleweed/20201004/Dockerfile @@ -0,0 +1 @@ +FROM opensuse/tumbleweed diff --git a/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-tumbleweed/20201004/os-release b/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-tumbleweed/20201004/os-release new file mode 100644 index 000000000..76fc13cba --- /dev/null +++ b/src/test/resources/org/jvnet/hudson/plugins/platformlabeler/opensuse-tumbleweed/20201004/os-release @@ -0,0 +1,12 @@ +NAME="openSUSE Tumbleweed" +# VERSION="20201004" +ID="opensuse-tumbleweed" +ID_LIKE="opensuse suse" +VERSION_ID="20201004" +PRETTY_NAME="openSUSE Tumbleweed" +ANSI_COLOR="0;32" +CPE_NAME="cpe:/o:opensuse:tumbleweed:20201004" +BUG_REPORT_URL="https://bugs.opensuse.org" +HOME_URL="https://www.opensuse.org/" +DOCUMENTATION_URL="https://en.opensuse.org/Portal:Tumbleweed" +LOGO="distributor-logo"