All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-yocto-bsp][PATCH 0/1] Restore gummiboot tests
@ 2015-07-28 10:19 Paul Eggleton
  2015-07-28 10:19 ` [meta-yocto-bsp][PATCH 1/1] oe-selftest: restore " Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2015-07-28 10:19 UTC (permalink / raw)
  To: poky

The following changes since commit 1b88b7426a3c5e3b4427501e67df141b0ee17934:

  bitbake: build: Exit scripts with result of last shell function (2015-07-27 23:29:16 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib paule/oe-selftest-gummiboot
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/oe-selftest-gummiboot

Paul Eggleton (1):
  oe-selftest: restore gummiboot tests

 meta-yocto-bsp/lib/oeqa/selftest/__init__.py  |  0
 meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py | 83 +++++++++++++++++++++++++++
 2 files changed, 83 insertions(+)
 create mode 100644 meta-yocto-bsp/lib/oeqa/selftest/__init__.py
 create mode 100644 meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py

-- 
2.1.0



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

* [meta-yocto-bsp][PATCH 1/1] oe-selftest: restore gummiboot tests
  2015-07-28 10:19 [meta-yocto-bsp][PATCH 0/1] Restore gummiboot tests Paul Eggleton
@ 2015-07-28 10:19 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2015-07-28 10:19 UTC (permalink / raw)
  To: poky

These are the gummiboot tests recently removed from OE-Core, with the
following changes:

* Make them use MACHINE = "genericx86-64" instead of "nuc" and remove
  all usage of meta-intel

* Use DEPLOY_DIR instead of assuming build directory will be in the
  default path relative to COREBASE

* Fix build test to actually check if the file was created as part of
  the test instead of possibly being around from a previous build

* Fix wic test to actually check the output to find the name of the
  .direct file that wic has created, instead of passing if any .direct
  file happens to exist in /var/tmp/wic

(We can now add these in this layer courtesy of Chris Larson's OE-Core
commit 182b8ed9f26ed8b6a8eb6dcaec82db9aca14b010).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta-yocto-bsp/lib/oeqa/selftest/__init__.py  |  0
 meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py | 83 +++++++++++++++++++++++++++
 2 files changed, 83 insertions(+)
 create mode 100644 meta-yocto-bsp/lib/oeqa/selftest/__init__.py
 create mode 100644 meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py

diff --git a/meta-yocto-bsp/lib/oeqa/selftest/__init__.py b/meta-yocto-bsp/lib/oeqa/selftest/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py b/meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py
new file mode 100644
index 0000000..00aa36f
--- /dev/null
+++ b/meta-yocto-bsp/lib/oeqa/selftest/gummiboot.py
@@ -0,0 +1,83 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+from oeqa.utils.decorators import testcase
+import re
+import os
+import sys
+import logging
+
+
+class Gummiboot(oeSelfTest):
+
+    def _common_setup(self):
+        """
+        Common setup for test cases: 1101, 1103
+        """
+
+        # Set EFI_PROVIDER = "gummiboot" and MACHINE = "genericx86-64" in conf/local.conf
+        features = 'EFI_PROVIDER = "gummiboot"\n'
+        features += 'MACHINE = "genericx86-64"'
+        self.append_config(features)
+
+    def _common_build(self):
+        """
+        Common build for test cases: 1101, 1103
+        """
+
+        # Build a genericx86-64/efi gummiboot image
+        bitbake('syslinux syslinux-native parted-native dosfstools-native mtools-native core-image-minimal')
+
+
+    @testcase(1101)
+    def test_efi_gummiboot_images_can_be_built(self):
+        """
+        Summary:     Check if efi/gummiboot images can be built
+        Expected:    1. File gummibootx64.efi should be available in build/tmp/deploy/images/genericx86-64
+                     2. Efi/gummiboot images can be built
+        Product:     oe-core
+        Author:      Ionut Chisanovici <ionutx.chisanovici@intel.com>
+        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        """
+
+        # We'd use DEPLOY_DIR_IMAGE here, except that we need its value for
+        # MACHINE="genericx86-64 which is probably not the one configured
+        gummibootfile = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 'genericx86-64', 'gummibootx64.efi')
+
+        self._common_setup()
+
+        # Ensure we're actually testing that this gets built and not that
+        # it was around from an earlier build
+        bitbake('-c cleansstate gummiboot')
+        runCmd('rm -f %s' % gummibootfile)
+
+        self._common_build()
+
+        found = os.path.isfile(gummibootfile)
+        self.assertTrue(found, 'Gummiboot file %s not found' % gummibootfile)
+
+    @testcase(1103)
+    def test_wic_command_can_create_efi_gummiboot_installation_images(self):
+        """
+        Summary:     Check that wic command can create efi/gummiboot installation images
+        Expected:    A .direct file in folder /var/tmp/wic/ must be created.
+        Product:     oe-core
+        Author:      Ionut Chisanovici <ionutx.chisanovici@intel.com>
+        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        """
+
+        self._common_setup()
+        self._common_build()
+
+        # Create efi/gummiboot installation images
+        wic_create_cmd = 'wic create mkgummidisk -e core-image-minimal'
+        result = runCmd(wic_create_cmd)
+
+        # Find file written by wic from output
+        res = re.search('(/var/tmp/wic/.*\.direct)', result.output)
+        if res:
+            direct_file = res.group(1)
+            # Check it actually exists
+            if not os.path.exists(direct_file):
+                self.fail('wic reported direct file "%s" does not exist; wic output:\n%s' % (direct_file, result.output))
+        else:
+            self.fail('No .direct file reported in wic output:\n%s' % result.output)
-- 
2.1.0



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

end of thread, other threads:[~2015-07-28 10:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-28 10:19 [meta-yocto-bsp][PATCH 0/1] Restore gummiboot tests Paul Eggleton
2015-07-28 10:19 ` [meta-yocto-bsp][PATCH 1/1] oe-selftest: restore " 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.