Ejemplo n.º 1
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)
        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())
Ejemplo n.º 2
0
Archivo: uuu.py Proyecto: jubing13/lava
    def populate(self, parameters):
        self.parameters = parameters
        self.pipeline = Pipeline(parent=self,
                                 job=self.job,
                                 parameters=parameters)
        if self.test_needs_overlay(parameters):
            self.pipeline.add_action(OverlayAction())
        path = self.mkdtemp()
        self.set_namespace_data(action="uuu-deploy",
                                label="uuu-images",
                                key="root_location",
                                value=path)

        images_param = dict(parameters["images"])
        images = list(images_param.keys())

        self.set_namespace_data(action="uuu-deploy",
                                label="uuu-images",
                                key="images_names",
                                value=images)

        for image in images:
            self.pipeline.add_action(
                DownloaderAction(image,
                                 path=path,
                                 params=parameters["images"][image]))
            if images_param[image].get("apply-overlay", False):
                if self.test_needs_overlay(parameters):
                    if images_param[image].get("sparse", False):
                        self.pipeline.add_action(
                            ApplyOverlaySparseImage(image_key=image))
                    else:
                        self.pipeline.add_action(
                            ApplyOverlayImage(image_key=image))
Ejemplo n.º 3
0
 def populate(self, parameters):
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     path = self.mkdtemp()
     self.internal_pipeline.add_action(DownloaderAction('image', path=path))
     if self.test_needs_overlay(parameters):
         self.internal_pipeline.add_action(OverlayAction())
         self.internal_pipeline.add_action(ApplyOverlayImage())
         if self.test_needs_deployment(parameters):
             self.internal_pipeline.add_action(DeployDeviceEnvironment())
Ejemplo n.º 4
0
    def populate(self, parameters):
        self.pipeline = Pipeline(parent=self, job=self.job, parameters=parameters)
        if self.test_needs_overlay(parameters):
            self.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.pipeline.add_action(ConnectDevice())
            self.pipeline.add_action(UBootEnterFastbootAction())
        elif self.job.device.hard_reset_command:
            self.force_prompt = True
            self.pipeline.add_action(ConnectDevice())
            if not is_lxc_requested(self.job):
                self.pipeline.add_action(PrePower())
            self.pipeline.add_action(ResetDevice())
        else:
            self.pipeline.add_action(EnterFastbootAction())

        fastboot_dir = self.mkdtemp()
        for image in sorted(parameters["images"].keys()):
            self.pipeline.add_action(
                DownloaderAction(
                    image, fastboot_dir, params=parameters["images"][image]
                )
            )
            if parameters["images"][image].get("apply-overlay", False):
                if self.test_needs_overlay(parameters):
                    if parameters["images"][image].get("sparse", True):
                        self.pipeline.add_action(ApplyOverlaySparseImage(image))
                    else:
                        use_root_part = parameters["images"][image].get(
                            "root_partition", False
                        )
                        self.pipeline.add_action(
                            ApplyOverlayImage(image, use_root_partition=use_root_part)
                        )

            if self.test_needs_overlay(parameters) and self.test_needs_deployment(
                parameters
            ):
                self.pipeline.add_action(DeployDeviceEnvironment())
        self.pipeline.add_action(FastbootFlashOrderAction())
Ejemplo n.º 5
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(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())
Ejemplo n.º 6
0
    def populate(self, parameters):
        self.internal_pipeline = Pipeline(parent=self,
                                          job=self.job,
                                          parameters=parameters)
        image_keys = list(parameters['images'].keys())
        if self.test_needs_overlay(parameters):
            self.logger.debug("[SEOJI] add OverlayAction")
            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())
            if not is_lxc_requested(self.job):
                self.internal_pipeline.add_action(PrePower())
            self.internal_pipeline.add_action(ResetDevice())
        elif 'nexell_ext' in image_keys:
            # Nexell extension
            #self.internal_pipeline.add_action(OverlayAction())

            # download build result
            if 'url' in parameters['images']['nexell_ext']:
                self.logger.debug(
                    "[SEOJI] url:" +
                    str(parameters['images']['nexell_ext']['url']))
                self.path = '/opt/share'
                self.internal_pipeline.add_action(
                    DownloaderAction('nexell_ext', self.path))
                #if 'compression' in parameters['images']['nexell_ext]:
                #self.logger.debug("[SEOJI] yes compression param exist")

            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())

        fastboot_dir = self.mkdtemp()
        image_keys = sorted(parameters['images'].keys())
        # Nexell extension
        if 'nexell_ext' in image_keys:
            self.logger.debug("[SEOJI] pass adding DownloaderAction")
            #self.internal_pipeline.add_action(DeployDeviceEnvironment())
        else:
            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())
        '''