How to use the labgrid.util.helper.processwrapper.check_output function in labgrid

To help you get started, we’ve selected a few labgrid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github labgrid-project / labgrid / labgrid / driver / powerdriver.py View on Github external
def off(self):
        cmd = shlex.split(self.cmd_off)
        processwrapper.check_output(cmd)
github labgrid-project / labgrid / labgrid / driver / openocddriver.py View on Github external
managed_configs.append(mconfig)

        cmd = self.interface.command_prefix+[self.tool]
        cmd += chain.from_iterable(("--search", path) for path in self.search)

        for mconfig in managed_configs:
            cmd.append("--file")
            cmd.append(mconfig.get_remote_path())

        cmd += self._get_usb_path_cmd()
        cmd += [
            "--command", "'init'",
            "--command", "'bootstrap {}'".format(mf.get_remote_path()),
            "--command", "'shutdown'",
        ]
        processwrapper.check_output(cmd)
github labgrid-project / labgrid / labgrid / driver / usbstoragedriver.py View on Github external
"seek={}".format(seek),
                "conv=fdatasync"
            ]
        elif mode == Mode.BMAPTOOL:
            if skip or seek:
                raise ExecutionError("bmaptool does not support skip or seek")
            args = [
                "bmaptool",
                "copy",
                "{}".format(mf.get_remote_path()),
                "{}{}".format(self.storage.path, partition),
            ]
        else:
            raise ValueError

        processwrapper.check_output(
            self.storage.command_prefix + args
        )
github labgrid-project / labgrid / labgrid / driver / sigrokdriver.py View on Github external
def off(self):
        processwrapper.check_output(
            self._get_sigrok_prefix() + ["--config", "enabled=no", "--set"]
        )
github labgrid-project / labgrid / labgrid / driver / usbloader.py View on Github external
def load(self, filename=None):
        if self.target.env:
            usb_loader = self.target.env.config.get_image_path(self.usb_loader)
            mf = ManagedFile(usb_loader, self.loader)
            mf.sync_to_resource()

        timeout = Timeout(3.0)
        while True:
            try:
                processwrapper.check_output(
                    self.loader.command_prefix +
                    [self.tool, 'db', mf.get_remote_path()]
                )
                break
            except subprocess.CalledProcessError:
                if timeout.expired:
                    raise

        if filename is None and self.image is not None:
            filename = self.target.env.config.get_image_path(self.image)
        mf = ManagedFile(filename, self.loader)
        mf.sync_to_resource()

        timeout = Timeout(3.0)
        while True:
            try: