diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-14 17:24:14 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-15 09:44:33 +0100 |
commit | 79d72d9045ec077da3804c6691eec32941b1a053 (patch) | |
tree | 249360cc199d9fc8dcadf0cfad596ee088e281ee /meta/lib/oeqa/selftest | |
parent | a1b4b7c0b493968a6f9d519a3a37d87466432f0d (diff) | |
download | poky-79d72d9045ec077da3804c6691eec32941b1a053.tar.gz |
selftest/package: Improve test to cover sparseness and hardlinking from sstate
The sparseness test was sometimes working and sometimes failing depending
on whether sstate was valid. This adds an explict test of sstate
to the test for both hardlinking and sparseness. Tweak the test name to
cover the fact its tests sparseness too.
(From OE-Core rev: fe5b37c07b6d07c350516ab6bf849d6d86a84004)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/package.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/meta/lib/oeqa/selftest/cases/package.py b/meta/lib/oeqa/selftest/cases/package.py index 4ff9b08c96..ee6430a184 100644 --- a/meta/lib/oeqa/selftest/cases/package.py +++ b/meta/lib/oeqa/selftest/cases/package.py | |||
@@ -89,17 +89,26 @@ class VersionOrdering(OESelftestTestCase): | |||
89 | class PackageTests(OESelftestTestCase): | 89 | class PackageTests(OESelftestTestCase): |
90 | # Verify that a recipe which sets up hardlink files has those preserved into split packages | 90 | # Verify that a recipe which sets up hardlink files has those preserved into split packages |
91 | # Also test file sparseness is preserved | 91 | # Also test file sparseness is preserved |
92 | def test_preserve_hardlinks(self): | 92 | def test_preserve_sparse_hardlinks(self): |
93 | result = bitbake("selftest-hardlink -c package") | 93 | bitbake("selftest-hardlink -c package") |
94 | 94 | ||
95 | dest = get_bb_var('PKGDEST', 'selftest-hardlink') | 95 | dest = get_bb_var('PKGDEST', 'selftest-hardlink') |
96 | bindir = get_bb_var('bindir', 'selftest-hardlink') | 96 | bindir = get_bb_var('bindir', 'selftest-hardlink') |
97 | 97 | ||
98 | # Recipe creates 4 hardlinked files, there is a copy in package/ and a copy in packages-split/ | 98 | def checkfiles(): |
99 | # so expect 8 in total. | 99 | # Recipe creates 4 hardlinked files, there is a copy in package/ and a copy in packages-split/ |
100 | self.assertEqual(os.stat(dest + "/selftest-hardlink" + bindir + "/hello").st_nlink, 8) | 100 | # so expect 8 in total. |
101 | self.assertEqual(os.stat(dest + "/selftest-hardlink" + bindir + "/hello").st_nlink, 8) | ||
101 | 102 | ||
102 | # Test a sparse file remains sparse | 103 | # Test a sparse file remains sparse |
103 | sparsestat = os.stat(dest + "/selftest-hardlink" + bindir + "/sparsetest") | 104 | sparsestat = os.stat(dest + "/selftest-hardlink" + bindir + "/sparsetest") |
104 | self.assertEqual(sparsestat.st_blocks, 0) | 105 | self.assertEqual(sparsestat.st_blocks, 0) |
105 | self.assertEqual(sparsestat.st_size, 1048576) | 106 | self.assertEqual(sparsestat.st_size, 1048576) |
107 | |||
108 | checkfiles() | ||
109 | |||
110 | # Clean and reinstall so its now definitely from sstate, then retest. | ||
111 | bitbake("selftest-hardlink -c clean") | ||
112 | bitbake("selftest-hardlink -c package") | ||
113 | |||
114 | checkfiles() | ||