Files
mars-nwe/tests/linux/CMakeLists.txt
OpenAI 995a1e6cd7
All checks were successful
Source release / source-package (push) Successful in 49s
nwconn: add AFP FinderInfo set smoke path
Implement a deliberately narrow write-safe slice of the WebSDK/NWAFP Set File Information semantics for the NCP 0x2222/35/16 AFP 2.0 Set File Information call.

The only accepted request bitmap is the FinderInfo bit (0x0020). The handler uses the same path-backed raw VOL:-style compatibility subset as the existing AFP get, scan, open-fork, and temporary-directory-handle smoke endpoints, resolves the effective NetWare volume from the path prefix, rejects entry-id-only lookup until persistent CNID/base-ID mapping exists, and rejects directory or non-FinderInfo writes rather than pretending to implement DOS attribute, timestamp, delete-protect, resource-fork, or broader Mac namespace write semantics.

Store the 32-byte FinderInfo block in mars_nwe-owned metadata under the source-level xattr name org.mars-nwe.afp.finder-info and teach the existing AFP file-info response builder to read that value before falling back to Netatalk/libatalk AppleDouble FinderInfo. This makes the write immediately verifiable through AFP 2.0 Get File Information without changing data-fork or resource-fork contents.

Add a small local xattr abstraction for mars_nwe-private metadata names. Netatalk exposes names such as org.netatalk.Metadata at the libatalk layer, but prefixes them with user. on Linux inside its EA wrapper. Mirror that behavior for mars_nwe so source code and documentation use org.mars-nwe.* consistently while Linux stores user.org.mars-nwe.* where the kernel requires a namespace prefix. Convert the existing archive/fileinfo xattr calls to the same wrapper so the previous org.mars-nwe.* namespace rename remains functional on Linux.

Add tests/linux/afp_set_file_info_smoke, which sends AFP 0x10 with a FinderInfo bitmap, then verifies the result through AFP 0x0f Get File Information. Document the smoke command, expected output, server-log shape, and the remaining unsupported Set File Information write semantics.

Tests: git diff --check; gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_set_file_info_smoke.c; cmake --build build-off --target nwconn with ENABLE_NETATALK_LIBATALK=OFF; cmake --build build-on --target nwconn with ENABLE_NETATALK_LIBATALK=ON against Netatalk-4.4.3 headers and local link stubs.
2026-05-30 11:29:33 +02:00

45 lines
1.7 KiB
CMake

# Optional Linux-side integration tests.
#
# These helpers are not built by default because they depend on the host
# ncpfs/libncp development files and on a running NetWare-compatible server.
find_path(NCPFS_INCLUDE_DIR
NAMES ncp/nwcalls.h ncp/ncplib.h
)
find_library(NCPFS_LIBRARY
NAMES ncp
)
if(NOT NCPFS_INCLUDE_DIR OR NOT NCPFS_LIBRARY)
message(FATAL_ERROR
"MARS_NWE_BUILD_LINUX_TESTS requires ncpfs/libncp headers and libncp. "
"Install the ncpfs development package or disable MARS_NWE_BUILD_LINUX_TESTS."
)
endif()
add_executable(afp_entry_id_smoke afp_entry_id_smoke.c)
target_include_directories(afp_entry_id_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_entry_id_smoke ${NCPFS_LIBRARY})
add_executable(afp_file_info_smoke afp_file_info_smoke.c)
target_include_directories(afp_file_info_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_file_info_smoke ${NCPFS_LIBRARY})
add_executable(afp_scan_info_smoke afp_scan_info_smoke.c)
target_include_directories(afp_scan_info_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_scan_info_smoke ${NCPFS_LIBRARY})
add_executable(afp_open_file_fork_smoke afp_open_file_fork_smoke.c)
target_include_directories(afp_open_file_fork_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_open_file_fork_smoke ${NCPFS_LIBRARY})
add_executable(afp_temp_dir_handle_smoke afp_temp_dir_handle_smoke.c)
target_include_directories(afp_temp_dir_handle_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_temp_dir_handle_smoke ${NCPFS_LIBRARY})
add_executable(afp_set_file_info_smoke afp_set_file_info_smoke.c)
target_include_directories(afp_set_file_info_smoke PRIVATE ${NCPFS_INCLUDE_DIR})
target_link_libraries(afp_set_file_info_smoke ${NCPFS_LIBRARY})