本文整理汇总了Python中lava_dispatcher.action.Pipeline类的典型用法代码示例。如果您正苦于以下问题:Python Pipeline类的具体用法?Python Pipeline怎么用?Python Pipeline使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Pipeline类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _make_pipeline
def _make_pipeline(self, params):
pipeline = Pipeline()
auto_login = AutoLoginAction()
auto_login.section = "internal"
auto_login.parameters = params
pipeline.add_action(auto_login)
return pipeline
示例2: MountAction
class MountAction(DeployAction):
"""
Depending on the type of deployment, this needs to perform
an OffsetAction, LoopCheckAction, LoopMountAction
"""
name = "mount-action"
description = "mount with offset"
summary = "mount loop"
def __init__(self, key):
super(MountAction, self).__init__()
self.key = key
def populate(self, parameters):
"""
Needs to take account of the deployment type / image type etc.
to determine which actions need to be added to the internal pipeline
as part of the deployment selection step.
"""
if not self.job:
raise LAVABug("No job object supplied to action")
# FIXME: not all mount operations will need these actions
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
self.internal_pipeline.add_action(OffsetAction(self.key))
# FIXME: LoopCheckAction and LoopMountAction should be in only one Action
self.internal_pipeline.add_action(LoopCheckAction(self.key))
self.internal_pipeline.add_action(LoopMountAction(self.key))
示例3: BootCMSISRetry
class BootCMSISRetry(RetryAction):
name = "boot-cmsis-retry"
description = "boot cmsis usb image with retry"
summary = "boot cmsis usb image with retry"
def validate(self):
super(BootCMSISRetry, self).validate()
method_params = self.job.device['actions']['boot']['methods']['cmsis-dap']['parameters']
usb_mass_device = method_params.get('usb_mass_device', None)
if not usb_mass_device:
self.errors = "usb_mass_device unset"
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
method_params = self.job.device['actions']['boot']['methods']['cmsis-dap']['parameters']
usb_mass_device = method_params.get('usb_mass_device', None)
resets_after_flash = method_params.get('resets_after_flash', True)
if self.job.device.hard_reset_command:
self.internal_pipeline.add_action(ResetDevice())
self.internal_pipeline.add_action(WaitDevicePathAction(usb_mass_device))
self.internal_pipeline.add_action(FlashCMSISAction())
if resets_after_flash:
self.internal_pipeline.add_action(WaitUSBSerialDeviceAction())
self.internal_pipeline.add_action(ConnectDevice())
示例4: UnmountAction
class UnmountAction(RetryAction):
name = "umount-retry"
description = "retry support for umount"
summary = "retry umount"
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
self.internal_pipeline.add_action(Unmount())
示例5: BootQemuRetry
class BootQemuRetry(RetryAction):
name = 'boot-qemu-image'
description = "boot image using QEMU command line"
summary = "boot QEMU image"
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
self.internal_pipeline.add_action(CallQemuAction())
示例6: BootCMSIS
class BootCMSIS(BootAction):
name = "boot-cmsis"
description = "boot cmsis usb image"
summary = "boot cmsis usb image"
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
self.internal_pipeline.add_action(BootCMSISRetry())
示例7: BootDFU
class BootDFU(BootAction):
name = 'boot-dfu-image'
description = "boot dfu image with retry"
summary = "boot dfu image with retry"
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
self.internal_pipeline.add_action(BootDFURetry())
示例8: TestShellRetry
class TestShellRetry(RetryAction):
name = "lava-test-retry"
description = "Retry wrapper for lava-test-shell"
summary = "Retry support for Lava Test Shell"
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
self.internal_pipeline.add_action(TestShellAction())
示例9: BootDockerRetry
class BootDockerRetry(RetryAction):
name = 'boot-docker-retry'
description = "boot docker image with retry"
summary = "boot docker image"
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
self.internal_pipeline.add_action(CallDockerAction())
示例10: InternalRetryAction
class InternalRetryAction(RetryAction):
section = 'internal'
name = "internal-retry-action"
description = "internal, do not use outside unit tests"
summary = "internal retry action for unit tests"
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job)
self.internal_pipeline.add_action(TestAction.FakeAction(), parameters)
示例11: test_overlay_action
def test_overlay_action(self): # pylint: disable=too-many-locals
parameters = {
'device_type': 'd02',
'job_name': 'grub-standard-ramdisk',
'job_timeout': '15m',
'action_timeout': '5m',
'priority': 'medium',
'actions': {
'boot': {
'method': 'grub',
'commands': 'ramdisk',
'prompts': ['linaro-test', '[email protected]:~#']
},
'deploy': {
'ramdisk': 'initrd.gz',
'kernel': 'zImage',
'dtb': 'broken.dtb'
}
}
}
device = NewDevice(os.path.join(os.path.dirname(__file__), '../devices/d02-01.yaml'))
job = Job(4212, parameters, None)
job.device = device
pipeline = Pipeline(job=job, parameters=parameters['actions']['boot'])
job.pipeline = pipeline
overlay = BootloaderCommandOverlay()
pipeline.add_action(overlay)
ip_addr = dispatcher_ip(None)
parsed = []
kernel = parameters['actions']['deploy']['kernel']
ramdisk = parameters['actions']['deploy']['ramdisk']
dtb = parameters['actions']['deploy']['dtb']
substitution_dictionary = {
'{SERVER_IP}': ip_addr,
# the addresses need to be hexadecimal
'{RAMDISK}': ramdisk,
'{KERNEL}': kernel,
'{DTB}': dtb
}
params = device['actions']['boot']['methods']
commands = params['grub']['ramdisk']['commands']
self.assertIn('net_bootp', commands)
self.assertIn("linux (tftp,{SERVER_IP})/{KERNEL} console=ttyS0,115200 earlycon=uart8250,mmio32,0x80300000 root=/dev/ram0 ip=dhcp", commands)
self.assertIn('initrd (tftp,{SERVER_IP})/{RAMDISK}', commands)
self.assertIn('devicetree (tftp,{SERVER_IP})/{DTB}', commands)
params['grub']['ramdisk']['commands'] = substitute(params['grub']['ramdisk']['commands'], substitution_dictionary)
substituted_commands = params['grub']['ramdisk']['commands']
self.assertIs(type(substituted_commands), list)
self.assertIn('net_bootp', substituted_commands)
self.assertNotIn("linux (tftp,{SERVER_IP})/{KERNEL} console=ttyS0,115200 earlycon=uart8250,mmio32,0x80300000 root=/dev/ram0 ip=dhcp", substituted_commands)
self.assertIn("linux (tftp,%s)/%s console=ttyS0,115200 earlycon=uart8250,mmio32,0x80300000 root=/dev/ram0 ip=dhcp" % (ip_addr, kernel), substituted_commands)
self.assertNotIn('initrd (tftp,{SERVER_IP})/{RAMDISK}', parsed)
self.assertNotIn('devicetree (tftp,{SERVER_IP})/{DTB}', parsed)
示例12: populate
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
if self.job.device.hard_reset_command:
self.internal_pipeline.add_action(ResetDevice())
self.internal_pipeline.add_action(WaitDeviceBoardID(self.job.device.get('board_id', None)))
self.internal_pipeline.add_action(FlashPyOCDAction())
self.internal_pipeline.add_action(ConnectDevice())
示例13: populate
def populate(self, parameters):
"""
The dispatcher does the first download as the first deployment is not guaranteed to
have DNS resolution fully working, so we can use the IP address of the dispatcher
to get it (with the advantage that the dispatcher decompresses it so that the ramdisk
can pipe the raw image directly from wget to dd.
This also allows the use of local file:// locations which are visible to the dispatcher
but not the device.
"""
self.image_path = self.mkdtemp()
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
if self.test_needs_overlay(parameters):
self.internal_pipeline.add_action(OverlayAction()) # idempotent, includes testdef
uniquify = parameters.get('uniquify', True)
if 'images' in parameters:
for k in sorted(parameters['images'].keys()):
if k == 'yaml_line':
continue
self.internal_pipeline.add_action(DownloaderAction(
k, path=self.image_path, uniquify=uniquify))
if parameters['images'][k].get('apply-overlay', False):
if self.test_needs_overlay(parameters):
self.internal_pipeline.add_action(ApplyOverlayImage())
self.internal_pipeline.add_action(DDAction())
elif 'image' in parameters:
self.internal_pipeline.add_action(DownloaderAction(
'image', path=self.image_path, uniquify=uniquify))
if self.test_needs_overlay(parameters):
self.internal_pipeline.add_action(ApplyOverlayImage())
self.internal_pipeline.add_action(DDAction())
# FIXME: could support tarballs too
if self.test_needs_deployment(parameters):
self.internal_pipeline.add_action(DeployDeviceEnvironment())
示例14: populate
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
if self.test_needs_overlay(parameters):
self.internal_pipeline.add_action(OverlayAction())
# Check if the device has a power command such as HiKey, Dragonboard,
# etc. against device that doesn't like Nexus, etc.
if self.job.device.get('fastboot_via_uboot', False):
self.internal_pipeline.add_action(ConnectDevice())
self.internal_pipeline.add_action(UBootEnterFastbootAction())
elif self.job.device.hard_reset_command:
self.force_prompt = True
self.internal_pipeline.add_action(ConnectDevice())
self.internal_pipeline.add_action(ResetDevice())
else:
self.internal_pipeline.add_action(EnterFastbootAction())
fastboot_dir = self.mkdtemp()
image_keys = sorted(parameters['images'].keys())
for image in image_keys:
if image != 'yaml_line':
self.internal_pipeline.add_action(DownloaderAction(image, fastboot_dir))
if parameters['images'][image].get('apply-overlay', False):
if self.test_needs_overlay(parameters):
if parameters['images'][image].get('sparse', True):
self.internal_pipeline.add_action(
ApplyOverlaySparseImage(image))
else:
self.internal_pipeline.add_action(
ApplyOverlayImage(image, use_root_partition=False))
if self.test_needs_overlay(parameters) and \
self.test_needs_deployment(parameters):
self.internal_pipeline.add_action(
DeployDeviceEnvironment())
self.internal_pipeline.add_action(FastbootFlashOrderAction())
示例15: BootQEMUImageAction
class BootQEMUImageAction(BootAction):
name = 'boot-image-retry'
description = "boot image with retry"
summary = "boot with retry"
def populate(self, parameters):
self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
self.internal_pipeline.add_action(BootQemuRetry())
if self.has_prompts(parameters):
self.internal_pipeline.add_action(AutoLoginAction())
if self.test_has_shell(parameters):
self.internal_pipeline.add_action(ExpectShellSession())
if 'transfer_overlay' in parameters:
self.internal_pipeline.add_action(OverlayUnpack())
self.internal_pipeline.add_action(ExportDeviceEnvironment())