Browse Source

Fix packaging tests on debian 10 (#48138)

* Fix packaging tests on debian 10

- lintian no longer has  `--fail-on-warnings`
- Systemd has a build number / version after it's acutal version
```
alpar@alpar-ci-debian-10-1015-1517:~$ systemd --version
systemd 241 (241)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid
```
Alpar Torok 6 years ago
parent
commit
dbe9532b7f

+ 5 - 1
qa/os/src/test/java/org/elasticsearch/packaging/test/DebMetadataTests.java

@@ -38,7 +38,11 @@ public class DebMetadataTests extends PackagingTestCase {
     }
 
     public void test05CheckLintian() {
-        sh.run("lintian --fail-on-warnings " + FileUtils.getDistributionFile(distribution()));
+        String extraArgs = "";
+        if (sh.run("lintian --help").stdout.contains("fail-on-warnings")) {
+            extraArgs = "--fail-on-warnings ";
+        }
+        sh.run("lintian " + extraArgs + FileUtils.getDistributionFile(distribution()));
     }
 
     public void test06Dependencies() {

+ 1 - 1
qa/os/src/test/java/org/elasticsearch/packaging/test/PackageTests.java

@@ -190,7 +190,7 @@ public class PackageTests extends PackagingTestCase {
             } else {
 
                 final Result versionResult = sh.run("systemctl --version");
-                final Matcher matcher = Pattern.compile("^systemd (\\d+)\n").matcher(versionResult.stdout);
+                final Matcher matcher = Pattern.compile("^systemd (\\d+)").matcher(versionResult.stdout);
                 matcher.find();
                 final int version = Integer.parseInt(matcher.group(1));