summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/sstatetests.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/sstatetests.py')
-rw-r--r--meta/lib/oeqa/selftest/sstatetests.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
index 4b2c26d0c1..acc0c27835 100644
--- a/meta/lib/oeqa/selftest/sstatetests.py
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -48,12 +48,15 @@ class SStateTests(SStateBase):
48 bitbake(['-ccleansstate'] + targets) 48 bitbake(['-ccleansstate'] + targets)
49 49
50 bitbake(targets) 50 bitbake(targets)
51 file_tracker_1 = self.search_sstate('|'.join(map(str, targets)), distro_specific, distro_nonspecific) 51 tgz_created = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific)
52 self.assertTrue(file_tracker_1, msg="Could not find sstate files for: %s" % ', '.join(map(str, targets))) 52 self.assertTrue(tgz_created, msg="Could not find sstate .tgz files for: %s" % ', '.join(map(str, targets)))
53
54 siginfo_created = self.search_sstate('|'.join(map(str, [s + '.*?\.siginfo$' for s in targets])), distro_specific, distro_nonspecific)
55 self.assertTrue(siginfo_created, msg="Could not find sstate .siginfo files for: %s" % ', '.join(map(str, targets)))
53 56
54 bitbake(['-ccleansstate'] + targets) 57 bitbake(['-ccleansstate'] + targets)
55 file_tracker_2 = self.search_sstate('|'.join(map(str, targets)), distro_specific, distro_nonspecific) 58 tgz_removed = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific)
56 self.assertTrue(not file_tracker_2) 59 self.assertTrue(not tgz_removed, msg="do_cleansstate didn't remove .tgz sstate files for: %s" % ', '.join(map(str, targets)))
57 60
58 def test_cleansstate_task_distro_specific_nonspecific(self): 61 def test_cleansstate_task_distro_specific_nonspecific(self):
59 self.run_test_cleansstate_task(['binutils-cross', 'binutils-native', 'eglibc-initial'], distro_specific=True, distro_nonspecific=True, temp_sstate_location=True) 62 self.run_test_cleansstate_task(['binutils-cross', 'binutils-native', 'eglibc-initial'], distro_specific=True, distro_nonspecific=True, temp_sstate_location=True)
@@ -72,9 +75,9 @@ class SStateTests(SStateBase):
72 bitbake(['-ccleansstate'] + targets) 75 bitbake(['-ccleansstate'] + targets)
73 76
74 bitbake(targets) 77 bitbake(targets)
75 self.assertTrue(self.search_sstate('|'.join(map(str, targets)), distro_specific=False, distro_nonspecific=True) == [], msg="Found distro non-specific sstate for: %s" % ', '.join(map(str, targets))) 78 self.assertTrue(self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=False, distro_nonspecific=True) == [], msg="Found distro non-specific sstate for: %s" % ', '.join(map(str, targets)))
76 file_tracker_1 = self.search_sstate('|'.join(map(str, targets)), distro_specific=True, distro_nonspecific=False) 79 file_tracker_1 = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False)
77 self.assertTrue(len(file_tracker_1) > len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets))) 80 self.assertTrue(len(file_tracker_1) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets)))
78 81
79 self.track_for_cleanup(self.distro_specific_sstate + "_old") 82 self.track_for_cleanup(self.distro_specific_sstate + "_old")
80 shutil.copytree(self.distro_specific_sstate, self.distro_specific_sstate + "_old") 83 shutil.copytree(self.distro_specific_sstate, self.distro_specific_sstate + "_old")
@@ -82,8 +85,8 @@ class SStateTests(SStateBase):
82 85
83 bitbake(['-cclean'] + targets) 86 bitbake(['-cclean'] + targets)
84 bitbake(targets) 87 bitbake(targets)
85 file_tracker_2 = self.search_sstate('|'.join(map(str, targets)), distro_specific=True, distro_nonspecific=False) 88 file_tracker_2 = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False)
86 self.assertTrue(len(file_tracker_2) > len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets))) 89 self.assertTrue(len(file_tracker_2) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets)))
87 90
88 not_recreated = [x for x in file_tracker_1 if x not in file_tracker_2] 91 not_recreated = [x for x in file_tracker_1 if x not in file_tracker_2]
89 self.assertTrue(not_recreated == [], msg="The following sstate files ware not recreated: %s" % ', '.join(map(str, not_recreated))) 92 self.assertTrue(not_recreated == [], msg="The following sstate files ware not recreated: %s" % ', '.join(map(str, not_recreated)))
@@ -121,18 +124,18 @@ class SStateTests(SStateBase):
121 self.append_config(global_config[idx]) 124 self.append_config(global_config[idx])
122 self.append_recipeinc(target, target_config[idx]) 125 self.append_recipeinc(target, target_config[idx])
123 if target_config[idx] == target_config[-1]: 126 if target_config[idx] == target_config[-1]:
124 target_sstate_before_build = self.search_sstate(target) 127 target_sstate_before_build = self.search_sstate(target + '.*?\.tgz$')
125 bitbake("-cclean %s" % target) 128 bitbake("-cclean %s" % target)
126 result = bitbake(target, ignore_status=True) 129 result = bitbake(target, ignore_status=True)
127 if target_config[idx] == target_config[-1]: 130 if target_config[idx] == target_config[-1]:
128 target_sstate_after_build = self.search_sstate(target) 131 target_sstate_after_build = self.search_sstate(target + '.*?\.tgz$')
129 expected_remaining_sstate += [x for x in target_sstate_after_build if x not in target_sstate_before_build] 132 expected_remaining_sstate += [x for x in target_sstate_after_build if x not in target_sstate_before_build]
130 self.remove_config(global_config[idx]) 133 self.remove_config(global_config[idx])
131 self.remove_recipeinc(target, target_config[idx]) 134 self.remove_recipeinc(target, target_config[idx])
132 self.assertEqual(result.status, 0) 135 self.assertEqual(result.status, 0)
133 136
134 runCmd("sstate-cache-management.sh -y --cache-dir=%s --remove-duplicated" % self.sstate_path) 137 runCmd("sstate-cache-management.sh -y --cache-dir=%s --remove-duplicated" % self.sstate_path)
135 actual_remaining_sstate = self.search_sstate(target) 138 actual_remaining_sstate = self.search_sstate(target + '.*?\.tgz$')
136 139
137 actual_not_expected = [x for x in actual_remaining_sstate if x not in expected_remaining_sstate] 140 actual_not_expected = [x for x in actual_remaining_sstate if x not in expected_remaining_sstate]
138 self.assertFalse(actual_not_expected, msg="Files should have been removed but ware not: %s" % ', '.join(map(str, actual_not_expected))) 141 self.assertFalse(actual_not_expected, msg="Files should have been removed but ware not: %s" % ', '.join(map(str, actual_not_expected)))
@@ -183,4 +186,3 @@ class SStateTests(SStateBase):
183 186
184 187
185 188
186