Пример #1
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     self.internal_pipeline.add_action(OverlayAction())
     if hasattr(self.job.device, 'power_state'):
         if self.job.device.power_state in ['on', 'off']:
             self.internal_pipeline.add_action(ConnectDevice())
             self.internal_pipeline.add_action(ResetDevice())
     self.internal_pipeline.add_action(EnterFastbootAction())
     for image in parameters['images'].keys():
         if image != 'yaml_line':
             download = DownloaderAction(image, self.fastboot_dir)
             download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
             self.internal_pipeline.add_action(download)
         if image == 'image':
             self.internal_pipeline.add_action(FastbootUpdateAction())
         if image == 'ptable':
             self.internal_pipeline.add_action(ApplyPtableAction())
         if image == 'boot':
             self.internal_pipeline.add_action(ApplyBootAction())
         if image == 'cache':
             self.internal_pipeline.add_action(ApplyCacheAction())
         if image == 'userdata':
             self.internal_pipeline.add_action(ApplyUserdataAction())
         if image == 'system':
             self.internal_pipeline.add_action(ApplySystemAction())
Пример #2
0
    def populate(self, parameters):
        self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
        self.internal_pipeline.add_action(OverlayAction())
        if hasattr(self.job.device, 'power_state'):
            if self.job.device.power_state in ['on', 'off']:
                self.internal_pipeline.add_action(ConnectDevice())
                self.internal_pipeline.add_action(PowerOn())
        self.internal_pipeline.add_action(EnterFastbootAction())
        self.internal_pipeline.add_action(LxcAddDeviceAction())

        image_keys = list(parameters['images'].keys())
        fastboot_dir = self.mkdtemp()
        # Add the required actions
        checks = [('image', FastbootUpdateAction),
                  ('ptable', ApplyPtableAction),
                  ('boot', ApplyBootAction),
                  ('cache', ApplyCacheAction),
                  ('userdata', ApplyUserdataAction),
                  ('system', ApplySystemAction),
                  ('vendor', ApplyVendorAction)]
        for (key, cls) in checks:
            if key in image_keys:
                download = DownloaderAction(key, fastboot_dir)
                download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
                self.internal_pipeline.add_action(download)
                self.internal_pipeline.add_action(cls())
Пример #3
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     if 'ramdisk' in parameters:
         download = DownloaderAction('ramdisk', path=self.tftp_dir)
         download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
         self.internal_pipeline.add_action(download)
         self.set_common_data('tftp', 'ramdisk', True)
     if 'kernel' in parameters:
         download = DownloaderAction('kernel', path=self.tftp_dir)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
     if 'dtb' in parameters:
         download = DownloaderAction('dtb', path=self.tftp_dir)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
     if 'nfsrootfs' in parameters:
         download = DownloaderAction('nfsrootfs', path=self.download_dir)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
     if 'modules' in parameters:
         download = DownloaderAction('modules', path=self.tftp_dir)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
     # TftpAction is a deployment, so once the files are in place, just do the overlay
     self.internal_pipeline.add_action(PrepareOverlayTftp())
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #4
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     path = self.mkdtemp()
     if 'uefi' in parameters:
         uefi_path = self.mkdtemp()
         self.internal_pipeline.add_action(
             DownloaderAction('uefi', uefi_path))
         # uefi option of QEMU needs a directory, not the filename
         self.set_namespace_data(action=self.name,
                                 label='image',
                                 key='uefi_dir',
                                 value=uefi_path,
                                 parameters=parameters)
         # alternatively use the -bios option and standard image args
     for image in parameters['images'].keys():
         if image != 'yaml_line':
             self.internal_pipeline.add_action(DownloaderAction(
                 image, path))
             if parameters['images'][image].get('format', '') == 'qcow2':
                 self.internal_pipeline.add_action(
                     QCowConversionAction(image))
     if self.test_needs_overlay(parameters):
         self.internal_pipeline.add_action(CustomisationAction())
         self.internal_pipeline.add_action(
             OverlayAction())  # idempotent, includes testdef
         self.internal_pipeline.add_action(ApplyOverlayGuest())
     if self.test_needs_deployment(parameters):
         self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #5
