# DOS utility regression tests

This directory contains DOS-side comparison and regression tests for the
`mars-dosutils` tools.  The tests are meant for maintainer use against a MARS-NWE
`SYS:` tree that also contains the original Novell tools in `SYS:NPUBLIC` and
`SYS:NLOGIN`.

Most tests compare captured Novell output with the current public implementation
byte-for-byte.  Some tests also switch to a normal user and read back effective
rights, because matching command output alone is not enough for trustee tools.

## Output naming convention

The generated result trees use these names consistently:

```text
OUT       Novell reference output from SYS:NPUBLIC or SYS:NLOGIN
PUBOUT    current implementation output from SYS:PUBLIC or SYS:LOGIN
COMPARE.LOG

UNOV      Novell readback while logged in as NOPASSUSER
UPUB      public readback while logged in as NOPASSUSER
UCOMP.LOG

LOUT      Novell output while logged out, usually from SYS:NLOGIN copy
LPUBOUT   public output while logged out, usually from SYS:LOGIN copy
LCOMP.LOG
```

Not every test has every directory.  For example, SLIST has `LOUT`/`LPUBOUT`,
while trustee tools usually have `UNOV`/`UPUB`.

## User switching and local helpers

Tests that must survive a `LOGOUT` use `DLYSTRT.EXE` and a local helper directory
on `C:`.  This is required because logging out removes `F:` and normal network
mappings.  The common pattern is:

1. run the main `*STA.BAT` as `SUPERVISOR` from `F:`,
2. copy the helper `*C.BAT`, `DLYSTRT.EXE`, and required tools to `C:\*TMP`,
3. queue the helper with `DLYSTRT`,
4. let the helper log out, perform the user or logged-out checks, log back in,
5. queue `F:\*STA.BAT PART2`,
6. compare and package the captured files.

For automatic re-login, set the Supervisor password before starting the test:

```bat
SET LGNTPWD=your-supervisor-password
```

`LGNTPWD` is used only by maintainer tests and should not be committed to any
script or log.

## Test index

| Directory | Main script | Current purpose/status |
| --- | --- | --- |
| `creator/` | `CIXSTA.BAT` | CREATOR metadata/xattr test plus optional `NOPASSUSER` readback. |
| `flag/` | `FLGTSTA.BAT` | `NPUBLIC\FLAG` vs `PUBLIC\FLAG`, including user-context readback. |
| `flagdir/` | `FDGTSTA.BAT` | `NPUBLIC\FLAGDIR` vs `PUBLIC\FLAGDIR`, including user-context readback. |
| `grant/` | `GRNTSTA.BAT` | `NPUBLIC\GRANT` vs `PUBLIC\GRANT`, rights matrix and `NOPASSUSER` readback. |
| `login/` | `LGNTSTA.BAT` | Maintainer baseline for Novell LOGIN/LOGOUT/MAP flow. |
| `logout/` | see `login/` | LOGOUT is covered by the LOGIN baseline flow. |
| `map/` | `MAPTSTA.BAT` | Novell MAP baseline and root/non-root mapping semantics; full PUBLIC comparison still pending. |
| `ndir/` | `NDIRTSTA.BAT` | `NPUBLIC\NDIR` vs `PUBLIC\NDIR`, matrix, filters, `/SUB`, `/RIGHTS`, user readback. |
| `remove/` | `RMVSTA.BAT` | `NPUBLIC\REMOVE` vs `PUBLIC\REMOVE`, matrix and `NOPASSUSER` readback. |
| `revoke/` | `RVKSTA.BAT` | `NPUBLIC\REVOKE` vs `PUBLIC\REVOKE`, matrix and `NOPASSUSER` readback. |
| `rights/` | `RGHTSTA.BAT` | `NPUBLIC\RIGHTS` vs `PUBLIC\RIGHTS`, direct effective-rights cases. |
| `slist/` | `SLSTSTA.BAT` | `NPUBLIC\SLIST` vs `PUBLIC\SLIST` while logged in, plus `NLOGIN\SLIST` vs `LOGIN\SLIST` while logged out. |
| `whoami/` | `WHOSTA.BAT` | `NPUBLIC\WHOAMI` vs `PUBLIC\WHOAMI`. |
| `rightsuser/` | varies | Additional user-rights experiments. |
| `renmove/` | varies | Rename/move experiments. |
| `ncopy/` | varies | NCOPY experiments. |
| `filer/` | varies | FILER-related notes/experiments. |

## Packaging

Most test directories have a matching `*ZIP.BAT` that packages the result tree
under `SYS:`.  After that, include a recent server log from Linux, for example:

```sh
sudo ./mars_packtest_v3.sh slststa 5 mario
```

Use the test-specific README for exact ZIP names and any Linux-side collector
steps.

## Current high-level status

Recently green comparison tests:

```text
CREATOR readback
FLAG
FLAGDIR
GRANT
NDIR
REMOVE
REVOKE
RIGHTS
SLIST logged-in and logged-out
WHOAMI
```

LOGIN/LOGOUT are covered by the maintainer baseline.  MAP still needs a full
`PUBLIC\MAP` vs Novell comparison beyond the current baseline/semantics test.
