aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-08-16 16:38:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-17 09:52:18 +0100
commit8e957f9dbf794195af093f3fbc00b4c8d269ee37 (patch)
tree56bdc49dca990376163cc122c4dc4f8f42b8b686
parentd25b644741f5b941aa3051545e86e16a365c51c3 (diff)
downloadopenembedded-core-contrib-8e957f9dbf794195af093f3fbc00b4c8d269ee37.tar.gz
openembedded-core-contrib-8e957f9dbf794195af093f3fbc00b4c8d269ee37.tar.bz2
openembedded-core-contrib-8e957f9dbf794195af093f3fbc00b4c8d269ee37.zip
oeqa/selftest/buildoptions: test buildhistory PKGSIZE and FILELIST fields
Add tests to ensure that PKGSIZE and FILELIST fields are set correctly. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/buildoptions.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/buildoptions.py b/meta/lib/oeqa/selftest/cases/buildoptions.py
index be49322f9c2..f99881758e3 100644
--- a/meta/lib/oeqa/selftest/cases/buildoptions.py
+++ b/meta/lib/oeqa/selftest/cases/buildoptions.py
@@ -148,6 +148,30 @@ class BuildhistoryTests(BuildhistoryBase):
self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True, error_regex=error)
+ def test_fileinfo(self):
+ self.config_buildhistory()
+ bitbake('hicolor-icon-theme')
+ history_dir = get_bb_var('BUILDHISTORY_DIR_PACKAGE', 'hicolor-icon-theme')
+ self.assertTrue(os.path.isdir(history_dir), 'buildhistory dir was not created.')
+
+ def load_bh(f):
+ d = {}
+ for line in open(f):
+ split = [s.strip() for s in line.split('=', 1)]
+ if len(split) > 1:
+ d[split[0]] = split[1]
+ return d
+
+ data = load_bh(os.path.join(history_dir, 'hicolor-icon-theme', 'latest'))
+ self.assertIn('FILELIST', data)
+ self.assertEqual(data['FILELIST'], '/usr/share/icons/hicolor/index.theme')
+ self.assertGreater(int(data['PKGSIZE']), 0)
+
+ data = load_bh(os.path.join(history_dir, 'hicolor-icon-theme-dev', 'latest'))
+ if 'FILELIST' in data:
+ self.assertEqual(data['FILELIST'], '')
+ self.assertEqual(int(data['PKGSIZE']), 0)
+
class ArchiverTest(OESelftestTestCase):
def test_arch_work_dir_and_export_source(self):
"""