def validate(self): super().validate() binary = which("simg2img") self.logger.info(debian_filename_version(binary)) which("mount") which("umount") binary = which("img2simg") self.logger.info(debian_filename_version(binary))
def validate(self): super().validate() boot = self.job.device["actions"]["boot"]["methods"]["pyocd"] pyocd_binary = boot["parameters"]["command"] binary = which(pyocd_binary) self.logger.info(debian_filename_version(binary, label=True)) self.base_command = [pyocd_binary] self.base_command.extend(boot["parameters"].get("options", [])) if self.job.device["board_id"] == "0000000000": self.errors = "[PYOCD] board_id unset" substitutions = {} self.base_command.extend(["--board", self.job.device["board_id"]]) for action in self.get_namespace_keys("download-action"): pyocd_full_command = [] image_arg = self.get_namespace_data( action="download-action", label=action, key="image_arg" ) action_arg = self.get_namespace_data( action="download-action", label=action, key="file" ) if image_arg: if not isinstance(image_arg, str): self.errors = "image_arg is not a string (try quoting it)" continue substitutions["{%s}" % action] = action_arg pyocd_full_command.extend(self.base_command) pyocd_full_command.extend(substitute([image_arg], substitutions)) self.exec_list.append(pyocd_full_command) else: pyocd_full_command.extend(self.base_command) pyocd_full_command.extend([action_arg]) self.exec_list.append(pyocd_full_command) if not self.exec_list: self.errors = "No PyOCD command to execute"
def test_dpkg(): # avoid checking the actual version binary = which("dpkg-query") assert debian_filename_version(binary) is not None
def test_dpkg(self): # avoid checking the actual version binary = which("dpkg-query") self.assertIsNotNone(debian_filename_version(binary, label=True))