summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/buildoptions.py
diff options
context:
space:
mode:
authorDaniel Istrate <daniel.alexandrux.istrate@intel.com>2016-01-04 15:26:08 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-07 13:40:16 +0000
commit4ec2da71db78c16aedad2156a68b2e244ee2ccea (patch)
tree4130124b1375d60dcbc18872d62036824676741e /meta/lib/oeqa/selftest/buildoptions.py
parent02d259c1f4d9cf19636867ebcabf8695cd79f797 (diff)
downloadpoky-4ec2da71db78c16aedad2156a68b2e244ee2ccea.tar.gz
selftest: moved tc test_buildhistory_does_not_change_signatures
Moved test_buildhistory_does_not_change_signatures from buildhistory/BuildhistoryBase to buildoptions/BuildhistoryTests. The test being in the base class was causing it to run multiple times. Fix for [YOCTO #8867] (From OE-Core rev: 975e67e28ccba5dcb0fced43c1f9e7da183dc201) Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/buildoptions.py')
-rw-r--r--meta/lib/oeqa/selftest/buildoptions.py64
1 files changed, 64 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py
index acf481f7b8..64ced151b4 100644
--- a/meta/lib/oeqa/selftest/buildoptions.py
+++ b/meta/lib/oeqa/selftest/buildoptions.py
@@ -118,6 +118,70 @@ class BuildhistoryTests(BuildhistoryBase):
118 self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True) 118 self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
119 self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True, error_regex=error) 119 self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True, error_regex=error)
120 120
121 @testcase(1386)
122 def test_buildhistory_does_not_change_signatures(self):
123 """
124 Summary: Ensure that buildhistory does not change signatures
125 Expected: Only 'do_rootfs' and 'do_build' tasks are rerun
126 Product: oe-core
127 Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
128 AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
129 """
130
131 tmpdir1_name = 'tmpsig1'
132 tmpdir2_name = 'tmpsig2'
133 builddir = os.environ.get('BUILDDIR')
134 tmpdir1 = os.path.join(builddir, tmpdir1_name)
135 tmpdir2 = os.path.join(builddir, tmpdir2_name)
136
137 self.track_for_cleanup(tmpdir1)
138 self.track_for_cleanup(tmpdir2)
139
140 features = 'TMPDIR = "%s"\n' % tmpdir1
141 self.write_config(features)
142 bitbake('core-image-sato -S none')
143
144 features = 'TMPDIR = "%s"\n' % tmpdir2
145 features += 'INHERIT += "buildhistory"\n'
146 self.write_config(features)
147 bitbake('core-image-sato -S none')
148
149 def get_files(d):
150 f = []
151 for root, dirs, files in os.walk(d):
152 for name in files:
153 f.append(os.path.join(root, name))
154 return f
155
156 files1 = get_files(tmpdir1 + '/stamps')
157 files2 = get_files(tmpdir2 + '/stamps')
158 files2 = [x.replace(tmpdir2_name, tmpdir1_name) for x in files2]
159
160 f1 = set(files1)
161 f2 = set(files2)
162 sigdiff = f1 - f2
163
164 self.assertEqual(len(sigdiff), 2, 'Expected 2 signature differences. Out: %s' % list(sigdiff))
165
166 unexpected_diff = []
167
168 # No new signatures should appear apart from do_rootfs and do_build
169 found_do_rootfs_flag = False
170 found_do_build_flag = False
171
172 for sig in sigdiff:
173 if 'do_rootfs' in sig:
174 found_do_rootfs_flag = True
175 elif 'do_build' in sig:
176 found_do_build_flag = True
177 else:
178 unexpected_diff.append(sig)
179
180 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)
183
184
121class BuildImagesTest(oeSelfTest): 185class BuildImagesTest(oeSelfTest):
122 @testcase(563) 186 @testcase(563)
123 def test_directfb(self): 187 def test_directfb(self):