* [PATCH 0/1] Extend oeqa tests for archiver.bbclass
@ 2019-11-11 14:16 Paul Barker
2019-11-11 14:16 ` [PATCH 1/1] oeqa: archiver: Add basic tests for all archiver modes Paul Barker
0 siblings, 1 reply; 3+ messages in thread
From: Paul Barker @ 2019-11-11 14:16 UTC (permalink / raw)
To: openembedded-core
In preparation for adding the new mirror archiver mode I've added a
bunch of additional oeqa tests for the archiver bblass. I'm submitting
these separately first as this is the first time I've done anything
with oeqa and things may need a little rework.
The tests use the selftest-ed recipe from the meta-selftest recipe so I
assume they can rely on the version number and source file name not
changing.
Paul Barker (1):
oeqa: archiver: Add basic tests for all archiver modes
meta/lib/oeqa/selftest/cases/archiver.py | 66 ++++++++++++++++++++++++
1 file changed, 66 insertions(+)
--
2.24.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] oeqa: archiver: Add basic tests for all archiver modes
2019-11-11 14:16 [PATCH 0/1] Extend oeqa tests for archiver.bbclass Paul Barker
@ 2019-11-11 14:16 ` Paul Barker
2019-11-25 8:29 ` Paul Barker
0 siblings, 1 reply; 3+ messages in thread
From: Paul Barker @ 2019-11-11 14:16 UTC (permalink / raw)
To: openembedded-core
6 new test cases are added to cover the various archiver modes
documented at the top of archiver.bbclass. Each test sets the
appropriate configuration options, runs the `do_deploy_archives` task
for the selftest-ed recipe and checks for the presence of the expected
archive file.
Signed-off-by: Paul Barker <paul@betafive.co.uk>
---
meta/lib/oeqa/selftest/cases/archiver.py | 66 ++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/meta/lib/oeqa/selftest/cases/archiver.py b/meta/lib/oeqa/selftest/cases/archiver.py
index f8672f8abb..6bd0e06ec4 100644
--- a/meta/lib/oeqa/selftest/cases/archiver.py
+++ b/meta/lib/oeqa/selftest/cases/archiver.py
@@ -129,3 +129,69 @@ class Archiver(OESelftestTestCase):
self.write_config(features)
bitbake('-n core-image-sato')
+
+ def _test_archiver_mode(self, mode, target_file_name, extra_config=None):
+ target = "selftest-ed"
+
+ features = 'INHERIT += "archiver"\n'
+ features += 'ARCHIVER_MODE[src] = "%s"\n' % (mode)
+ if extra_config:
+ features += extra_config
+ self.write_config(features)
+
+ bitbake('-c clean %s' % (target))
+ bitbake('-c deploy_archives %s' % (target))
+
+ bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS'])
+ glob_str = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'], '%s-*' % (target))
+ glob_result = glob.glob(glob_str)
+ self.assertTrue(glob_result, 'Missing archiver directory for %s' % (target))
+
+ archive_path = os.path.join(glob_result[0], target_file_name)
+ self.assertTrue(os.path.exists(archive_path), 'Missing archive file %s' % (target_file_name))
+
+ def test_archiver_mode_original(self):
+ """
+ Test that the archiver works in with `ARCHIVER_MODE[src] = "original"`.
+ """
+
+ self._test_archiver_mode('original', 'ed-1.14.1.tar.lz')
+
+ def test_archiver_mode_patched(self):
+ """
+ Test that the archiver works in with `ARCHIVER_MODE[src] = "patched"`.
+ """
+
+ self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-patched.tar.gz')
+
+ def test_archiver_mode_configured(self):
+ """
+ Test that the archiver works in with `ARCHIVER_MODE[src] = "configured"`.
+ """
+
+ self._test_archiver_mode('configured', 'selftest-ed-1.14.1-r0-configured.tar.gz')
+
+ def test_archiver_mode_recipe(self):
+ """
+ Test that the archiver works in with `ARCHIVER_MODE[recipe] = "1"`.
+ """
+
+ self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-recipe.tar.gz',
+ 'ARCHIVER_MODE[recipe] = "1"\n')
+
+ def test_archiver_mode_diff(self):
+ """
+ Test that the archiver works in with `ARCHIVER_MODE[diff] = "1"`.
+ Exclusions controlled by `ARCHIVER_MODE[diff-exclude]` are not yet tested.
+ """
+
+ self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-diff.gz',
+ 'ARCHIVER_MODE[diff] = "1"\n')
+
+ def test_archiver_mode_dumpdata(self):
+ """
+ Test that the archiver works in with `ARCHIVER_MODE[dumpdata] = "1"`.
+ """
+
+ self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-showdata.dump',
+ 'ARCHIVER_MODE[dumpdata] = "1"\n')
--
2.24.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] oeqa: archiver: Add basic tests for all archiver modes
2019-11-11 14:16 ` [PATCH 1/1] oeqa: archiver: Add basic tests for all archiver modes Paul Barker
@ 2019-11-25 8:29 ` Paul Barker
0 siblings, 0 replies; 3+ messages in thread
From: Paul Barker @ 2019-11-25 8:29 UTC (permalink / raw)
To: OE Core
Ping on this, it hasn't been accepted yet but also hasn't had any review.
On Mon, 11 Nov 2019, at 14:16, Paul Barker wrote:
> 6 new test cases are added to cover the various archiver modes
> documented at the top of archiver.bbclass. Each test sets the
> appropriate configuration options, runs the `do_deploy_archives` task
> for the selftest-ed recipe and checks for the presence of the expected
> archive file.
>
> Signed-off-by: Paul Barker <paul@betafive.co.uk>
> ---
> meta/lib/oeqa/selftest/cases/archiver.py | 66 ++++++++++++++++++++++++
> 1 file changed, 66 insertions(+)
>
> diff --git a/meta/lib/oeqa/selftest/cases/archiver.py
> b/meta/lib/oeqa/selftest/cases/archiver.py
> index f8672f8abb..6bd0e06ec4 100644
> --- a/meta/lib/oeqa/selftest/cases/archiver.py
> +++ b/meta/lib/oeqa/selftest/cases/archiver.py
> @@ -129,3 +129,69 @@ class Archiver(OESelftestTestCase):
> self.write_config(features)
>
> bitbake('-n core-image-sato')
> +
> + def _test_archiver_mode(self, mode, target_file_name,
> extra_config=None):
> + target = "selftest-ed"
> +
> + features = 'INHERIT += "archiver"\n'
> + features += 'ARCHIVER_MODE[src] = "%s"\n' % (mode)
> + if extra_config:
> + features += extra_config
> + self.write_config(features)
> +
> + bitbake('-c clean %s' % (target))
> + bitbake('-c deploy_archives %s' % (target))
> +
> + bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS'])
> + glob_str = os.path.join(bb_vars['DEPLOY_DIR_SRC'],
> bb_vars['TARGET_SYS'], '%s-*' % (target))
> + glob_result = glob.glob(glob_str)
> + self.assertTrue(glob_result, 'Missing archiver directory for
> %s' % (target))
> +
> + archive_path = os.path.join(glob_result[0], target_file_name)
> + self.assertTrue(os.path.exists(archive_path), 'Missing archive
> file %s' % (target_file_name))
> +
> + def test_archiver_mode_original(self):
> + """
> + Test that the archiver works in with `ARCHIVER_MODE[src] =
> "original"`.
> + """
> +
> + self._test_archiver_mode('original', 'ed-1.14.1.tar.lz')
> +
> + def test_archiver_mode_patched(self):
> + """
> + Test that the archiver works in with `ARCHIVER_MODE[src] =
> "patched"`.
> + """
> +
> + self._test_archiver_mode('patched',
> 'selftest-ed-1.14.1-r0-patched.tar.gz')
> +
> + def test_archiver_mode_configured(self):
> + """
> + Test that the archiver works in with `ARCHIVER_MODE[src] =
> "configured"`.
> + """
> +
> + self._test_archiver_mode('configured',
> 'selftest-ed-1.14.1-r0-configured.tar.gz')
> +
> + def test_archiver_mode_recipe(self):
> + """
> + Test that the archiver works in with `ARCHIVER_MODE[recipe] =
> "1"`.
> + """
> +
> + self._test_archiver_mode('patched',
> 'selftest-ed-1.14.1-r0-recipe.tar.gz',
> + 'ARCHIVER_MODE[recipe] = "1"\n')
> +
> + def test_archiver_mode_diff(self):
> + """
> + Test that the archiver works in with `ARCHIVER_MODE[diff] =
> "1"`.
> + Exclusions controlled by `ARCHIVER_MODE[diff-exclude]` are not
> yet tested.
> + """
> +
> + self._test_archiver_mode('patched',
> 'selftest-ed-1.14.1-r0-diff.gz',
> + 'ARCHIVER_MODE[diff] = "1"\n')
> +
> + def test_archiver_mode_dumpdata(self):
> + """
> + Test that the archiver works in with `ARCHIVER_MODE[dumpdata]
> = "1"`.
> + """
> +
> + self._test_archiver_mode('patched',
> 'selftest-ed-1.14.1-r0-showdata.dump',
> + 'ARCHIVER_MODE[dumpdata] = "1"\n')
> --
> 2.24.0
>
>
--
Paul Barker
Managing Director & Principal Engineer
Beta Five Ltd
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-25 8:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 14:16 [PATCH 0/1] Extend oeqa tests for archiver.bbclass Paul Barker
2019-11-11 14:16 ` [PATCH 1/1] oeqa: archiver: Add basic tests for all archiver modes Paul Barker
2019-11-25 8:29 ` Paul Barker
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.