Commit 950ba459 authored by Marc Vef's avatar Marc Vef
Browse files

Merge branch 'marc/298-tests-fail-when-symlink-support-is-disabled' into 'master'

Resolve "Tests fail when symlink support is disabled"

This MR does several things:
1. `SUPPORT_SYMLINKS` is now disabled by default. It didn't do much in the first place and only affects incomplete code. The corresponding README entry has been removed. The only thing it does support is accessing GekkoFS from a foreign namespace via a symbolic link. However, only `stat` seems to be working.
2. `GKFS_FOLLOW_EXTERNAL_SYMLINKS` was also disabled by default in this [MR](!183). This caused the `test_symlink` to fail as it tested external symlinks into GekkoFS, not actual symlinks within GekkoFS. This can only be done via `lstat()` for each component of the path which is a performance risk under certain circumstances. Overall, this is the relevant CMake variable for the test.
3. Unify code formatting for CMake files.

Closes #298

Closes #298

See merge request !198
parents f0744a49 a2bda41a
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -71,6 +71,8 @@ replicas ([!166](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/141)

- An issue that updated the last modified time of a file during `stat` operations was
  fixed([!176](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_request/176)).
- Fixed a dependency conflict within the pytest dependency marshmallow ([!197](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_request/197)).
- Fixed an issue with testing external symbolic links ([!198](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_request/198)).

## [0.9.2] - 2024-02

+207 −207
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ gkfs_define_option(
gkfs_define_option(
    GKFS_SYMLINK_SUPPORT
    HELP_TEXT "Enable support for symlinks"
  DEFAULT_VALUE ON
    DEFAULT_VALUE OFF
    DESCRIPTION "Enable support for symbolic links in paths"
)

+1 −2
Original line number Diff line number Diff line
@@ -478,8 +478,7 @@ srun: sending Ctrl-C to StepId=282378.2
- `GKFS_MAX_INTERNAL_FDS` - Number of file descriptors reserved for internal use (default: 256)
- `GKFS_MAX_OPEN_FDS` - Maximum number of open file descriptors supported (default: 1024)
- `GKFS_RENAME_SUPPORT` - Enable support for rename (default: OFF)
- `GKFS_SYMLINK_SUPPORT` - Enable support for symlinks (default: ON)
- `GKFS_FOLLOW_EXTERNAL_SYMLINKS` - Enable support for following external links for resolving the path (default: OFF)
- `GKFS_FOLLOW_EXTERNAL_SYMLINKS` - Enable support for following external links into the GekkoFS namespace (default: OFF)
- `GKFS_USE_LEGACY_PATH_RESOLVE` - Use the legacy implementation of the resolve function, deprecated (default: OFF)
- `GKFS_USE_GUIDED_DISTRIBUTION` - Use guided data distributor (default: OFF)
- `GKFS_USE_GUIDED_DISTRIBUTION_PATH` - File Path for guided distributor (default: /tmp/guided.txt)
+88 −84
Original line number Diff line number Diff line
@@ -65,11 +65,15 @@ gkfs_enable_python_testing(
)

# define CTest tests for functional test groups
set(DIRECTORY_TESTS "directories/test_directories.py;directories/test_pathresolution.py")
if (GKFS_FOLLOW_EXTERNAL_SYMLINKS)
    set(DIRECTORY_TESTS "${DIRECTORY_TESTS}" ";directories/test_external_symlink.py")
endif ()
gkfs_add_python_test(
    NAME test_directories
    PYTHON_VERSION 3.6
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests/integration
    SOURCE directories/
    SOURCE ${DIRECTORY_TESTS}
)

if (GLIBC_HAS_STATX)
@@ -146,7 +150,7 @@ if(GKFS_INSTALL_TESTS)
        PATTERN "gkfs.io" EXCLUDE
    )

    if(GKFS_SYMLINK_SUPPORT)
    if (GKFS_FOLLOW_EXTERNAL_SYMLINKS)
        install(DIRECTORY directories
            DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/gkfs/tests/integration
            FILES_MATCHING
@@ -161,7 +165,7 @@ if(GKFS_INSTALL_TESTS)
            REGEX ".*\\.py"
            PATTERN "__pycache__" EXCLUDE
            PATTERN ".pytest_cache" EXCLUDE
        PATTERN "test_symlink.py" EXCLUDE
            PATTERN "test_external_symlink.py" EXCLUDE

        )
    endif ()
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ from harness.logger import logger
nonexisting = "nonexisting"

#@pytest.mark.xfail(reason="invalid errno returned on success")
def test_symlink(gkfs_daemon, gkfs_client):
def test_external_symlink(gkfs_daemon, gkfs_client):
    """Testing different path resolution capabilities: symlinks"""
    pid = os.getpid().__str__()
    mountdir = gkfs_daemon.mountdir
+122 −122

File changed.

Contains only whitespace changes.

+39 −39

File changed.

Contains only whitespace changes.

+7 −7

File changed.

Contains only whitespace changes.

+17 −17

File changed.

Contains only whitespace changes.

+118 −118

File changed.

Contains only whitespace changes.

+155 −155

File changed.

Contains only whitespace changes.

+3 −3

File changed.

Contains only whitespace changes.

+3 −3

File changed.

Contains only whitespace changes.

+18 −18

File changed.

Contains only whitespace changes.

+35 −35

File changed.

Contains only whitespace changes.

+23 −23

File changed.

Contains only whitespace changes.

+133 −133

File changed.

Contains only whitespace changes.

+3 −3

File changed.

Contains only whitespace changes.

+427 −427

File changed.

Contains only whitespace changes.

+65 −65

File changed.

Contains only whitespace changes.

+118 −118

File changed.

Contains only whitespace changes.

+5 −5

File changed.

Contains only whitespace changes.

+7 −7

File changed.

Contains only whitespace changes.

+4 −4

File changed.

Contains only whitespace changes.

Loading