aboutsummaryrefslogtreecommitdiff
path: root/lava_dispatcher/test/test_uboot_ums.py
diff options
context:
space:
mode:
authorNeil Williams <neil.williams@linaro.org>2018-05-10 10:44:24 +0100
committerNeil Williams <neil.williams@linaro.org>2018-05-14 15:52:12 +0100
commitece1a46d483486293c46d2f6dd13ba8532b0b38a (patch)
treeb4f6f3c6082e2d43ba17ac73bba26b41cf8fe974 /lava_dispatcher/test/test_uboot_ums.py
parente2d0f4b36c6c80358be666b75dd138344fe3cd72 (diff)
Generate device configuration from templates
LAVA-1319 - Remove static YAML files and replace with device configuration generated from current Jinja2 templates. Change-Id: I2a078a6aa00d8385780515167630aa3d526f7fa8
Diffstat (limited to 'lava_dispatcher/test/test_uboot_ums.py')
-rw-r--r--lava_dispatcher/test/test_uboot_ums.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/lava_dispatcher/test/test_uboot_ums.py b/lava_dispatcher/test/test_uboot_ums.py
index a6e487ffb..55dbbee55 100644
--- a/lava_dispatcher/test/test_uboot_ums.py
+++ b/lava_dispatcher/test/test_uboot_ums.py
@@ -18,12 +18,9 @@
# along
# with this program; if not, see <http://www.gnu.org/licenses>.
-import os
import unittest
-from lava_dispatcher.device import NewDevice
-from lava_dispatcher.parser import JobParser
from lava_dispatcher.test.test_basic import Factory, StdoutTestCase
-from lava_dispatcher.test.utils import DummyLogger, infrastructure_error
+from lava_dispatcher.test.utils import infrastructure_error
class UBootUMSFactory(Factory): # pylint: disable=too-few-public-methods
@@ -32,14 +29,8 @@ class UBootUMSFactory(Factory): # pylint: disable=too-few-public-methods
Factory objects are dispatcher based classes, independent
of any database objects.
"""
- def create_warp7_job(self, filename): # pylint: disable=no-self-use
- device = NewDevice(os.path.join(os.path.dirname(__file__), '../devices/imx7s-warp-01.yaml'))
- bbb_yaml = os.path.join(os.path.dirname(__file__), filename)
- with open(bbb_yaml) as sample_job_data:
- parser = JobParser()
- job = parser.parse(sample_job_data, device, 4212, None, "")
- job.logger = DummyLogger()
- return job
+ def create_warp7_job(self, filename):
+ return self.create_job('imx7s-warp-01.jinja2', filename)
class TestUbootUMSAction(StdoutTestCase): # pylint: disable=too-many-public-methods
@@ -62,4 +53,4 @@ class TestUbootUMSAction(StdoutTestCase): # pylint: disable=too-many-public-met
retry = [action for action in uboot.internal_pipeline.actions if action.name == 'uboot-retry'][0]
flash = [action for action in retry.internal_pipeline.actions if action.name == 'flash-uboot-ums'][0]
self.assertEqual("ums", flash.parameters['commands'])
- self.assertEqual("/dev/vde", flash.usb_mass_device)
+ self.assertEqual("/dev/disk/by-id/usb-Linux_UMS_disk_0_WaRP7-0x742400d3000000e6-0:0", flash.usb_mass_device)