diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-29 15:36:48 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-07 00:11:37 +0000 |
commit | 82d0c8ad1e6310888084409afe645239d8316b5b (patch) | |
tree | 8382b93793cb35383d40c11893a191e4b21b562c | |
parent | 4284fdfe5e8cb17fdc75ce6759f27db3bce2b96c (diff) | |
download | poky-82d0c8ad1e6310888084409afe645239d8316b5b.tar.gz |
oeqa/buildoptions: Improve unsafe references tests
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.
(From OE-Core rev: 68db200ca5b404d6c0aa0cbf5a587397d0aa65da)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/buildoptions.py | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py index e2d12c3f11..6f322c5ba7 100644 --- a/meta/lib/oeqa/selftest/buildoptions.py +++ b/meta/lib/oeqa/selftest/buildoptions.py | |||
@@ -102,12 +102,38 @@ class SanityOptionsTest(oeSelfTest): | |||
102 | self.assertTrue(line and line.startswith("WARNING:"), msg=res.output) | 102 | self.assertTrue(line and line.startswith("WARNING:"), msg=res.output) |
103 | 103 | ||
104 | @testcase(278) | 104 | @testcase(278) |
105 | def test_sanity_userspace_dependency(self): | 105 | def test_sanity_unsafe_script_references(self): |
106 | self.write_config('WARN_QA_append = " unsafe-references-in-binaries unsafe-references-in-scripts"') | 106 | self.write_config('WARN_QA_append = " unsafe-references-in-scripts"') |
107 | bitbake("-ccleansstate gzip nfs-utils") | 107 | |
108 | res = bitbake("gzip nfs-utils") | 108 | bitbake("-ccleansstate gzip") |
109 | res = bitbake("gzip") | ||
110 | line = self.getline(res, "QA Issue: gzip") | ||
111 | self.assertFalse(line, "WARNING: QA Issue: gzip message is present in bitbake's output and shouldn't be: %s" % res.output) | ||
112 | |||
113 | self.append_config(""" | ||
114 | do_install_append_pn-gzip () { | ||
115 | echo "\n${bindir}/test" >> ${D}${bindir}/zcat | ||
116 | } | ||
117 | """) | ||
118 | res = bitbake("gzip") | ||
109 | line = self.getline(res, "QA Issue: gzip") | 119 | line = self.getline(res, "QA Issue: gzip") |
110 | self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output) | 120 | self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output) |
121 | |||
122 | def test_sanity_unsafe_binary_references(self): | ||
123 | self.write_config('WARN_QA_append = " unsafe-references-in-binaries"') | ||
124 | |||
125 | bitbake("-ccleansstate nfs-utils") | ||
126 | #res = bitbake("nfs-utils") | ||
127 | # FIXME when nfs-utils passes this test | ||
128 | #line = self.getline(res, "QA Issue: nfs-utils") | ||
129 | #self.assertFalse(line, "WARNING: QA Issue: nfs-utils message is present in bitbake's output and shouldn't be: %s" % res.output) | ||
130 | |||
131 | # self.append_config(""" | ||
132 | #do_install_append_pn-nfs-utils () { | ||
133 | # echo "\n${bindir}/test" >> ${D}${base_sbindir}/osd_login | ||
134 | #} | ||
135 | #""") | ||
136 | res = bitbake("nfs-utils") | ||
111 | line = self.getline(res, "QA Issue: nfs-utils") | 137 | line = self.getline(res, "QA Issue: nfs-utils") |
112 | self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output) | 138 | self.assertTrue(line and line.startswith("WARNING:"), "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output) |
113 | 139 | ||