All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] oe-selftest: devtool: fix test for changes in lzo recipe
@ 2017-12-07 10:03 Paul Eggleton
  2017-12-07 10:03 ` [PATCH v2 1/1] " Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2017-12-07 10:03 UTC (permalink / raw)
  To: openembedded-core

A fix for one of the devtool oe-selftest tests to handle Ross's lzo
acinclude.m4 fix.

Changes since v1:
* Some uncommitted changes to the test recipe got wiped out by the bit at
  the end of the test that resets the test changes, hence the checksums
  were missing from the recipe - add the missing stuff back n.
* Add a check to ensure there's no uncommitted changes before proceeding
  with the test (as per other tests that have this resetting)

The following changes since commit a7cd9d1183be603777fc9c8c448281fe01224f7b:

  lib/oe/utils: remove param_bool() (2017-12-02 11:24:38 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/devtool-selftest-fix
  http://cgit.openembedded.org/openembedded-core-contrib/log/?h=paule/devtool-selftest-fix

Paul Eggleton (1):
  oe-selftest: devtool: fix test for changes in lzo recipe

 .../recipes-test/devtool/devtool-test-local/file1        |  1 +
 .../recipes-test/devtool/devtool-test-local/file2        |  1 +
 .../recipes-test/devtool/devtool-test-local_6.03.bb      | 15 +++++++++++++++
 meta/lib/oeqa/selftest/cases/devtool.py                  | 16 ++++++++++------
 4 files changed, 27 insertions(+), 6 deletions(-)
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-local/file1
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-local/file2
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb

-- 
2.9.5



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH v2 1/1] oe-selftest: devtool: fix test for changes in lzo recipe
  2017-12-07 10:03 [PATCH v2 0/1] oe-selftest: devtool: fix test for changes in lzo recipe Paul Eggleton
@ 2017-12-07 10:03 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2017-12-07 10:03 UTC (permalink / raw)
  To: openembedded-core

acinclude.m4 is about to be removed from the lzo recipe which breaks
test_devtool_update_recipe_local_files_2. Create a synthetic recipe in
meta-selftest with some local files and use that instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 .../recipes-test/devtool/devtool-test-local/file1        |  1 +
 .../recipes-test/devtool/devtool-test-local/file2        |  1 +
 .../recipes-test/devtool/devtool-test-local_6.03.bb      | 15 +++++++++++++++
 meta/lib/oeqa/selftest/cases/devtool.py                  | 16 ++++++++++------
 4 files changed, 27 insertions(+), 6 deletions(-)
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-local/file1
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-local/file2
 create mode 100644 meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb

diff --git a/meta-selftest/recipes-test/devtool/devtool-test-local/file1 b/meta-selftest/recipes-test/devtool/devtool-test-local/file1
new file mode 100644
index 0000000..f4bdcfc
--- /dev/null
+++ b/meta-selftest/recipes-test/devtool/devtool-test-local/file1
@@ -0,0 +1 @@
+The first file
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-local/file2 b/meta-selftest/recipes-test/devtool/devtool-test-local/file2
new file mode 100644
index 0000000..a7e2414
--- /dev/null
+++ b/meta-selftest/recipes-test/devtool/devtool-test-local/file2
@@ -0,0 +1 @@
+The second file
diff --git a/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb b/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb
new file mode 100644
index 0000000..6bfc557
--- /dev/null
+++ b/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb
@@ -0,0 +1,15 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/syslinux-${PV}.tar.xz \
+           file://file1 \
+           file://file2"
+
+SRC_URI[md5sum] = "92a253df9211e9c20172796ecf388f13"
+SRC_URI[sha256sum] = "26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e"
+
+S = "${WORKDIR}/syslinux-${PV}"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 43280cd..8a1e685 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -987,8 +987,12 @@ class DevtoolTests(DevtoolBase):
     @OETestID(1371)
     def test_devtool_update_recipe_local_files_2(self):
         """Check local source files support when oe-local-files is in Git"""
-        testrecipe = 'lzo'
+        testrecipe = 'devtool-test-local'
         recipefile = get_bb_var('FILE', testrecipe)
+        recipedir = os.path.dirname(recipefile)
+        result = runCmd('git status --porcelain .', cwd=recipedir)
+        if result.output.strip():
+            self.fail('Recipe directory for %s contains uncommitted changes' % testrecipe)
         # Setup srctree for modifying the recipe
         tempdir = tempfile.mkdtemp(prefix='devtoolqa')
         self.track_for_cleanup(tempdir)
@@ -1002,9 +1006,9 @@ class DevtoolTests(DevtoolBase):
         runCmd('git add oe-local-files', cwd=tempdir)
         runCmd('git commit -m "Add local sources"', cwd=tempdir)
         # Edit / commit local sources
-        runCmd('echo "# Foobar" >> oe-local-files/acinclude.m4', cwd=tempdir)
+        runCmd('echo "# Foobar" >> oe-local-files/file1', cwd=tempdir)
         runCmd('git commit -am "Edit existing file"', cwd=tempdir)
-        runCmd('git rm oe-local-files/run-ptest', cwd=tempdir)
+        runCmd('git rm oe-local-files/file2', cwd=tempdir)
         runCmd('git commit -m"Remove file"', cwd=tempdir)
         runCmd('echo "Foo" > oe-local-files/new-local', cwd=tempdir)
         runCmd('git add oe-local-files/new-local', cwd=tempdir)
@@ -1016,11 +1020,11 @@ class DevtoolTests(DevtoolBase):
                                      os.path.dirname(recipefile))
         # Checkout unmodified file to working copy -> devtool should still pick
         # the modified version from HEAD
-        runCmd('git checkout HEAD^ -- oe-local-files/acinclude.m4', cwd=tempdir)
+        runCmd('git checkout HEAD^ -- oe-local-files/file1', cwd=tempdir)
         runCmd('devtool update-recipe %s' % testrecipe)
         expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
-                           (' M', '.*/acinclude.m4$'),
-                           (' D', '.*/run-ptest$'),
+                           (' M', '.*/file1$'),
+                           (' D', '.*/file2$'),
                            ('??', '.*/new-local$'),
                            ('??', '.*/0001-Add-new-file.patch$')]
         self._check_repo_status(os.path.dirname(recipefile), expected_status)
-- 
2.9.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-07 10:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-07 10:03 [PATCH v2 0/1] oe-selftest: devtool: fix test for changes in lzo recipe Paul Eggleton
2017-12-07 10:03 ` [PATCH v2 1/1] " Paul Eggleton

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.