Skip to content

Unsupported --qemu-prog-path option (RDT-1450) #366

Description

@ysard

Describe the bug
Hi, the command --qemu-prog-path does not appear to be supported and generates an error.

Configuration Files

  • pytest.ini
[pytest]
addopts = --embedded-services idf,qemu -s
    --qemu-prog-path=~/project/qemu/bin/qemu-system-xtensa
    --build-dir=/tmp/pio_build_cache/qemu/
    --skip-regenerate-image=true
    --qemu-cli-args="-drive file=qemu_efuse.bin,if=none,format=raw,id=efuse -global driver=nvram.esp32s3.efuse,property=drive,value=efuse -nographic -machine esp32s3 -qmp tcp:127.0.0.1:42467,server,wait=off"

To Reproduce
Steps to reproduce the behavior:

  1. Run pytest --qemu-prog-path=~/project/qemu/bin/qemu-system-xtensa ... with a blank pytest.ini file or run pytest with the pytest.ini file above.
  2. Got error message :
~/.platformio/penv/bin/pytest  --qemu-prog-path=~/project/qemu/bin/qemu-system-xtensa

        _______________________________________________________ ERROR at setup of test_init ________________________________________________________

args = ()
kwargs = {'_fixture_classes_and_options': ClassCliOptions(classes={'app': <class 'pytest_embedded_qemu.app.QemuApp'>, 'qemu': <...08-20_14-17-33-706414/test_init', port_target_cache={}, port_app_cache={}, logfile_extension='.log'), 'qemu': None}}))}

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        if _COUNT == 1:
            if func.__name__ == 'dut_index':
                kwargs['count'] = 1
>           return func(*args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^

/home/xxx/.platformio/penv/lib/python3.11/site-packages/pytest_embedded/plugin.py:433:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/xxx/.platformio/penv/lib/python3.11/site-packages/pytest_embedded/plugin.py:1133: in app
    return app_fn(**locals())
           ^^^^^^^^^^^^^^^^^^
/home/xxx/.platformio/penv/lib/python3.11/site-packages/pytest_embedded/dut_factory.py:425: in app_fn
    return cls(**_drop_none_kwargs(kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/xxx/.platformio/penv/lib/python3.11/site-packages/pytest_embedded_qemu/app.py:150: in __init__
    super().__init__(**kwargs)
/home/xxx/.platformio/penv/lib/python3.11/site-packages/pytest_embedded_idf/app.py:50: in __init__
    super().__init__(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <pytest_embedded_qemu.app.QemuApp object at 0x7f332493cf50>
app_path = '~/project/code/test', build_dir = '/tmp/pio_build_cache/qemu/'
kwargs = {'qemu_prog_path': '~/project/qemu/bin/qemu-system-xtensa'}, k = 'qemu_prog_path'
v = '~/project/qemu/bin/qemu-system-xtensa'

    def __init__(
        self,
        app_path: Optional[str] = None,
        build_dir: Optional[str] = None,
        **kwargs,
    ):
        if app_path is None:
            app_path = os.getcwd()

        self.app_path = os.path.realpath(app_path)
        self.binary_path = self._get_binary_path(build_dir or 'build')

        for k, v in kwargs.items():
>           setattr(self, k, v)
E           AttributeError: property 'qemu_prog_path' of 'QemuApp' object has no setter

/home/xxx/.platformio/penv/lib/python3.11/site-packages/pytest_embedded/app.py:28: AttributeError

Expected behavior
We should not necessarily update the PATH variable for pytest to find the qemu binary.

Dev Environment

  • OS: Linux Debian testing
  • Python Version: 3.11.9
  • Pytest Version: 8.4.1
  • pytest-embedded Version: 1.16.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions