Fix test failures: Create missing mount dir

Tests were failing because mount dir was missing.
Unclear to me why this became only recently an issue
(github internal - out of the sudden tests were hanging).
This commit is contained in:
Bernd Schubert 2024-03-20 01:14:07 +01:00
parent 38d40c5bc1
commit 71a97226e8
3 changed files with 14 additions and 2 deletions

View File

@ -78,7 +78,7 @@ sanitized_build()
# bug, cf. https://groups.google.com/forum/#!topic/mesonbuild/tgEdAXIIdC4
meson configure -D b_lundef=false
meson configure
meson configure --no-pager
ninja
sudo ninja install
sudo chmod 4755 ${PREFIX_DIR}/bin/fusermount3

View File

@ -9,10 +9,11 @@ import subprocess
import pytest
import platform
import sys
import os
from looseversion import LooseVersion
from util import (wait_for_mount, umount, cleanup, base_cmdline,
safe_sleep, basename, fuse_test_marker, fuse_caps,
fuse_proto)
fuse_proto, create_tmpdir)
from os.path import join as pjoin
import os.path
@ -29,6 +30,9 @@ def test_write_cache(tmpdir, writeback, output_checker):
# deadlock in valgrind, it probably assumes that until close() returns,
# control does not come to the program.
mnt_dir = str(tmpdir)
print("mnt_dir: '" + mnt_dir + "'")
create_tmpdir(mnt_dir)
cmdline = [ pjoin(basename, 'test', 'test_write_cache'),
mnt_dir ]
if writeback:
@ -50,6 +54,7 @@ if fuse_proto >= (7,15):
@pytest.mark.parametrize("notify", (True, False))
def test_notify1(tmpdir, name, notify, output_checker):
mnt_dir = str(tmpdir)
create_tmpdir(mnt_dir)
cmdline = base_cmdline + \
[ pjoin(basename, 'example', name),
'-f', '--update-interval=1', mnt_dir ]
@ -80,6 +85,7 @@ def test_notify1(tmpdir, name, notify, output_checker):
@pytest.mark.parametrize("notify", (True, False))
def test_notify_file_size(tmpdir, notify, output_checker):
mnt_dir = str(tmpdir)
create_tmpdir(mnt_dir)
cmdline = base_cmdline + \
[ pjoin(basename, 'example', 'invalidate_path'),
'-f', '--update-interval=1', mnt_dir ]

View File

@ -151,6 +151,12 @@ def powerset(iterable):
return itertools.chain.from_iterable(
itertools.combinations(s, r) for r in range(len(s)+1))
def create_tmpdir(mnt_dir):
if not os.path.exists(mnt_dir):
print("makedirs: '" + mnt_dir + "'")
os.makedirs(mnt_dir)
else:
print("mnt_dir exists: '" + mnt_dir + "'")
# Use valgrind if requested
if os.environ.get('TEST_WITH_VALGRIND', 'no').lower().strip() \