diff mbox

[Branch,~linaro-maintainers/linaro-image-tools/trunk] Rev 257: Merge lp:~lool/linaro-image-tools/fix-vexpress-lp-705569.

Message ID 20110125120433.22528.52775.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Loïc Minier Jan. 25, 2011, 12:04 p.m. UTC
Merge authors:
  Loïc Minier (lool)
Related merge proposals:
  https://code.launchpad.net/~lool/linaro-image-tools/fix-vexpress-lp-705569/+merge/47136
  proposed by: Loïc Minier (lool)
  review: Approve - Guilherme Salgado (salgado)
  review: Needs Information - James Westby (james-w)
------------------------------------------------------------
revno: 257 [merge]
committer: Loïc Minier <lool@dooz.org>
branch nick: linaro-image-tools
timestamp: Tue 2011-01-25 13:02:38 +0100
message:
  Merge lp:~lool/linaro-image-tools/fix-vexpress-lp-705569.
modified:
  linaro_media_create/boards.py
  linaro_media_create/tests/test_media_create.py


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro_media_create/boards.py'
--- linaro_media_create/boards.py	2011-01-24 21:08:41 +0000
+++ linaro_media_create/boards.py	2011-01-25 12:02:38 +0000
@@ -221,7 +221,7 @@ 
 
     @classmethod
     def _make_boot_files(cls, uboot_parts_dir, boot_cmd, chroot_dir,
-                         boot_dir, boot_script):
+                         boot_dir, boot_script, boot_device_or_file):
         make_uImage(
             cls.load_addr, uboot_parts_dir, cls.kernel_suffix, boot_dir)
         make_uInitrd(uboot_parts_dir, cls.kernel_suffix, boot_dir)

=== modified file 'linaro_media_create/tests/test_media_create.py'
--- linaro_media_create/tests/test_media_create.py	2011-01-24 19:39:45 +0000
+++ linaro_media_create/tests/test_media_create.py	2011-01-25 12:02:38 +0000
@@ -7,6 +7,7 @@ 
 import sys
 import tempfile
 import time
+import types
 
 from testtools import TestCase
 
@@ -20,6 +21,7 @@ 
     rootfs,
     utils,
     )
+import linaro_media_create
 from linaro_media_create.boards import (
     board_configs,
     make_boot_script,
@@ -151,6 +153,70 @@ 
         self.assertRaises(
             AssertionError, _get_mlo_file, tempdir)
 
+class TestBootSteps(TestCaseWithFixtures):
+    def setUp(self):
+        super(TestBootSteps, self).setUp()
+        self.funcs_calls = []
+        self.mock_all_boards_funcs()
+
+    def mock_all_boards_funcs(self):
+        """Mock all functions of linaro_media_create.boards with a call tracer."""
+
+        def mock_func_creator(name):
+            return lambda *args, **kwargs: self.funcs_calls.append(name)
+
+        for name in dir(linaro_media_create.boards):
+            attr = getattr(linaro_media_create.boards, name)
+            if type(attr) == types.FunctionType:
+                self.useFixture(MockSomethingFixture(
+                    linaro_media_create.boards, name, mock_func_creator(name)))
+
+    def make_boot_files(self, config):
+        config.make_boot_files('', False, False, [], '', '', '', '')
+
+    def test_vexpress_steps(self):
+        config = linaro_media_create.boards.VexpressConfig
+        self.make_boot_files(config)
+        expected = ['make_uImage', 'make_uInitrd']
+        self.assertEqual(expected, self.funcs_calls)
+
+    def test_mx51evk_steps(self):
+        config = linaro_media_create.boards.Mx51evkConfig
+        self.make_boot_files(config)
+        expected = [
+            'install_mx51evk_boot_loader', 'make_uImage', 'make_uInitrd',
+            'make_boot_script']
+        self.assertEqual(expected, self.funcs_calls)
+
+    def test_ux500_steps(self):
+        config = linaro_media_create.boards.Ux500Config
+        self.make_boot_files(config)
+        expected = ['make_uImage', 'make_uInitrd', 'make_boot_script']
+        self.assertEqual(expected, self.funcs_calls)
+
+    def test_panda_steps(self):
+        config = linaro_media_create.boards.PandaConfig
+        self.make_boot_files(config)
+        expected = [
+            'install_omap_boot_loader', 'make_uImage', 'make_uInitrd',
+            'make_boot_script', 'make_boot_ini']
+        self.assertEqual(expected, self.funcs_calls)
+
+    def test_beagle_steps(self):
+        config = linaro_media_create.boards.BeagleConfig
+        self.make_boot_files(config)
+        expected = [
+            'install_omap_boot_loader', 'make_uImage', 'make_uInitrd',
+            'make_boot_script', 'make_boot_ini']
+        self.assertEqual(expected, self.funcs_calls)
+
+    def test_overo_steps(self):
+        config = linaro_media_create.boards.OveroConfig
+        self.make_boot_files(config)
+        expected = [
+            'install_omap_boot_loader', 'make_uImage', 'make_uInitrd',
+            'make_boot_script', 'make_boot_ini']
+        self.assertEqual(expected, self.funcs_calls)
 
 class TestGetBootCmd(TestCase):