mirror of
https://git.yoctoproject.org/poky
synced 2026-09-16 18:49:34 +02:00
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. (From OE-Core rev: 92e33a19fbcc6c59199fcd8b17ad8ca29ebcd4fd) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
97a7fe536d
commit
3befa37ae7
@@ -777,10 +777,10 @@ addtask tmptask2 before do_tmptask1
|
|||||||
|
|
||||||
class SStatePrintdiff(SStateBase):
|
class SStatePrintdiff(SStateBase):
|
||||||
def run_test_printdiff_changerecipe(self, target, change_recipe, change_bbtask, change_content, expected_sametmp_output, expected_difftmp_output):
|
def run_test_printdiff_changerecipe(self, target, change_recipe, change_bbtask, change_content, expected_sametmp_output, expected_difftmp_output):
|
||||||
|
import time
|
||||||
self.write_config("""
|
self.write_config("""
|
||||||
TMPDIR = "${TOPDIR}/tmp-sstateprintdiff"
|
TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-sametmp-{}"
|
||||||
""")
|
""".format(time.time()))
|
||||||
self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff")
|
|
||||||
# Use runall do_build to ensure any indirect sstate is created, e.g. tzcode-native on both x86 and
|
# Use runall do_build to ensure any indirect sstate is created, e.g. tzcode-native on both x86 and
|
||||||
# aarch64 hosts since only allarch target recipes depend upon it and it may not be built otherwise.
|
# aarch64 hosts since only allarch target recipes depend upon it and it may not be built otherwise.
|
||||||
# A bitbake -c cleansstate tzcode-native would cause some of these tests to error for example.
|
# A bitbake -c cleansstate tzcode-native would cause some of these tests to error for example.
|
||||||
@@ -791,9 +791,8 @@ TMPDIR = "${TOPDIR}/tmp-sstateprintdiff"
|
|||||||
result_sametmp = bitbake("-S printdiff {}".format(target))
|
result_sametmp = bitbake("-S printdiff {}".format(target))
|
||||||
|
|
||||||
self.write_config("""
|
self.write_config("""
|
||||||
TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2"
|
TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-difftmp-{}"
|
||||||
""")
|
""".format(time.time()))
|
||||||
self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff-2")
|
|
||||||
result_difftmp = bitbake("-S printdiff {}".format(target))
|
result_difftmp = bitbake("-S printdiff {}".format(target))
|
||||||
|
|
||||||
self.delete_recipeinc(change_recipe)
|
self.delete_recipeinc(change_recipe)
|
||||||
@@ -803,20 +802,19 @@ TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2"
|
|||||||
self.assertIn(item, result_difftmp.output, msg = "Item {} not found in output:\n{}".format(item, result_difftmp.output))
|
self.assertIn(item, result_difftmp.output, msg = "Item {} not found in output:\n{}".format(item, result_difftmp.output))
|
||||||
|
|
||||||
def run_test_printdiff_changeconfig(self, target, change_content, expected_sametmp_output, expected_difftmp_output):
|
def run_test_printdiff_changeconfig(self, target, change_content, expected_sametmp_output, expected_difftmp_output):
|
||||||
|
import time
|
||||||
self.write_config("""
|
self.write_config("""
|
||||||
TMPDIR = "${TOPDIR}/tmp-sstateprintdiff"
|
TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-sametmp-{}"
|
||||||
""")
|
""".format(time.time()))
|
||||||
self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff")
|
|
||||||
bitbake("--runall build --runall deploy_source_date_epoch {}".format(target))
|
bitbake("--runall build --runall deploy_source_date_epoch {}".format(target))
|
||||||
bitbake("-S none {}".format(target))
|
bitbake("-S none {}".format(target))
|
||||||
self.append_config(change_content)
|
self.append_config(change_content)
|
||||||
result_sametmp = bitbake("-S printdiff {}".format(target))
|
result_sametmp = bitbake("-S printdiff {}".format(target))
|
||||||
|
|
||||||
self.write_config("""
|
self.write_config("""
|
||||||
TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2"
|
TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-difftmp-{}"
|
||||||
""")
|
""".format(time.time()))
|
||||||
self.append_config(change_content)
|
self.append_config(change_content)
|
||||||
self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff-2")
|
|
||||||
result_difftmp = bitbake("-S printdiff {}".format(target))
|
result_difftmp = bitbake("-S printdiff {}".format(target))
|
||||||
|
|
||||||
for item in expected_sametmp_output:
|
for item in expected_sametmp_output:
|
||||||
|
|||||||
Reference in New Issue
Block a user