0
    def populate(self, parameters):
        self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
        self.internal_pipeline.add_action(OverlayAction())
        if hasattr(self.job.device, 'power_state'):
            if self.job.device.power_state in ['on', 'off']:
                self.internal_pipeline.add_action(ConnectDevice())
                self.internal_pipeline.add_action(PowerOn())
        self.internal_pipeline.add_action(EnterFastbootAction())
        self.internal_pipeline.add_action(LxcAddDeviceAction())

        image_keys = list(parameters['images'].keys())
        fastboot_dir = self.mkdtemp()
        # Add the required actions
        checks = [('image', FastbootUpdateAction),
                  ('ptable', ApplyPtableAction),
                  ('boot', ApplyBootAction),
                  ('cache', ApplyCacheAction),
                  ('userdata', ApplyUserdataAction),
                  ('system', ApplySystemAction),
                  ('vendor', ApplyVendorAction)]
        for (key, cls) in checks:
            if key in image_keys:
                download = DownloaderAction(key, fastboot_dir)
                download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
                self.internal_pipeline.add_action(download)
                self.internal_pipeline.add_action(cls())
Пример #6
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     path = self.mkdtemp()
     for image in parameters['images'].keys():
         if image != 'yaml_line':
             download = DownloaderAction(image, path)
             download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
             self.internal_pipeline.add_action(download)
Пример #7
0
    def populate(self, parameters):
        self.tftp_dir = self.mkdtemp(override=tftpd_dir())
        self.internal_pipeline = Pipeline(parent=self,
                                          job=self.job,
                                          parameters=parameters)
        self.set_namespace_data(action=self.name,
                                label='tftp',
                                key='tftp_dir',
                                value=self.tftp_dir,
                                parameters=parameters)

        for key in ['initrd', 'kernel', 'dtb', 'nbdroot']:
            if key in parameters:
                download = DownloaderAction(key, path=self.tftp_dir)
                download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
                self.internal_pipeline.add_action(download)
                if key == 'initrd':
                    self.set_namespace_data(action="tftp-deploy",
                                            label='tftp',
                                            key='ramdisk',
                                            value=True,
                                            parameters=parameters)
                    self.set_namespace_data(action=self.name,
                                            label='nbd',
                                            key='initrd',
                                            value=True,
                                            parameters=parameters)

        # prepare overlay
        self.internal_pipeline.add_action(OverlayAction())
        # setup values for protocol and later steps
        self.set_namespace_data(action=self.name,
                                label='nbd',
                                key='initrd',
                                value=True,
                                parameters=parameters)
        # store in parameters for protocol 'xnbd' to tear-down xnbd-server
        # and store in namespace for boot action
        # ip
        parameters['lava-xnbd'] = {}
        self.nbd_ip = dispatcher_ip(self.job.parameters['dispatcher'])
        parameters['lava-xnbd']['ip'] = self.nbd_ip
        self.set_namespace_data(action=self.name,
                                label='nbd',
                                key='nbd_server_ip',
                                value=self.nbd_ip,
                                parameters=parameters)
        # port
        self.nbd_port = get_free_port(self.job.parameters['dispatcher'])
        parameters['lava-xnbd']['port'] = self.nbd_port
        self.set_namespace_data(action=self.name,
                                label='nbd',
                                key='nbd_server_port',
                                value=self.nbd_port,
                                parameters=parameters)
        # handle XnbdAction next - bring-up xnbd-server
        self.internal_pipeline.add_action(XnbdAction())
Пример #8
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     path = self.mkdtemp()
     for image in parameters['images'].keys():
         if image != 'yaml_line':
             download = DownloaderAction(image, path)
             download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
             self.internal_pipeline.add_action(download)
Пример #9
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     # download coreboot image
     download = DownloaderAction('coreboot', path=self.download_dir)
     download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
     self.internal_pipeline.add_action(PowerOff())
     self.internal_pipeline.add_action(download)
     self.internal_pipeline.add_action(SPIPowerOn())
     self.internal_pipeline.add_action(FlashSPI())
     self.internal_pipeline.add_action(SPIPowerOff())
     self.internal_pipeline.add_action(PowerOn())
