qemu-e2k/tests/avocado
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
..
acpi-bits acpi/tests/avocado/bits: add SPDX license identifiers for bios bits tests 2022-12-21 07:32:24 -05:00
avocado_qemu python/machine: Fix AF_UNIX path too long on macOS 2023-01-24 13:37:13 -05:00
virtiofs_submounts.py.data
acpi-bits.py acpi/tests/avocado/bits: add mformat as one of the dependencies 2022-12-21 07:32:24 -05:00
boot_linux_console.py tests/avocado: Add SD boot test to Cubieboard 2023-01-12 16:50:19 +00:00
boot_linux.py tests/avocado: skip aarch64 cloud TCG tests in CI 2022-11-22 09:52:23 +00:00
boot_xen.py
cpu_queries.py
empty_cpu_model.py
hotplug_cpu.py
info_usernet.py tests/avocado: set -machine none for userfwd and vnc tests 2022-10-31 20:37:59 +00:00
intel_iommu.py
linux_initrd.py
linux_ssh_mips_malta.py
load_bflt.py
machine_aarch64_virt.py tests/avocado: introduce alpine virt test for CI 2022-11-22 09:52:23 +00:00
machine_arm_canona1100.py tests/avocado: Update the URLs of the advent calendar images 2022-11-23 10:58:48 +01:00
machine_arm_integratorcp.py
machine_arm_n8x0.py
machine_aspeed.py tests/avocado/machine_aspeed.py: Reduce noise on the console for SDK tests 2022-11-22 09:48:57 +00:00
machine_avr6.py
machine_m68k_nextcube.py
machine_microblaze.py tests/avocado: Update the URLs of the advent calendar images 2022-11-23 10:58:48 +01:00
machine_mips_fuloong2e.py
machine_mips_loongson3v.py
machine_mips_malta.py tests/avocado: Add tests booting YAMON ROM on MIPS Malta machines 2023-01-13 09:32:32 +01:00
machine_rx_gdbsim.py
machine_s390_ccw_virtio.py target/s390x: support PRNO_TRNG instruction 2022-09-26 17:23:11 +02:00
machine_sparc64_sun4u.py tests/avocado: Update the URLs of the advent calendar images 2022-11-23 10:58:48 +01:00
machine_sparc_leon3.py
migration.py tests/avocado/migration: Get find_free_port() from the ports 2022-08-30 07:55:43 +02:00
multiprocess.py
pc_cpu_hotplug_props.py
ppc_74xx.py
ppc_405.py
ppc_bamboo.py tests/avocado: Add missing require_netdev('user') checks 2022-10-11 17:25:50 +02:00
ppc_mpc8544ds.py tests/avocado: Update the URLs of the advent calendar images 2022-11-23 10:58:48 +01:00
ppc_prep_40p.py
ppc_pseries.py
ppc_virtex_ml507.py tests/avocado: Update the URLs of the advent calendar images 2022-11-23 10:58:48 +01:00
README.rst
replay_kernel.py tests/avocado: Update the URLs of the advent calendar images 2022-11-23 10:58:48 +01:00
replay_linux.py tests/avocado: Do not run tests that require libslirp if it is not available 2022-08-29 15:28:51 +02:00
reverse_debugging.py
riscv_opensbi.py tests/avocado: add RISC-V OpenSBI boot test 2023-01-20 10:14:13 +10:00
smmu.py
tcg_plugins.py
tesseract_utils.py
version.py
virtio_check_params.py
virtio_version.py
virtio-gpu.py
virtiofs_submounts.py
vnc.py tests/avocado: set -machine none for userfwd and vnc tests 2022-10-31 20:37:59 +00:00
x86_cpu_model_versions.py

=============================================
Integration tests using the Avocado Framework
=============================================

This directory contains integration tests. They're usually higher
level, and may interact with external resources and with various
guest operating systems.

For more information, please refer to ``docs/devel/testing.rst``,
section "Integration tests using the Avocado Framework".