# LOGIN / LOGOUT baseline test

`LGNTSTA` is an automated maintainer baseline test for Novell `LOGIN`, `LOGOUT`, and `MAP`.

This test does **not** overwrite `SYS:LOGIN`, `SYS:PUBLIC`, or `SYS:NPUBLIC`. It copies the Novell tools to a temporary local directory on `C:` and runs from there. `LOGIN` and `MAP` are copied from `SYS:NLOGIN`; `LOGOUT` is copied from `SYS:NPUBLIC`. The maintainer helper `DLYSTRT.EXE` is also copied to `C:\LGNTTMP` before it is used, so the delayed phase no longer depends on `F:` or `PUBLIC` being visible.

## Required setup

User `NOPASSUSER` must exist on `MARS` and must be able to login without a password.

For a fully automated run, the DOS tools must be built with `MAINTAINER_BUILD=ON` so `LOGIN /PWD:` and `DLYSTRT` are available.

Set the supervisor password in the DOS environment before starting:

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

The password is not written to `RUN.LOG` or `HELPER.TXT`, but it is still present in the DOS environment during the test. Use this only for maintainer testing.

## Run

Start while logged in as `SUPERVISOR`:

```bat
F:\LGNTSTA
```

`LGNTSTA` prepares `C:\LGNTTMP`, copies the local helper there, and installs:

```bat
C:
CD \LGNTTMP
DLYSTRT /T:2 LGNTC.BAT
```

Then `LGNTSTA` exits after switching to `C:\LGNTTMP`. After the delay, `DLYSTRT` types `LGNTC.BAT` into the local `C:` prompt, and the helper does:

```text
LOGOUT
LOGIN NOPASSUSER
MAP
LOGOUT
LOGIN SUPERVISOR /PWD:%LGNTPWD%
F:\LGNTSTA PART2
F:\LGNTZIP
```

If `LGNTPWD` is not set, `LGNTSTA` does not start Part 1 at all. It prints a short usage hint with the required `SET LGNTPWD=...` command and does not install `DLYSTRT`, so the test cannot accidentally log out and then stop half-way through.

## Expected output files

`F:\LGNTCMP\OUT` contains:

```text
D01_LOG.OUT   LOGOUT output from initial supervisor session
D02_LGIN.OUT  LOGIN NOPASSUSER output
D03_MAP.OUT   MAP output after NOPASSUSER login
D04_LGOT.OUT  LOGOUT output from NOPASSUSER session
D05_LGSU.OUT  LOGIN SUPERVISOR /PWD output, if LGNTPWD was set
D99_HELP.OUT  simulated LOGIN usage line for later comparison
HELPER.TXT    helper trace
```

`D99_HELP.OUT` is intentionally produced with `ECHO`, because Novell `LOGIN /?` may not redirect help text reliably.

## Implementation note

After `LOGOUT`, the network drive `F:` disappears. Therefore `LGNTSTA` must finish before logout happens. `DLYSTRT` provides that gap by returning to DOS first. `LGNTSTA` switches to `C:\LGNTTMP` before installing it, so the delayed command is typed into a local `C:` prompt instead of an `F:` prompt.

After `LOGIN NOPASSUSER`, DOS/NetWare may change the current drive/search path. `LGNTC.BAT` therefore calls `C:\LGNTTMP\LOGIN`, `C:\LGNTTMP\MAP`, and `C:\LGNTTMP\LOGOUT` explicitly and redirects to absolute `C:\LGNTTMP\*.OUT` files.

## Parameter handling

`LGNTSTA` starts Part 1 only when called without parameters. `PART2` is accepted case-insensitively (`PART2`, `part2`, `Part2`, etc.). Any other parameter prints usage and does not start Part 1, so a typo cannot accidentally reset the test state.
