From ece1a46d483486293c46d2f6dd13ba8532b0b38a Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Thu, 10 May 2018 10:44:24 +0100 Subject: Generate device configuration from templates LAVA-1319 - Remove static YAML files and replace with device configuration generated from current Jinja2 templates. Change-Id: I2a078a6aa00d8385780515167630aa3d526f7fa8 --- lava_dispatcher/test/test_uboot_ums.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'lava_dispatcher/test/test_uboot_ums.py') 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 . -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) -- cgit v1.2.3