debian-forge/osbuild
Michael Vogt 4026d4dc10 test: add test that ensures mount output is part of the exception
While debugging a failure of osbuild-composer [0] on fc39 it was
noticed that a mount failure does not include the output of
the mount command:
```
  File "/usr/lib/python3.12/site-packages/osbuild/mounts.py", line 78, in mount
    path = client.call("mount", args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/osbuild/host.py", line 348, in call
    ret, _ = self.call_with_fds(method, args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/osbuild/host.py", line 384, in call_with_fds
    raise error
osbuild.host.RemoteError: CalledProcessError: Command '['mount', '-t', 'xfs', '-o', 'ro,norecovery', '--source', '/dev/rootvg/applv', '--target', '/tmp/tmpjtfmth56/app']' returned non-zero exit status 32.
   File "/usr/lib/python3.12/site-packages/osbuild/host.py", line 268, in serve
    reply, reply_fds = self._handle_message(msg, fds)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/osbuild/host.py", line 301, in _handle_message
    ret, fds = self.dispatch(name, args, fds)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/osbuild/mounts.py", line 111, in dispatch
    r = self.mount(args)
        ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/osbuild/mounts.py", line 160, in mount
    subprocess.run(
  File "/usr/lib64/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
```
which makes diagnostic errors harder of course. This commit adds
a test that ensures that mount output is visbile and also changes
the code to include it.

[0] https://github.com/osbuild/osbuild-composer/pull/3820
2023-12-11 11:24:17 +01:00
..
formats tox: add tox 2023-08-01 15:01:13 +02:00
testutil osbuild: testutil provides has_executable 2023-11-10 12:03:23 +01:00
util test: add test that ensures mount output is part of the exception 2023-12-11 11:24:17 +01:00
__init__.py Post release version bump 2023-12-06 08:15:39 +00:00
__main__.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
api.py Fix errors reported by new version of mypy 2023-04-12 11:57:18 +02:00
buildroot.py tox: add tox 2023-08-01 15:01:13 +02:00
devices.py devices: new helper to ensure a device node exists 2022-11-22 18:28:38 +01:00
host.py tox: add tox 2023-08-01 15:01:13 +02:00
inputs.py inputs: Move arguments for InputService.map to a temporary file 2023-06-27 10:56:10 +02:00
loop.py devices/loopback: make setting sector_size meaningful 2023-11-29 10:37:08 +01:00
main_cli.py autopep8: Update with changes to make autopep8 -a -a -a happy 2023-08-10 13:04:14 +02:00
meta.py osbuild. add comment why AST is used and not importlib 2023-11-22 09:52:47 +01:00
monitor.py osbuild: improve monitor docstrings/signatures 2023-11-28 09:56:56 +01:00
mounts.py mounts/org.osbuild.btrfs: add support for compression 2023-08-25 12:35:56 +02:00
objectstore.py objectstore: also mount /etc/containers for "host" buildroot 2023-10-25 22:05:54 +02:00
pipeline.py osbuild: --checkpoint can now use globs 2023-08-04 19:59:11 +02:00
remoteloop.py loop: use LOOP_CONFIGURE instead of LOOP_SET_FD 2023-05-05 15:42:47 +02:00
sources.py Fix errors reported by new version of mypy 2023-04-12 11:57:18 +02:00