summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-01 16:29:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-02 07:24:21 +0100
commit07630f3cfd4ec19fb33c9423786512ebce84b254 (patch)
treec2608f6e6d845c2efcb16e0578c73bb7e5f117f8
parent73efc71b2c31a00ea873c32cb24eef95aa2c49c1 (diff)
downloadpoky-07630f3cfd4ec19fb33c9423786512ebce84b254.tar.gz
oeqa/selftest/archiver: Allow tests to ignore empty directories
If we tweak sstate to not remove empty directories under conditions where a race could occur, we see failures from: "oe-selftest -r archiver.Archiver.test_archiver_filters_by_type archiver.Archiver.test_archiver_filters_by_type_and_name" since an empty directory is left behind. Update the tests to ignore empty directories. (From OE-Core rev: 10cda713faea9a348fd278137ac75e4a6d76a71c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/archiver.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/meta/lib/oeqa/selftest/cases/archiver.py b/meta/lib/oeqa/selftest/cases/archiver.py
index ddd08ecf84..0194ae9f69 100644
--- a/meta/lib/oeqa/selftest/cases/archiver.py
+++ b/meta/lib/oeqa/selftest/cases/archiver.py
@@ -35,11 +35,11 @@ class Archiver(OESelftestTestCase):
35 src_path = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS']) 35 src_path = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'])
36 36
37 # Check that include_recipe was included 37 # Check that include_recipe was included
38 included_present = len(glob.glob(src_path + '/%s-*' % include_recipe)) 38 included_present = len(glob.glob(src_path + '/%s-*/*' % include_recipe))
39 self.assertTrue(included_present, 'Recipe %s was not included.' % include_recipe) 39 self.assertTrue(included_present, 'Recipe %s was not included.' % include_recipe)
40 40
41 # Check that exclude_recipe was excluded 41 # Check that exclude_recipe was excluded
42 excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe)) 42 excluded_present = len(glob.glob(src_path + '/%s-*/*' % exclude_recipe))
43 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % exclude_recipe) 43 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % exclude_recipe)
44 44
45 def test_archiver_filters_by_type(self): 45 def test_archiver_filters_by_type(self):
@@ -67,11 +67,11 @@ class Archiver(OESelftestTestCase):
67 src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS']) 67 src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS'])
68 68
69 # Check that target_recipe was included 69 # Check that target_recipe was included
70 included_present = len(glob.glob(src_path_target + '/%s-*' % target_recipe)) 70 included_present = len(glob.glob(src_path_target + '/%s-*/*' % target_recipe))
71 self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipe) 71 self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipe)
72 72
73 # Check that native_recipe was excluded 73 # Check that native_recipe was excluded
74 excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipe)) 74 excluded_present = len(glob.glob(src_path_native + '/%s-*/*' % native_recipe))
75 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipe) 75 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipe)
76 76
77 def test_archiver_filters_by_type_and_name(self): 77 def test_archiver_filters_by_type_and_name(self):
@@ -104,17 +104,17 @@ class Archiver(OESelftestTestCase):
104 src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS']) 104 src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS'])
105 105
106 # Check that target_recipe[0] and native_recipes[1] were included 106 # Check that target_recipe[0] and native_recipes[1] were included
107 included_present = len(glob.glob(src_path_target + '/%s-*' % target_recipes[0])) 107 included_present = len(glob.glob(src_path_target + '/%s-*/*' % target_recipes[0]))
108 self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipes[0]) 108 self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipes[0])
109 109
110 included_present = len(glob.glob(src_path_native + '/%s-*' % native_recipes[1])) 110 included_present = len(glob.glob(src_path_native + '/%s-*/*' % native_recipes[1]))
111 self.assertTrue(included_present, 'Recipe %s was not included.' % native_recipes[1]) 111 self.assertTrue(included_present, 'Recipe %s was not included.' % native_recipes[1])
112 112
113 # Check that native_recipes[0] and target_recipes[1] were excluded 113 # Check that native_recipes[0] and target_recipes[1] were excluded
114 excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipes[0])) 114 excluded_present = len(glob.glob(src_path_native + '/%s-*/*' % native_recipes[0]))
115 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipes[0]) 115 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipes[0])
116 116
117 excluded_present = len(glob.glob(src_path_target + '/%s-*' % target_recipes[1])) 117 excluded_present = len(glob.glob(src_path_target + '/%s-*/*' % target_recipes[1]))
118 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % target_recipes[1]) 118 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % target_recipes[1])
119 119
120 120