Files
mars-dosutils/test/creator/cix_collect_xattr.sh
Mario Fetka f214e89d69 tests: add Novell DOS tool baseline suite
Add DOS-side baseline scripts for the Novell tools used to compare the
reimplemented public utilities.

The suite covers the current baseline set:

  MAP
  SLIST
  WHOAMI
  LOGIN / LOGOUT
  NDIR
  NCOPY
  FLAG
  FLAGDIR
  CREATOR
  RIGHTS
  GRANT
  REVOKE
  REMOVE

It also includes supporting trustee, rights, rename, move, delete and
file-operation tests.

Each test writes reproducible output into a per-tool CMP directory and
provides a matching ZIP helper for collecting the results. The ZIP
helpers clean generated test trees afterwards so SYS: does not keep
accumulating temporary directories.

This is the Novell baseline layer only. A later change can extend the
same scripts to run the full comparison cycle:

  NPUBLIC baseline -> PUBLIC implementation -> NPUBLIC control
2026-05-27 13:31:46 +02:00

65 lines
1.5 KiB
Bash

#!/bin/sh
#
# cix_collect_xattr.sh
#
# Linux-side collector for the CIXSTA CREATOR/xattr test.
#
# Run as root after CIXSTA.BAT and before CIXZIP.BAT:
# sudo ./cix_collect_xattr.sh
#
set -eu
SYS="/var/mars_nwe/SYS"
TREE="$SYS/CIXTEST"
OUT="$SYS/CIXCMP/LINUX"
mkdir -p "$OUT"
echo "CIX CREATOR xattr/stat collection" > "$OUT/collector_info.txt"
echo "Created: $(date)" >> "$OUT/collector_info.txt"
echo "Tree: $TREE" >> "$OUT/collector_info.txt"
echo >> "$OUT/collector_info.txt"
if ! command -v getfattr >/dev/null 2>&1; then
echo "ERROR: getfattr not installed. Install attr package." | tee "$OUT/getfattr_missing.txt"
exit 1
fi
find "$TREE" -xdev -print | sort > "$OUT/files.txt"
{
echo "path|uid|gid|mode|size|mtime|ctime|atime"
while IFS= read -r p; do
stat -c '%n|%u|%g|%a|%s|%y|%z|%x' "$p"
done < "$OUT/files.txt"
} > "$OUT/stat.txt"
{
while IFS= read -r p; do
echo "### $p"
getfattr -m - --absolute-names "$p" 2>/dev/null || true
echo
done < "$OUT/files.txt"
} > "$OUT/xattr_names.txt"
{
while IFS= read -r p; do
echo "### $p"
getfattr -d -m - -e hex --absolute-names "$p" 2>/dev/null || true
echo
done < "$OUT/files.txt"
} > "$OUT/getfattr.txt"
grep -iE 'mars|netware|trust|owner|creator|modifier|archiv|fileinfo|dos|attr|nwe' "$OUT/getfattr.txt" > "$OUT/xattr_focus.txt" || true
chmod -R a+r "$OUT"
echo "Wrote:"
echo " $OUT/collector_info.txt"
echo " $OUT/files.txt"
echo " $OUT/stat.txt"
echo " $OUT/xattr_names.txt"
echo " $OUT/getfattr.txt"
echo " $OUT/xattr_focus.txt"