Пример #10
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     self.internal_pipeline.add_action(OverlayAction())
     for item in self.items:
         if item in parameters:
             download = DownloaderAction(item, path=self.scp_dir)
             download.max_retries = 3
             self.internal_pipeline.add_action(download, parameters)
             self.set_common_data('scp', item, True)
     # we might not have anything to download, just the overlay to push
     self.internal_pipeline.add_action(PrepareOverlayScp())
     # prepare the device environment settings in common data for enabling in the boot step
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #11
0
 def populate(self, parameters):
     download_dir = self.mkdtemp()
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     if 'nfsrootfs' in parameters:
         self.internal_pipeline.add_action(DownloaderAction('nfsrootfs', path=download_dir))
     if 'modules' in parameters:
         self.internal_pipeline.add_action(DownloaderAction('modules', path=download_dir))
     # NfsAction is a deployment, so once the nfsrootfs has been deployed, just do the overlay
     self.internal_pipeline.add_action(ExtractNfsRootfs())
     self.internal_pipeline.add_action(OverlayAction())
     self.internal_pipeline.add_action(ExtractModules())
     self.internal_pipeline.add_action(ApplyOverlayTftp())
     if self.test_needs_deployment(parameters):
         self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #12
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     path = mkdtemp()
     download = DownloaderAction('image', path)
     download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
     self.internal_pipeline.add_action(download)
     if parameters.get('format', '') == 'qcow2':
         self.internal_pipeline.add_action(QCowConversionAction('image'))
     self.internal_pipeline.add_action(MountAction())
     self.internal_pipeline.add_action(CustomisationAction())
     self.internal_pipeline.add_action(OverlayAction())  # idempotent, includes testdef
     self.internal_pipeline.add_action(ApplyOverlayImage())  # specific to image deployments
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
     self.internal_pipeline.add_action(UnmountAction())
Пример #13
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     tar_flags = parameters['deployment_data']['tar_flags'] if 'tar_flags' in parameters['deployment_data'].keys() else ''
     self.set_common_data(self.name, 'tar_flags', tar_flags)
     self.internal_pipeline.add_action(OverlayAction())
     for item in self.items:
         if item in parameters:
             download = DownloaderAction(item, path=self.mkdtemp())
             download.max_retries = 3
             self.internal_pipeline.add_action(download, parameters)
             self.set_common_data('scp', item, True)
     # we might not have anything to download, just the overlay to push
     self.internal_pipeline.add_action(PrepareOverlayScp())
     # prepare the device environment settings in common data for enabling in the boot step
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #14
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     self.internal_pipeline.add_action(OverlayAction())
     for item in self.items:
         if item in parameters:
             download = DownloaderAction(item, path=self.scp_dir)
             download.max_retries = 3
             self.internal_pipeline.add_action(download, parameters)
             self.set_common_data('scp', item, True)
     # we might not have anything to download, just the overlay to push
     self.internal_pipeline.add_action(PrepareOverlayScp())
     # prepare the device environment settings in common data for enabling in the boot step
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
     scp = Scp('overlay')
     self.internal_pipeline.add_action(scp)
Пример #15
0
    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(CustomisationAction())
            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.power_command:
            self.force_prompt = True
            self.internal_pipeline.add_action(ConnectDevice())
            self.internal_pipeline.add_action(ResetDevice())
        else:
            self.internal_pipeline.add_action(EnterFastbootAction())
        self.internal_pipeline.add_action(WaitUSBDeviceAction(
            device_actions=['add']))

        fastboot_dir = self.mkdtemp()
        image_keys = list(parameters['images'].keys())
        image_keys.sort()
        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):
                        self.internal_pipeline.add_action(
                            ApplyOverlaySparseImage(image))
                if self.test_needs_overlay(parameters) and \
                   self.test_needs_deployment(parameters):
                    self.internal_pipeline.add_action(
                        DeployDeviceEnvironment())
        self.internal_pipeline.add_action(LxcAddDeviceAction())
        self.internal_pipeline.add_action(FastbootFlashAction())
Пример #16
0
    def populate(self, parameters):
        self.tftp_dir = self.mkdtemp()
        self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
        self.set_common_data("tftp", "tftp_dir", self.tftp_dir)

        for key in ["ramdisk", "kernel", "dtb", "nfsrootfs", "modules", "preseed"]:
            if key in parameters:
                download = DownloaderAction(key, path=self.tftp_dir)
                download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
                self.internal_pipeline.add_action(download)
                if key == "ramdisk":
                    self.set_common_data("tftp", "ramdisk", True)

        # TftpAction is a deployment, so once the files are in place, just do the overlay
        self.internal_pipeline.add_action(PrepareOverlayTftp())
        self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #17
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     tar_flags = parameters['deployment_data'][
         'tar_flags'] if 'tar_flags' in parameters['deployment_data'].keys(
         ) else ''
     self.set_namespace_data(action=self.name,
                             label=self.name,
                             key='tar_flags',
                             value=tar_flags,
                             parameters=parameters)
     self.internal_pipeline.add_action(OverlayAction())
     for item in self.items:
         if item in parameters:
             self.internal_pipeline.add_action(
                 DownloaderAction(item, path=self.mkdtemp()), parameters)
             self.set_namespace_data(action=self.name,
                                     label='scp',
                                     key=item,
                                     value=True,
                                     parameters=parameters)
     # we might not have anything to download, just the overlay to push
     self.internal_pipeline.add_action(PrepareOverlayScp())
     # prepare the device environment settings in common data for enabling in the boot step
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #18
0
    def populate(self, parameters):
        self.tftp_dir = self.mkdtemp(override=tftpd_dir())
        self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
        self.set_namespace_data(action=self.name, label='tftp', key='tftp_dir', value=self.tftp_dir, parameters=parameters)

        for key in ['ramdisk', 'kernel', 'dtb', 'nfsrootfs', 'modules', 'preseed']:
            if key in parameters:
                download = DownloaderAction(key, path=self.tftp_dir)
                download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
                self.internal_pipeline.add_action(download)
                if key == 'ramdisk':
                    self.set_namespace_data(action=self.name, label='tftp', key='ramdisk', value=True, parameters=parameters)

        # TftpAction is a deployment, so once the files are in place, just do the overlay
        self.internal_pipeline.add_action(PrepareOverlayTftp())
        if self.test_needs_deployment(parameters):
            self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #19
0
 def populate(self, parameters):
     download_dir = self.mkdtemp()
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     if 'nfsrootfs' in parameters:
         download = DownloaderAction('nfsrootfs', path=download_dir)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
     if 'modules' in parameters:
         download = DownloaderAction('modules', path=download_dir)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
     # NfsAction is a deployment, so once the nfsrootfs has been deployed, just do the overlay
     self.internal_pipeline.add_action(ExtractNfsRootfs())
     self.internal_pipeline.add_action(OverlayAction())
     self.internal_pipeline.add_action(ExtractModules())
     self.internal_pipeline.add_action(ApplyOverlayTftp())
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #20
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     path = mkdtemp()
     download = DownloaderAction('image', path)
     download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
     self.internal_pipeline.add_action(download)
     if parameters.get('format', '') == 'qcow2':
         self.internal_pipeline.add_action(QCowConversionAction('image'))
     self.internal_pipeline.add_action(MountAction())
     self.internal_pipeline.add_action(CustomisationAction())
     self.internal_pipeline.add_action(
         OverlayAction())  # idempotent, includes testdef
     self.internal_pipeline.add_action(
         ApplyOverlayImage())  # specific to image deployments
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
     self.internal_pipeline.add_action(UnmountAction())
Пример #21
0
 def populate(self, parameters):
     self.preseed_path = self.mkdtemp()
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     self.internal_pipeline.add_action(IsoEmptyImage())
     # the preseed file needs to go into the dispatcher apache tmp directory.
     self.internal_pipeline.add_action(
         DownloaderAction('preseed', self.preseed_path))
     self.internal_pipeline.add_action(
         DownloaderAction('iso', self.mkdtemp()))
     self.internal_pipeline.add_action(IsoPullInstaller())
     self.internal_pipeline.add_action(QemuCommandLine())
     # prepare overlay at this stage - make it available after installation.
     self.internal_pipeline.add_action(CustomisationAction())
     self.internal_pipeline.add_action(
         OverlayAction())  # idempotent, includes testdef
     self.internal_pipeline.add_action(ApplyOverlayGuest())
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #22
0
 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.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     if 'image' in parameters:
         download = DownloaderAction('image', path=DISPATCHER_DOWNLOAD_DIR)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
         self.internal_pipeline.add_action(DDAction())
     # FIXME: could support tarballs too
     self.internal_pipeline.add_action(CustomisationAction())
     self.internal_pipeline.add_action(OverlayAction())  # idempotent, includes testdef
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #23
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     path = mkdtemp()
     if 'uefi' in parameters:
         uefi_path = mkdtemp()
         download = DownloaderAction('uefi', uefi_path)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
         # uefi option of QEMU needs a directory, not the filename
         self.set_common_data('image', 'uefi_dir', uefi_path)  # just the path, not the filename
     for image in parameters['images'].keys():
         if image != 'yaml_line':
             download = DownloaderAction(image, path)
             download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
             self.internal_pipeline.add_action(download)
             if parameters['images'][image].get('format', '') == 'qcow2':
                 self.internal_pipeline.add_action(QCowConversionAction(image))
     self.internal_pipeline.add_action(CustomisationAction())
     self.internal_pipeline.add_action(OverlayAction())  # idempotent, includes testdef
     self.internal_pipeline.add_action(ApplyOverlayGuest())
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #24
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     path = self.mkdtemp()
     if 'uefi' in parameters:
         uefi_path = self.mkdtemp()
         download = DownloaderAction('uefi', uefi_path)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
         # uefi option of QEMU needs a directory, not the filename
         self.set_common_data('image', 'uefi_dir',
                              uefi_path)  # just the path, not the filename
         # alternatively use the -bios option and standard image args
     for image in parameters['images'].keys():
         if image != 'yaml_line':
             download = DownloaderAction(image, path)
             download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
             self.internal_pipeline.add_action(download)
             if parameters['images'][image].get('format', '') == 'qcow2':
                 self.internal_pipeline.add_action(
                     QCowConversionAction(image))
     self.internal_pipeline.add_action(CustomisationAction())
     self.internal_pipeline.add_action(
         OverlayAction())  # idempotent, includes testdef
     self.internal_pipeline.add_action(ApplyOverlayGuest())
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #25
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     path = self.mkdtemp()
     if 'uefi' in parameters:
         uefi_path = self.mkdtemp()
         download = DownloaderAction('uefi', uefi_path)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
         # uefi option of QEMU needs a directory, not the filename
         self.set_namespace_data(action=self.name,
                                 label='image',
                                 key='uefi_dir',
                                 value=uefi_path,
                                 parameters=parameters)
         # alternatively use the -bios option and standard image args
     for image in parameters['images'].keys():
         if image != 'yaml_line':
             download = DownloaderAction(image, path)
             download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
             self.internal_pipeline.add_action(download)
             if parameters['images'][image].get('format', '') == 'qcow2':
                 self.internal_pipeline.add_action(
                     QCowConversionAction(image))
     self.internal_pipeline.add_action(ExtractNfsAction())
     self.internal_pipeline.add_action(OverlayAction())
     self.internal_pipeline.add_action(ApplyOverlayTftp())
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #26
0
 def populate(self, parameters):
     download_dir = self.mkdtemp()
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     if 'recovery_image' in parameters:
         download = DownloaderAction('recovery_image', path=download_dir)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
     if hasattr(self.job.device, 'power_state'):
         if self.job.device.power_state in ['on', 'off']:
             self.force_prompt = True
             self.internal_pipeline.add_action(ConnectDevice())
             self.internal_pipeline.add_action(PowerOn())
     self.internal_pipeline.add_action(ExtractVExpressRecoveryImage())
     self.internal_pipeline.add_action(EnterVExpressMCC())
     self.internal_pipeline.add_action(EnableVExpressMassStorage())
     self.internal_pipeline.add_action(WaitUSBMassStorageDeviceAction())
     self.internal_pipeline.add_action(MountVExpressMassStorageDevice())
     self.internal_pipeline.add_action(DeployVExpressRecoveryImage())
     self.internal_pipeline.add_action(UnmountVExpressMassStorageDevice())
     self.internal_pipeline.add_action(VExpressFlashErase())
Пример #27
0
 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.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     if 'image' in parameters:
         download = DownloaderAction('image', path=DISPATCHER_DOWNLOAD_DIR)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
         self.internal_pipeline.add_action(DDAction())
     # FIXME: could support tarballs too
     self.internal_pipeline.add_action(CustomisationAction())
     self.internal_pipeline.add_action(
         OverlayAction())  # idempotent, includes testdef
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
Пример #28
0
 def populate(self, parameters):
     download_dir = self.mkdtemp()
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     if 'recovery_image' in parameters:
         self.internal_pipeline.add_action(DownloaderAction('recovery_image', path=download_dir))
     self.internal_pipeline.add_action(LxcAddDeviceAction())
     self.force_prompt = True
     self.internal_pipeline.add_action(ConnectDevice())
     self.internal_pipeline.add_action(ResetDevice())
     self.internal_pipeline.add_action(ExtractVExpressRecoveryImage())
     self.internal_pipeline.add_action(EnterVExpressMCC())
     self.internal_pipeline.add_action(EnableVExpressMassStorage())
     self.internal_pipeline.add_action(WaitUSBMassStorageDeviceAction())
     self.internal_pipeline.add_action(MountVExpressMassStorageDevice())
     self.internal_pipeline.add_action(DeployVExpressRecoveryImage())
     self.internal_pipeline.add_action(UnmountVExpressMassStorageDevice())
     self.internal_pipeline.add_action(VExpressFlashErase())
    def __init__(self, parent):
        super(DeployImage, self).__init__(parent)
        self.action = DeployImageAction()
        self.action.job = self.job
        parent.add_action(self.action)

        internal_pipeline = Pipeline(parent=self.action, job=self.job)
        internal_pipeline.add_action(DownloaderAction())
        internal_pipeline.add_action(ChecksumAction())
        internal_pipeline.add_action(MountAction())
        internal_pipeline.add_action(CustomisationAction())
        for action_params in self.job.parameters['actions']:
            if 'test' in action_params:
                # FIXME: does it matter if testdef_action runs before overlay?
                testdef_action = TestDefinitionAction()
                testdef_action.parameters = action_params
                internal_pipeline.add_action(testdef_action)
                if 'target_group' in self.job.parameters:
                    internal_pipeline.add_action(MultinodeOverlayAction())
                if 'lmp_module' in self.job.parameters:
                    internal_pipeline.add_action(LMPOverlayAction())
                internal_pipeline.add_action(OverlayAction())
        internal_pipeline.add_action(UnmountAction())
Пример #30
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     self.internal_pipeline.add_action(OverlayAction())
     if hasattr(self.job.device, 'power_state'):
         if self.job.device.power_state in ['on', 'off']:
             self.internal_pipeline.add_action(ConnectDevice())
             self.internal_pipeline.add_action(ResetDevice())
     self.internal_pipeline.add_action(EnterFastbootAction())
     self.internal_pipeline.add_action(LxcAddDeviceAction())
     image_keys = list(parameters['images'].keys())
     if 'image' in image_keys:
         download = DownloaderAction('image', self.fastboot_dir)
         download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
         self.internal_pipeline.add_action(download)
         self.internal_pipeline.add_action(FastbootUpdateAction())
     if 'ptable' in image_keys:
         download = DownloaderAction('ptable', self.fastboot_dir)
         download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
         self.internal_pipeline.add_action(download)
         self.internal_pipeline.add_action(ApplyPtableAction())
     if 'boot' in image_keys:
         download = DownloaderAction('boot', self.fastboot_dir)
         download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
         self.internal_pipeline.add_action(download)
         self.internal_pipeline.add_action(ApplyBootAction())
     if 'cache' in image_keys:
         download = DownloaderAction('cache', self.fastboot_dir)
         download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
         self.internal_pipeline.add_action(download)
         self.internal_pipeline.add_action(ApplyCacheAction())
     if 'userdata' in image_keys:
         download = DownloaderAction('userdata', self.fastboot_dir)
         download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
         self.internal_pipeline.add_action(download)
         self.internal_pipeline.add_action(ApplyUserdataAction())
     if 'system' in image_keys:
         download = DownloaderAction('system', self.fastboot_dir)
         download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
         self.internal_pipeline.add_action(download)
         self.internal_pipeline.add_action(ApplySystemAction())
     if 'vendor' in image_keys:
         download = DownloaderAction('vendor', self.fastboot_dir)
         download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
         self.internal_pipeline.add_action(download)
         self.internal_pipeline.add_action(ApplyVendorAction())
