Ejemplo n.º 1
0
    def populate(self, parameters):
        self.internal_pipeline = Pipeline(parent=self,
                                          job=self.job,
                                          parameters=parameters)
        # Check if the device has a power command such as HiKey, Dragonboard,
        # etc. against device that doesn't like Nexus, etc.
        # This is required in order to power on the device so that when the
        # test job writer wants to perform some operation using a
        # lava-test-shell action that follows, this becomes mandatory. Think of
        # issuing any fastboot commands on the powered on device.
        #
        # NOTE: Add more power on strategies, if required for specific devices.
        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())

        self.download_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, self.download_dir))
        if self.test_needs_overlay(parameters):
            self.internal_pipeline.add_action(OverlayAction())
        self.internal_pipeline.add_action(CopyToLxcAction())
Ejemplo n.º 2
0
    def populate(self, parameters):
        self.internal_pipeline = Pipeline(parent=self,
                                          job=self.job,
                                          parameters=parameters)
        # Always ensure the device is in fastboot mode before trying to boot.
        # 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())

        # Based on the boot sequence defined in the device configuration, add
        # the required pipeline actions.
        sequences = self.job.device['actions']['boot']['methods'].get(
            'fastboot', [])
        for sequence in sequences:
            mapped = _fastboot_sequence_map(sequence)
            if mapped[1]:
                self.internal_pipeline.add_action(
                    mapped[0](device_actions=mapped[1]))
            elif mapped[0]:
                self.internal_pipeline.add_action(mapped[0]())
        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())
Ejemplo n.º 3
0
    def populate(self, parameters):
        self.parameters = parameters
        self.pipeline = Pipeline(parent=self,
                                 job=self.job,
                                 parameters=parameters)

        if parameters.get("commands"):
            self.pipeline.add_action(BootFastbootCommands())

        board_id = self.job.device["fastboot_serial_number"]

        # Always ensure the device is in fastboot mode before trying to boot.
        # 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())
            self.pipeline.add_action(ResetDevice())
        else:
            self.pipeline.add_action(WaitDeviceBoardID(board_id))
            self.pipeline.add_action(EnterFastbootAction())

        # Based on the boot sequence defined in the device configuration, add
        # the required pipeline actions.
        sequences = self.job.device["actions"]["boot"]["methods"].get(
            "fastboot", [])
        for sequence in sequences:
            mapped = _fastboot_sequence_map(sequence)
            self.pipeline.add_action(WaitDeviceBoardID(board_id))
            if mapped[1]:
                self.pipeline.add_action(mapped[0](device_actions=mapped[1]))
            elif mapped[0]:
                self.pipeline.add_action(mapped[0]())
        if self.job.device.hard_reset_command:
            if not self.is_container():
                self.pipeline.add_action(PreOs())
            if self.has_prompts(parameters):
                self.pipeline.add_action(AutoLoginAction())
                if self.test_has_shell(parameters):
                    self.pipeline.add_action(ExpectShellSession())
                    if "transfer_overlay" in parameters:
                        self.pipeline.add_action(OverlayUnpack())
                    self.pipeline.add_action(ExportDeviceEnvironment())
        else:
            if not self.is_container():
                self.pipeline.add_action(ConnectAdb())
                self.pipeline.add_action(AdbOverlayUnpack())
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())
        '''
Ejemplo n.º 7
0
    def populate(self, parameters):
        self.internal_pipeline = Pipeline(parent=self,
                                          job=self.job,
                                          parameters=parameters)

        # Nexell Extension
        if 'nexell_ext' in parameters:
            self.logger.debug("[SEOJI] ****** parameters: %s", parameters)
            self.internal_pipeline.add_action(
                NexellFastbootBootAction(parameters))
            self.internal_pipeline.add_action(ConnectDevice())
            if self.has_prompts(parameters):
                if 'auto_login' in parameters:
                    self.internal_pipeline.add_action(AutoLoginAction())
            self.internal_pipeline.add_action(
                WaitForAdbDeviceForNexell(parameters))
            self.internal_pipeline.add_action(ApplyNexellOverlay())
            self.internal_pipeline.add_action(ExpectShellSession())
        else:
            if parameters.get("commands"):
                self.logger.debug("[SEOJI] boot - add BootFastbootCommands()")
                self.internal_pipeline.add_action(BootFastbootCommands())

            # Always ensure the device is in fastboot mode before trying to boot.
            # 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.logger.debug("[SEOJI] boot - add EnterFastbootAction")
                self.internal_pipeline.add_action(EnterFastbootAction())

            # Based on the boot sequence defined in the device configuration, add
            # the required pipeline actions.
            self.logger.debug("[SEOJI] get sequences")
            sequences = self.job.device['actions']['boot']['methods'].get(
                'fastboot', [])
            self.logger.debug("[SEOJI] sequences" + str(sequences))
            for sequence in sequences:
                mapped = _fastboot_sequence_map(sequence)
                if mapped[1]:
                    self.internal_pipeline.add_action(
                        mapped[0](device_actions=mapped[1]))
                elif mapped[0]:
                    self.internal_pipeline.add_action(mapped[0]())
            if self.job.device.hard_reset_command:
                if not is_lxc_requested(self.job):
                    self.internal_pipeline.add_action(PreOs())
                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())
            else:
                if not is_lxc_requested(self.job):
                    self.internal_pipeline.add_action(ConnectAdb())
                    self.internal_pipeline.add_action(AdbOverlayUnpack())