summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
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-20 19:05:45 +0100
commit2566c5c5e09b0ad90fbd25ded046cff0480f9707 (patch)
treefac6558f5d61366717f0282646343e3f96a94a81 /meta/lib/oeqa
parentd33ab0d50d89b462763c041fae44cd301bc5a003 (diff)
downloadpoky-2566c5c5e09b0ad90fbd25ded046cff0480f9707.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: 373f7c92bab1c08fb895c55553f28539d0b45025) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 10cda713faea9a348fd278137ac75e4a6d76a71c) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-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