Beispiel #1
0
 def populate(self, parameters):
     """
     PowerOff commands will include recovery mode switching commands
     so that when jobs end, the device is available.
     Use PowerOn instead of ResetDevice so that the effect of the
     switching is preserved until the recovery boot action which
     specifies the 'exit' command.
     """
     super().populate(parameters)
     self.pipeline = Pipeline(parent=self,
                              job=self.job,
                              parameters=parameters)
     if parameters["commands"] == "recovery":
         # only switch into recovery mode with power off.
         self.pipeline.add_action(PowerOff())
         self.pipeline.add_action(
             SwitchRecoveryCommand(mode="recovery_mode"))
         self.pipeline.add_action(PowerOn())
     elif parameters["commands"] == "exit":
         self.pipeline.add_action(PowerOff())
         self.pipeline.add_action(
             SwitchRecoveryCommand(mode="recovery_exit"))
         self.pipeline.add_action(PowerOn())
     else:
         self.errors = "Invalid recovery command"
Beispiel #2
0
 def populate(self, parameters):
     self.expect_shell = parameters.get('expect_shell', True)
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     self.internal_pipeline.add_action(BootloaderSecondaryMedia())
     self.internal_pipeline.add_action(BootloaderCommandOverlay())
     self.internal_pipeline.add_action(ConnectDevice())
     # FIXME: reset_device is a hikey hack due to fastboot/OTG issues
     # remove as part of LAVA-940 - convert to use fastboot-sequence
     reset_device = self.job.device['actions']['boot']['methods'].get(
         'grub-efi', {}).get('reset_device', True)
     if parameters['method'] == 'grub-efi' and reset_device:
         # added unless the device specifies not to reset the device in grub.
         self.internal_pipeline.add_action(ResetDevice())
     elif parameters['method'] == 'grub':
         self.internal_pipeline.add_action(ResetDevice())
     if parameters['method'] == 'grub-efi':
         self.internal_pipeline.add_action(UEFIMenuInterrupt())
         self.internal_pipeline.add_action(GrubMenuSelector())
     self.internal_pipeline.add_action(BootloaderInterruptAction())
     self.internal_pipeline.add_action(BootloaderCommandsAction())
     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 self.has_boot_finished(parameters):
             self.logger.debug("Doing a boot without a shell (installer)")
             self.internal_pipeline.add_action(InstallerWait())
             self.internal_pipeline.add_action(PowerOff())
Beispiel #3
0
 def populate(self, parameters):
     super(GrubSequenceAction, self).populate(parameters)
     self.internal_pipeline = Pipeline(parent=self,
                                       job=self.job,
                                       parameters=parameters)
     sequences = self.job.device['actions']['boot']['methods']['grub'].get(
         'sequence', [])
     for sequence in sequences:
         mapped = _grub_sequence_map(sequence)
         if mapped[1]:
             self.internal_pipeline.add_action(mapped[0](type=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())
     else:
         if self.has_boot_finished(parameters):
             self.logger.debug("Doing a boot without a shell (installer)")
             self.internal_pipeline.add_action(InstallerWait())
             self.internal_pipeline.add_action(PowerOff())
Beispiel #4
0
    def populate(self, parameters):
        download_dir = self.mkdtemp()
        self.internal_pipeline = Pipeline(parent=self,
                                          job=self.job,
                                          parameters=parameters)
        self.internal_pipeline.add_action(DisconnectDevice())
        self.internal_pipeline.add_action(ResetDevice())
        self.internal_pipeline.add_action(WaitUSBMassStorageDeviceAction())
        for image in parameters["images"].keys():
            self.internal_pipeline.add_action(
                DownloaderAction(image, path=download_dir))
        self.internal_pipeline.add_action(MountVExpressMassStorageDevice())
        # Sort the keys so recovery_image will be first
        for image in sorted(parameters["images"].keys()):
            if image == "recovery_image":
                self.internal_pipeline.add_action(
                    ExtractVExpressRecoveryImage())
                self.internal_pipeline.add_action(
                    DeployVExpressRecoveryImage())
            else:
                self.internal_pipeline.add_action(DeployMPSTestBinary(image))

        # Should we hard reboot the board after flash?
        params = self.job.device["actions"]["deploy"]["methods"]["mps"][
            "parameters"]
        if params["hard-reboot"]:
            # Unmount the mass storage device before rebooting
            self.internal_pipeline.add_action(
                UnmountVExpressMassStorageDevice())
            self.internal_pipeline.add_action(PowerOff())
        else:
            # Unmount the mass storage device after the creation of reboot.txt
            self.internal_pipeline.add_action(DeployMPSRebootTxt())
            self.internal_pipeline.add_action(
                UnmountVExpressMassStorageDevice())
Beispiel #5
0
 def populate(self, parameters):
     super().populate(parameters)
     self.pipeline = Pipeline(parent=self,
                              job=self.job,
                              parameters=parameters)
     sequences = self.job.device["actions"]["boot"]["methods"]["grub"].get(
         "sequence", [])
     for sequence in sequences:
         mapped = _grub_sequence_map(sequence)
         if mapped[1]:
             self.pipeline.add_action(mapped[0](itype=mapped[1]))
         elif mapped[0]:
             self.pipeline.add_action(mapped[0]())
     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 self.has_boot_finished(parameters):
             self.logger.debug("Doing a boot without a shell (installer)")
             self.pipeline.add_action(InstallerWait())
             self.pipeline.add_action(PowerOff())