summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2023-12-08 11:15:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-09 19:17:11 +0000
commit3befa37ae76e7893190277d369819a17e6e2d7bf (patch)
treec592fd8b887d631af1e779a66fdc65ba613f16f5
parent97a7fe536d3f8afbbfe709852a21eee67d739a98 (diff)
downloadpoky-3befa37ae76e7893190277d369819a17e6e2d7bf.tar.gz
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>
-rw-r--r--meta/lib/oeqa/selftest/cases/sstatetests.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py
index 7900185450..795cd5bd85 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -777,10 +777,10 @@ addtask tmptask2 before do_tmptask1
777 777
778class SStatePrintdiff(SStateBase): 778class SStatePrintdiff(SStateBase):
779 def run_test_printdiff_changerecipe(self, target, change_recipe, change_bbtask, change_content, expected_sametmp_output, expected_difftmp_output): 779 def run_test_printdiff_changerecipe(self, target, change_recipe, change_bbtask, change_content, expected_sametmp_output, expected_difftmp_output):
780 import time
780 self.write_config(""" 781 self.write_config("""
781TMPDIR = "${TOPDIR}/tmp-sstateprintdiff" 782TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-sametmp-{}"
782""") 783""".format(time.time()))
783 self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff")
784 # Use runall do_build to ensure any indirect sstate is created, e.g. tzcode-native on both x86 and 784 # Use runall do_build to ensure any indirect sstate is created, e.g. tzcode-native on both x86 and
785 # aarch64 hosts since only allarch target recipes depend upon it and it may not be built otherwise. 785 # aarch64 hosts since only allarch target recipes depend upon it and it may not be built otherwise.
786 # A bitbake -c cleansstate tzcode-native would cause some of these tests to error for example. 786 # A bitbake -c cleansstate tzcode-native would cause some of these tests to error for example.
@@ -791,9 +791,8 @@ TMPDIR = "${TOPDIR}/tmp-sstateprintdiff"
791 result_sametmp = bitbake("-S printdiff {}".format(target)) 791 result_sametmp = bitbake("-S printdiff {}".format(target))
792 792
793 self.write_config(""" 793 self.write_config("""
794TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2" 794TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-difftmp-{}"
795""") 795""".format(time.time()))
796 self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff-2")
797 result_difftmp = bitbake("-S printdiff {}".format(target)) 796 result_difftmp = bitbake("-S printdiff {}".format(target))
798 797
799 self.delete_recipeinc(change_recipe) 798 self.delete_recipeinc(change_recipe)
@@ -803,20 +802,19 @@ TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2"
803 self.assertIn(item, result_difftmp.output, msg = "Item {} not found in output:\n{}".format(item, result_difftmp.output)) 802 self.assertIn(item, result_difftmp.output, msg = "Item {} not found in output:\n{}".format(item, result_difftmp.output))
804 803
805 def run_test_printdiff_changeconfig(self, target, change_content, expected_sametmp_output, expected_difftmp_output): 804 def run_test_printdiff_changeconfig(self, target, change_content, expected_sametmp_output, expected_difftmp_output):
805 import time
806 self.write_config(""" 806 self.write_config("""
807TMPDIR = "${TOPDIR}/tmp-sstateprintdiff" 807TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-sametmp-{}"
808""") 808""".format(time.time()))
809 self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff")
810 bitbake("--runall build --runall deploy_source_date_epoch {}".format(target)) 809 bitbake("--runall build --runall deploy_source_date_epoch {}".format(target))
811 bitbake("-S none {}".format(target)) 810 bitbake("-S none {}".format(target))
812 self.append_config(change_content) 811 self.append_config(change_content)
813 result_sametmp = bitbake("-S printdiff {}".format(target)) 812 result_sametmp = bitbake("-S printdiff {}".format(target))
814 813
815 self.write_config(""" 814 self.write_config("""
816TMPDIR = "${TOPDIR}/tmp-sstateprintdiff-2" 815TMPDIR = "${{TOPDIR}}/tmp-sstateprintdiff-difftmp-{}"
817""") 816""".format(time.time()))
818 self.append_config(change_content) 817 self.append_config(change_content)
819 self.track_for_cleanup(self.topdir + "/tmp-sstateprintdiff-2")
820 result_difftmp = bitbake("-S printdiff {}".format(target)) 818 result_difftmp = bitbake("-S printdiff {}".format(target))
821 819
822 for item in expected_sametmp_output: 820 for item in expected_sametmp_output: