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())
Example #2
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())
Example #3
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())
Example #4
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())
Example #5
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())
Example #6
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())
Example #7
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job,
                                       parameters=parameters)
     self.internal_pipeline.add_action(LxcCreateAction())
     if 'packages' in parameters:
         self.internal_pipeline.add_action(LxcStartAction())
         self.internal_pipeline.add_action(LxcAptUpdateAction())
         self.internal_pipeline.add_action(LxcAptInstallAction())
         self.internal_pipeline.add_action(LxcStopAction())
     # needed if export device environment is also to be used
     self.internal_pipeline.add_action(DeployDeviceEnvironment())
     self.internal_pipeline.add_action(OverlayAction())
     self.internal_pipeline.add_action(ApplyLxcOverlay())
Example #8
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self, job=self.job,
                                       parameters=parameters)
     self.internal_pipeline.add_action(LxcCreateAction())
     if 'packages' in parameters:
         self.internal_pipeline.add_action(LxcStartAction())
         self.internal_pipeline.add_action(LxcAptUpdateAction())
         self.internal_pipeline.add_action(LxcAptInstallAction())
         self.internal_pipeline.add_action(LxcStopAction())
     if self.test_needs_deployment(parameters):
         self.internal_pipeline.add_action(DeployDeviceEnvironment())
     if self.test_needs_overlay(parameters):
         self.internal_pipeline.add_action(OverlayAction())
         self.internal_pipeline.add_action(ApplyLxcOverlay())
 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())
Example #10
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())
Example #11
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)
Example #12
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())
Example #13
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())
Example #14
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())
Example #15
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.image_path = self.mkdtemp()
     self.internal_pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
     self.internal_pipeline.add_action(CustomisationAction())
     if self.test_needs_overlay(parameters):
         self.internal_pipeline.add_action(OverlayAction())  # idempotent, includes testdef
     if 'image' in parameters:
         self.internal_pipeline.add_action(DownloaderAction('image', path=self.image_path))
         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())