Пример #31
0
    def populate(self, parameters):
        self.internal_pipeline = Pipeline(parent=self,
                                          job=self.job,
                                          parameters=parameters)
        self.internal_pipeline.add_action(OverlayAction())
        if hasattr(self.job.device, 'power_state'):
            if self.job.device.power_state in ['on', 'off']:
                self.internal_pipeline.add_action(ConnectDevice())
                self.internal_pipeline.add_action(ResetDevice())

        image_keys = list(parameters['images'].keys())
        # Nexell extension
        if 'nexell_ext' in image_keys:
            self.logger.debug("SUKER: parameters in deploy/fastboot.py : " +
                              str(parameters))
            self.internal_pipeline.add_action(
                EnterNexellFastbootAction(parameters, 'deploy_script',
                                          'deploy_command1', 'dir_name'))
            self.internal_pipeline.add_action(
                ApplyNexellDeployAction(parameters, 'deploy_script',
                                        'deploy_command2', 'dir_name'))
        else:
            self.internal_pipeline.add_action(EnterFastbootAction())
            self.internal_pipeline.add_action(LxcAddDeviceAction())

        if 'image' in image_keys:
            download = DownloaderAction('image', self.fastboot_dir)
            download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
            self.internal_pipeline.add_action(download)
            self.internal_pipeline.add_action(FastbootUpdateAction())
        if 'ptable' in image_keys:
            download = DownloaderAction('ptable', self.fastboot_dir)
            download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
            self.internal_pipeline.add_action(download)
            self.internal_pipeline.add_action(ApplyPtableAction())
        if 'boot' in image_keys:
            download = DownloaderAction('boot', self.fastboot_dir)
            download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
            self.internal_pipeline.add_action(download)
            self.internal_pipeline.add_action(ApplyBootAction())
        if 'cache' in image_keys:
            download = DownloaderAction('cache', self.fastboot_dir)
            download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
            self.internal_pipeline.add_action(download)
            self.internal_pipeline.add_action(ApplyCacheAction())
        if 'userdata' in image_keys:
            download = DownloaderAction('userdata', self.fastboot_dir)
            download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
            self.internal_pipeline.add_action(download)
            self.internal_pipeline.add_action(ApplyUserdataAction())
        if 'system' in image_keys:
            download = DownloaderAction('system', self.fastboot_dir)
            download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
            self.internal_pipeline.add_action(download)
            self.internal_pipeline.add_action(ApplySystemAction())
        if 'vendor' in image_keys:
            download = DownloaderAction('vendor', self.fastboot_dir)
            download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
            self.internal_pipeline.add_action(download)
            self.internal_pipeline.add_action(ApplyVendorAction())
Пример #32
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     if 'ramdisk' in parameters:
         download = DownloaderAction('ramdisk', path=self.tftp_dir)
         download.max_retries = 3  # overridden by failure_retry in the parameters, if set.
         self.internal_pipeline.add_action(download)
         self.set_common_data('tftp', 'ramdisk', True)
     if 'kernel' in parameters:
         download = DownloaderAction('kernel', path=self.tftp_dir)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
     if 'dtb' in parameters:
         download = DownloaderAction('dtb', path=self.tftp_dir)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
     if 'nfsrootfs' in parameters:
         download = DownloaderAction('nfsrootfs', path=self.download_dir)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
     if 'modules' in parameters:
         download = DownloaderAction('modules', path=self.tftp_dir)
         download.max_retries = 3
         self.internal_pipeline.add_action(download)
     # TftpAction is a deployment, so once the files are in place, just do the overlay
     self.internal_pipeline.add_action(PrepareOverlayTftp())
     self.internal_pipeline.add_action(DeployDeviceEnvironment())