All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Steve Sakoman" <steve@sakoman.com>
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][dunfell 19/19] oeqa/selftest/archiver: Allow tests to ignore empty directories
Date: Mon,  5 Jul 2021 12:34:56 -1000	[thread overview]
Message-ID: <5581cbfc33e11e05c839e130202ec00f4337d394.1625511812.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1625511812.git.steve@sakoman.com>

From: Richard Purdie <richard.purdie@linuxfoundation.org>

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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 10cda713faea9a348fd278137ac75e4a6d76a71c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/lib/oeqa/selftest/cases/archiver.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/archiver.py b/meta/lib/oeqa/selftest/cases/archiver.py
index bc5447d2a3..6a5c8ec71e 100644
--- a/meta/lib/oeqa/selftest/cases/archiver.py
+++ b/meta/lib/oeqa/selftest/cases/archiver.py
@@ -35,11 +35,11 @@ class Archiver(OESelftestTestCase):
         src_path = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'])
 
         # Check that include_recipe was included
-        included_present = len(glob.glob(src_path + '/%s-*' % include_recipe))
+        included_present = len(glob.glob(src_path + '/%s-*/*' % include_recipe))
         self.assertTrue(included_present, 'Recipe %s was not included.' % include_recipe)
 
         # Check that exclude_recipe was excluded
-        excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe))
+        excluded_present = len(glob.glob(src_path + '/%s-*/*' % exclude_recipe))
         self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % exclude_recipe)
 
     def test_archiver_filters_by_type(self):
@@ -67,11 +67,11 @@ class Archiver(OESelftestTestCase):
         src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS'])
 
         # Check that target_recipe was included
-        included_present = len(glob.glob(src_path_target + '/%s-*' % target_recipe))
+        included_present = len(glob.glob(src_path_target + '/%s-*/*' % target_recipe))
         self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipe)
 
         # Check that native_recipe was excluded
-        excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipe))
+        excluded_present = len(glob.glob(src_path_native + '/%s-*/*' % native_recipe))
         self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipe)
 
     def test_archiver_filters_by_type_and_name(self):
@@ -104,17 +104,17 @@ class Archiver(OESelftestTestCase):
         src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS'])
 
         # Check that target_recipe[0] and native_recipes[1] were included
-        included_present = len(glob.glob(src_path_target + '/%s-*' % target_recipes[0]))
+        included_present = len(glob.glob(src_path_target + '/%s-*/*' % target_recipes[0]))
         self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipes[0])
 
-        included_present = len(glob.glob(src_path_native + '/%s-*' % native_recipes[1]))
+        included_present = len(glob.glob(src_path_native + '/%s-*/*' % native_recipes[1]))
         self.assertTrue(included_present, 'Recipe %s was not included.' % native_recipes[1])
 
         # Check that native_recipes[0] and target_recipes[1] were excluded
-        excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipes[0]))
+        excluded_present = len(glob.glob(src_path_native + '/%s-*/*' % native_recipes[0]))
         self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipes[0])
 
-        excluded_present = len(glob.glob(src_path_target + '/%s-*' % target_recipes[1]))
+        excluded_present = len(glob.glob(src_path_target + '/%s-*/*' % target_recipes[1]))
         self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % target_recipes[1])
 
 
-- 
2.25.1


      parent reply	other threads:[~2021-07-05 22:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 22:34 [OE-core][dunfell 00/19] Patch review Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 01/19] python3: skip tests requiring tools-sdk Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 02/19] python3: apply test skipping patch unconditionally Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 03/19] rpm: fix CVE-2021-3421 Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 04/19] gstreamer-plugins-base: fix CVE-2021-3522 Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 05/19] linux-yocto/5.4: update to v5.4.124 Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 06/19] linux-yocto/5.4: update to v5.4.125 Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 07/19] linux-yocto/5.4: update to v5.4.128 Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 08/19] linux-yocto/5.4: update to v5.4.129 Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 09/19] kernel: Fix interaction when packaging disabled Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 10/19] kernel-devicetree: " Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 11/19] selftest: do not hardcode /tmp/sdk Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 12/19] perf: Use python3targetconfig to ensure we use target libraries Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 13/19] pypi: set SRC_URI with _prepend, not with += Steve Sakoman
2021-07-06  8:30   ` Martin Jansa
2021-07-06  8:41     ` Khem Raj
2021-07-06 14:16     ` Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 14/19] package_pkgdata: Avoid task hash mismatches for generic task changes Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 15/19] sstate.bbclass: fix errors about read-only sstate mirrors Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 16/19] oeqa/selftest/runcmd: Tweal test timeouts Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 17/19] sstate/staging: Handle directory creation race issue Steve Sakoman
2021-07-05 22:34 ` [OE-core][dunfell 18/19] devtool: deploy-target: Fix preserving attributes when using --strip Steve Sakoman
2021-07-05 22:34 ` Steve Sakoman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5581cbfc33e11e05c839e130202ec00f4337d394.1625511812.git.steve@sakoman.com \
    --to=steve@sakoman.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.