Files
mars-nwe/tests/linux/CMakeLists.txt
Mario Fetka 03a5d69dc4
All checks were successful
Source release / source-package (push) Successful in 48s
nwconn: implement AFP Get File Information
Wire NCP 0x23/0x05 AFP Get File Information to a conservative read-only reply
for SYS:-style paths.

The WebSDK documents NCP 0x2222/35/05 as taking a Volume Number, AFP Entry ID,
request bit map, and AFP path modifier string, and returning an AFP file
information record with entry id, parent id, attributes, data and resource fork
lengths, offspring count, NetWare dates, Finder Info, long and short names,
owner id, access privileges, and ProDOS information. The SDK headers expose the
same call as AFPGetFileInformation() and NWAFPGetFileInformation(), with the
wire reply matching RECPKT_AFPFILEINFO.

Resolve the supplied path through the existing mars_nwe path machinery, require
the optional Netatalk/libatalk backend as for the entry-id probe, and fill the
fields that can be derived safely from Unix stat data and the existing libatalk
helpers. Finder Info and resource fork length are read through nwatalk when
present; entry ids fall back to the existing stat-derived AFP id until
persistent CNID/AppleDouble ids are implemented. Parent id and ProDOS-specific
data remain zero for now.

Add a Linux afp_file_info_smoke test using ncpfs/libncp so the new call can be
exercised without an AppleTalk client. The test sends raw SYS:-style paths with
directory handle 0, matching the verified AFP Entry ID smoke-test path.

This implements only the read-only AFP file information query for path-based
requests; entry-id-only lookup, persistent CNID mapping, and write-side AFP
semantics remain future work.
2026-05-30 03:59:50 +02:00

28 lines
946 B
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})