diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-17 11:17:47 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-19 17:24:47 +0000 |
commit | 12e37e7c79e1694763a8066dbce74c2e39e27271 (patch) | |
tree | d7b086d3d6973a043930ef43d089cd70271d5f7e /meta/lib/oeqa | |
parent | 05716dd7ee475ba6e4129243951cc8a661b53e46 (diff) | |
download | poky-12e37e7c79e1694763a8066dbce74c2e39e27271.tar.gz |
selftest/buildhistory: Improve test to remove sources of error
When we add buildhistory, we expect do_rootfs to rerun, but depending
on IMAGE_FSTYPES, the number of tasks which would execute after
do_rootfs varies (e.g. live would add do_bootimg and we recently
added do_image).
Therefore limit the test to -c rootfs and then we're clear that only
one task should re-run.
(From OE-Core rev: 9e9a33281e6008c3b699b5bbb738921829dbc501)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/selftest/buildoptions.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py index 64ced151b4..6167fb29e2 100644 --- a/meta/lib/oeqa/selftest/buildoptions.py +++ b/meta/lib/oeqa/selftest/buildoptions.py | |||
@@ -122,7 +122,7 @@ class BuildhistoryTests(BuildhistoryBase): | |||
122 | def test_buildhistory_does_not_change_signatures(self): | 122 | def test_buildhistory_does_not_change_signatures(self): |
123 | """ | 123 | """ |
124 | Summary: Ensure that buildhistory does not change signatures | 124 | Summary: Ensure that buildhistory does not change signatures |
125 | Expected: Only 'do_rootfs' and 'do_build' tasks are rerun | 125 | Expected: Only 'do_rootfs' task should be rerun |
126 | Product: oe-core | 126 | Product: oe-core |
127 | Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com> | 127 | Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com> |
128 | AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com> | 128 | AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com> |
@@ -139,12 +139,12 @@ class BuildhistoryTests(BuildhistoryBase): | |||
139 | 139 | ||
140 | features = 'TMPDIR = "%s"\n' % tmpdir1 | 140 | features = 'TMPDIR = "%s"\n' % tmpdir1 |
141 | self.write_config(features) | 141 | self.write_config(features) |
142 | bitbake('core-image-sato -S none') | 142 | bitbake('core-image-sato -S none -c rootfs') |
143 | 143 | ||
144 | features = 'TMPDIR = "%s"\n' % tmpdir2 | 144 | features = 'TMPDIR = "%s"\n' % tmpdir2 |
145 | features += 'INHERIT += "buildhistory"\n' | 145 | features += 'INHERIT += "buildhistory"\n' |
146 | self.write_config(features) | 146 | self.write_config(features) |
147 | bitbake('core-image-sato -S none') | 147 | bitbake('core-image-sato -S none -c rootfs') |
148 | 148 | ||
149 | def get_files(d): | 149 | def get_files(d): |
150 | f = [] | 150 | f = [] |
@@ -161,24 +161,20 @@ class BuildhistoryTests(BuildhistoryBase): | |||
161 | f2 = set(files2) | 161 | f2 = set(files2) |
162 | sigdiff = f1 - f2 | 162 | sigdiff = f1 - f2 |
163 | 163 | ||
164 | self.assertEqual(len(sigdiff), 2, 'Expected 2 signature differences. Out: %s' % list(sigdiff)) | 164 | self.assertEqual(len(sigdiff), 1, 'Expected 1 signature differences. Out: %s' % list(sigdiff)) |
165 | 165 | ||
166 | unexpected_diff = [] | 166 | unexpected_diff = [] |
167 | 167 | ||
168 | # No new signatures should appear apart from do_rootfs and do_build | 168 | # No new signatures should appear apart from do_rootfs |
169 | found_do_rootfs_flag = False | 169 | found_do_rootfs_flag = False |
170 | found_do_build_flag = False | ||
171 | 170 | ||
172 | for sig in sigdiff: | 171 | for sig in sigdiff: |
173 | if 'do_rootfs' in sig: | 172 | if 'do_rootfs' in sig: |
174 | found_do_rootfs_flag = True | 173 | found_do_rootfs_flag = True |
175 | elif 'do_build' in sig: | ||
176 | found_do_build_flag = True | ||
177 | else: | 174 | else: |
178 | unexpected_diff.append(sig) | 175 | unexpected_diff.append(sig) |
179 | 176 | ||
180 | self.assertTrue(found_do_rootfs_flag, 'Task do_rootfs did not rerun.') | 177 | self.assertTrue(found_do_rootfs_flag, 'Task do_rootfs did not rerun.') |
181 | self.assertTrue(found_do_build_flag, 'Task do_build did not rerun') | ||
182 | self.assertFalse(unexpected_diff, 'Found unexpected signature differences. Out: %s' % unexpected_diff) | 178 | self.assertFalse(unexpected_diff, 'Found unexpected signature differences. Out: %s' % unexpected_diff) |
183 | 179 | ||
184 | 180 | ||