qemu-e2k/tests
Peter Delevoryas f9922937d1 python/machine: Fix AF_UNIX path too long on macOS
On macOS, private $TMPDIR's are the default. These $TMPDIR's are
generated from a user's unix UID and UUID [1], which can create a
relatively long path:

    /var/folders/d7/rz20f6hd709c1ty8f6_6y_z40000gn/T/

QEMU's avocado tests create a temporary directory prefixed by
"avo_qemu_sock_", and create QMP sockets within _that_ as well.
The QMP socket is unnecessarily long, because a temporary directory
is created for every QEMUMachine object.

    /avo_qemu_sock_uh3w_dgc/qemu-37331-10bacf110-monitor.sock

The path limit for unix sockets on macOS is 104: [2]

    /*
     * [XSI] Definitions for UNIX IPC domain.
     */
    struct  sockaddr_un {
        unsigned char   sun_len;        /* sockaddr len including null */
        sa_family_t     sun_family;     /* [XSI] AF_UNIX */
        char            sun_path[104];  /* [XSI] path name (gag) */
    };

This results in avocado tests failing on macOS because the QMP unix
socket can't be created, because the path is too long:

    ERROR| Failed to establish connection: OSError: AF_UNIX path too long

This change resolves by reducing the size of the socket directory prefix
and the suffix on the QMP and console socket names.

The result is paths like this:

    pdel@pdel-mbp:/var/folders/d7/rz20f6hd709c1ty8f6_6y_z40000gn/T
    $ tree qemu*
    qemu_df4evjeq
    qemu_jbxel3gy
    qemu_ml9s_gg7
    qemu_oc7h7f3u
    qemu_oqb1yf97
    ├── 10a004050.con
    └── 10a004050.qmp

[1] https://apple.stackexchange.com/questions/353832/why-is-mac-osx-temp-directory-in-weird-path
[2] /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/sys/un.h

Signed-off-by: Peter Delevoryas <peter@pjd.dev>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230110082930.42129-2-peter@pjd.dev
Signed-off-by: John Snow <jsnow@redhat.com>
2023-01-24 13:37:13 -05:00
..
avocado python/machine: Fix AF_UNIX path too long on macOS 2023-01-24 13:37:13 -05:00
bench cleanup: Tweak and re-run return_directly.cocci 2022-12-14 16:19:35 +01:00
data tests: acpi: aarch64: Add *.topology tables 2023-01-08 01:54:23 -05:00
decode decodetree: Extend argument set syntax to allow types 2021-05-01 11:45:35 -07:00
docker tests/docker: use prebuilt toolchain for debian-hexagon-cross 2022-12-23 15:16:31 +00:00
fp enforce use of G_GNUC_PRINTF attributes 2023-01-11 10:44:34 +01:00
guest-debug tests/guest-debug: better handle gdb crashes 2022-04-20 16:04:20 +01:00
image-fuzzer image-fuzzer: Use OSerror.strerror instead of tuple subscript 2019-11-05 16:36:11 +01:00
include tests: add missing generated sources to testqapi 2020-10-17 10:45:50 -04:00
keys tests/vm: Add Haiku test based on their vagrant images 2020-11-17 09:45:24 +01:00
lcitool ci: replace x86_64 macos-11 with aarch64 macos-12 2022-11-17 09:58:11 +01:00
migration tests/migration: remove the unused local variable 2022-10-11 12:37:12 +02:00
multiboot Remove superfluous .gitignore files 2020-10-13 12:48:17 +02:00
perf/block/qcow2
plugin tests/plugins: add instruction matching to libinsn.so 2022-02-09 12:08:42 +00:00
qapi-schema tests/qapi-schema: remove Meson workaround 2023-01-06 00:51:02 +01:00
qemu-iotests qemu-iotests/stream-under-throttle: do not shutdown QEMU 2023-01-09 13:50:13 +01:00
qtest trivial branch pull request 20230118 2023-01-19 15:05:29 +00:00
rocker
tcg First RISC-V PR for QEMU 8.0 2023-01-06 22:15:53 +00:00
tsan tests/docker: Added docker build support for TSan. 2020-06-16 14:49:05 +01:00
uefi-test-tools Remove superfluous .gitignore files 2020-10-13 12:48:17 +02:00
unit Header cleanup patches for 2023-01-20 2023-01-20 13:17:55 +00:00
vm tests/vm/haiku.x86_64: Update the Haiku VM to Beta 4 2023-01-18 12:27:21 +01:00
vmstate-static-checker-data hw: Replace anti-social QOM type names 2021-03-19 15:18:43 +01:00
Makefile.include configure: move tests/tcg/Makefile.prereqs to root build directory 2022-10-06 11:53:40 +01:00
check-block.sh tests/qemu-iotests: Move the bash and sanitizer checks to meson.build 2022-04-20 09:46:54 +02:00
dbus-vmstate-daemon.sh tests: add dbus-vmstate-test 2020-01-06 18:41:32 +04:00
meson.build meson: create have_vhost_* variables 2022-05-07 07:46:58 +02:00
requirements.txt tests: install "qemu" namespace package into venv 2022-06-06 09:26:54 +02:00
test-qht-par.c
vhost-user-bridge.c error handling: Use RETRY_ON_EINTR() macro where applicable 2023-01-09 13:50:47 +01:00