Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] oeqa/buildoptions: Improve unsafe references tests
Date: Mon, 29 Feb 2016 15:36:48 +0000	[thread overview]
Message-ID: <1456760208.11498.178.camel@linuxfoundation.org> (raw)

Fixing one of the recipes not to contain unsafe references to paths
results in this QA test failing. Improve the test so that we test
the recipe works, then if we intentionally break the recipe, the
issue is detected.

Also split out the binaries test from the scripts test. The binaries
issue may also get 'fixed' in future and need the same fix.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py
index e2d12c3..6f322c5 100644
--- a/meta/lib/oeqa/selftest/buildoptions.py
+++ b/meta/lib/oeqa/selftest/buildoptions.py
@@ -102,12 +102,38 @@ class SanityOptionsTest(oeSelfTest):
         self.assertTrue(line and line.startswith("WARNING:"), msg=res.output)
 
     @testcase(278)
-    def test_sanity_userspace_dependency(self):
-        self.write_config('WARN_QA_append = " unsafe-references-in-binaries unsafe-references-in-scripts"')
-        bitbake("-ccleansstate gzip nfs-utils")
-        res = bitbake("gzip nfs-utils")
+    def test_sanity_unsafe_script_references(self):
+        self.write_config('WARN_QA_append = " unsafe-references-in-scripts"')
+
+        bitbake("-ccleansstate gzip")
+        res = bitbake("gzip")
+        line = self.getline(res, "QA Issue: gzip")
+        self.assertFalse(line, "WARNING: QA Issue: gzip message is present in bitbake's output and shouldn't be: %s" % res.output)
+
+        self.append_config("""
+do_install_append_pn-gzip () {
+	echo "\n${bindir}/test" >> ${D}${bindir}/zcat
+}
+""")
+        res = bitbake("gzip")
         line = self.getline(res, "QA Issue: gzip")
         self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output)
+
+    def test_sanity_unsafe_binary_references(self):
+        self.write_config('WARN_QA_append = " unsafe-references-in-binaries"')
+
+        bitbake("-ccleansstate nfs-utils")
+        #res = bitbake("nfs-utils")
+        # FIXME when nfs-utils passes this test
+        #line = self.getline(res, "QA Issue: nfs-utils")
+        #self.assertFalse(line, "WARNING: QA Issue: nfs-utils message is present in bitbake's output and shouldn't be: %s" % res.output)
+
+#        self.append_config("""
+#do_install_append_pn-nfs-utils () {
+#	echo "\n${bindir}/test" >> ${D}${base_sbindir}/osd_login
+#}
+#""")
+        res = bitbake("nfs-utils")
         line = self.getline(res, "QA Issue: nfs-utils")
         self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output)
 




                 reply	other threads:[~2016-02-29 15:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456760208.11498.178.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox