Skip to content

Commit 92e33a1

Browse files
kanavinrpurdie
authored andcommitted
selftest/sstatetests: do not delete custom $TMPDIRs under build-st when testing printdiff
If the tests fail, these contain useful artefacts, and so should be kept. If the test succeeds the whole build-st/ is deleted. Also, give them unique names, as otherwise the tests would step on each other. Signed-off-by: Alexander Kanavin <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
1 parent 1b01a71 commit 92e33a1

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

meta/lib/oeqa/selftest/cases/sstatetests.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -777,10 +777,10 @@ def recursecb(key, hash1, hash2):
777777

778778
class SStatePrintdiff(SStateBase):
779779
def run_test_printdiff_changerecipe(self, target, change_recipe, change_bbtask, change_content, expected_sametmp_output, expected_difftmp_output):
780+
import time
780781
self.write_config("""
781-
TMPDIR = "${TOPDIR}/tmp-sstateprintdiff"
782-
""")
783-
self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff")
782+
TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-sametmp-{}"
783+
""".format(time.time()))
784784
# Use runall do_build to ensure any indirect sstate is created, e.g. tzcode-native on both x86 and
785785
# aarch64 hosts since only allarch target recipes depend upon it and it may not be built otherwise.
786786
# A bitbake -c cleansstate tzcode-native would cause some of these tests to error for example.
@@ -791,9 +791,8 @@ def run_test_printdiff_changerecipe(self, target, change_recipe, change_bbtask,
791791
result_sametmp = bitbake("-S printdiff {}".format(target))
792792

793793
self.write_config("""
794-
TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2"
795-
""")
796-
self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff-2")
794+
TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-difftmp-{}"
795+
""".format(time.time()))
797796
result_difftmp = bitbake("-S printdiff {}".format(target))
798797

799798
self.delete_recipeinc(change_recipe)
@@ -803,20 +802,19 @@ def run_test_printdiff_changerecipe(self, target, change_recipe, change_bbtask,
803802
self.assertIn(item, result_difftmp.output, msg = "Item {} not found in output:\n{}".format(item, result_difftmp.output))
804803

805804
def run_test_printdiff_changeconfig(self, target, change_content, expected_sametmp_output, expected_difftmp_output):
805+
import time
806806
self.write_config("""
807-
TMPDIR = "${TOPDIR}/tmp-sstateprintdiff"
808-
""")
809-
self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff")
807+
TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-sametmp-{}"
808+
""".format(time.time()))
810809
bitbake("--runall build --runall deploy_source_date_epoch {}".format(target))
811810
bitbake("-S none {}".format(target))
812811
self.append_config(change_content)
813812
result_sametmp = bitbake("-S printdiff {}".format(target))
814813

815814
self.write_config("""
816-
TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2"
817-
""")
815+
TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-difftmp-{}"
816+
""".format(time.time()))
818817
self.append_config(change_content)
819-
self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff-2")
820818
result_difftmp = bitbake("-S printdiff {}".format(target))
821819

822820
for item in expected_sametmp_output:

0 commit comments

Comments
 (0)