@ECHO OFF
REM MAPTSTA.BAT
REM Automated Novell MAP baseline for MARS NWE.
REM
REM LOGIN is intentionally not tested here.
REM PATH/PATHINS/PATHDEL are our own tools and are not part of this Novell MAP baseline.
REM
REM Run while already logged in and with F: mapped to SYS.
REM
REM NetWare semantics verified against real NetWare:
REM   MAP G:=SYS:PUBLIC
REM     sets the current path of G: to \PUBLIC, but it is NOT a fake root.
REM     CD \ returns to SYS:\.
REM
REM   MAP ROOT G:=SYS:PUBLIC
REM     makes SYS:PUBLIC the fake root of G:.
REM     CD \ stays inside SYS:PUBLIC.
REM
REM Results:
REM   F:\MAPCMP\RUN.LOG
REM   F:\MAPCMP\SUMMARY.TXT
REM   F:\MAPCMP\OUT\*.OUT

F:
CD \

REM --- Clean generated test/result directories (contents only). ---
IF EXIST MAPTEST\NUL DELTREE /Y MAPTEST\*.*
IF EXIST MAPCMP\NUL DELTREE /Y MAPCMP\*.*

IF NOT EXIST MAPTEST\NUL MD MAPTEST
IF NOT EXIST MAPTEST\PUB\NUL MD MAPTEST\PUB
IF NOT EXIST MAPCMP\NUL MD MAPCMP
IF NOT EXIST MAPCMP\OUT\NUL MD MAPCMP\OUT

IF EXIST F:\MAPCMP\RUN.LOG DEL F:\MAPCMP\RUN.LOG
IF EXIST F:\MAPCMP\SUMMARY.TXT DEL F:\MAPCMP\SUMMARY.TXT
IF EXIST F:\MAPCMP\MAPTSTA.ZIP DEL F:\MAPCMP\MAPTSTA.ZIP
IF EXIST F:\MAPCMP\ZIP.LOG DEL F:\MAPCMP\ZIP.LOG

IF EXIST F:\MAPCMP\OUT\M01_MAP.OUT DEL F:\MAPCMP\OUT\M01_MAP.OUT
IF EXIST F:\MAPCMP\OUT\M02_SUBCUR.OUT DEL F:\MAPCMP\OUT\M02_SUBCUR.OUT
IF EXIST F:\MAPCMP\OUT\M03_SUBCD.OUT DEL F:\MAPCMP\OUT\M03_SUBCD.OUT
IF EXIST F:\MAPCMP\OUT\M04_ROOTMAP.OUT DEL F:\MAPCMP\OUT\M04_ROOTMAP.OUT
IF EXIST F:\MAPCMP\OUT\M05_ROOTCD.OUT DEL F:\MAPCMP\OUT\M05_ROOTCD.OUT
IF EXIST F:\MAPCMP\OUT\M06_NPUBLIC.OUT DEL F:\MAPCMP\OUT\M06_NPUBLIC.OUT
IF EXIST F:\MAPCMP\OUT\M07_HOME.OUT DEL F:\MAPCMP\OUT\M07_HOME.OUT
IF EXIST F:\MAPCMP\OUT\M08_QUOTA.OUT DEL F:\MAPCMP\OUT\M08_QUOTA.OUT
IF EXIST F:\MAPCMP\OUT\M09_UQUOTA.OUT DEL F:\MAPCMP\OUT\M09_UQUOTA.OUT
IF EXIST F:\MAPCMP\OUT\M10_DEL.OUT DEL F:\MAPCMP\OUT\M10_DEL.OUT
IF EXIST F:\MAPCMP\OUT\M11_AFTER.OUT DEL F:\MAPCMP\OUT\M11_AFTER.OUT
IF EXIST F:\MAPCMP\OUT\M12_BAD.OUT DEL F:\MAPCMP\OUT\M12_BAD.OUT

ECHO MAPTSTA automated Novell MAP baseline > F:\MAPCMP\RUN.LOG
ECHO Run while already logged in. >> F:\MAPCMP\RUN.LOG
ECHO Date/time stamp skipped to avoid DOS prompt. >> F:\MAPCMP\RUN.LOG
ECHO. >> F:\MAPCMP\RUN.LOG

ECHO MAP TEST ROOT > F:\MAPTEST\ROOT.TXT
ECHO MAP TEST PUB > F:\MAPTEST\PUB\PUB.TXT
NPUBLIC\FLAG F:\MAPTEST\ROOT.TXT N >> F:\MAPCMP\RUN.LOG
NPUBLIC\FLAG F:\MAPTEST\PUB\PUB.TXT N >> F:\MAPCMP\RUN.LOG

ECHO === M01 current maps and volumes === >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP > F:\MAPCMP\OUT\M01_MAP.OUT

ECHO === M02 non-root subdir map G:=SYS:MAPTEST === >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP DEL G: >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP G:=SYS:MAPTEST > F:\MAPCMP\OUT\M02_SUBCUR.OUT
NPUBLIC\MAP >> F:\MAPCMP\OUT\M02_SUBCUR.OUT
G:
CD
DIR
TYPE ROOT.TXT >> F:\MAPCMP\OUT\M02_SUBCUR.OUT
DIR PUB >> F:\MAPCMP\OUT\M02_SUBCUR.OUT
TYPE PUB\PUB.TXT >> F:\MAPCMP\OUT\M02_SUBCUR.OUT
F:

ECHO === M03 non-root map after CD backslash should show SYS root === >> F:\MAPCMP\RUN.LOG
G:
CD \
CD > F:\MAPCMP\OUT\M03_SUBCD.OUT
DIR >> F:\MAPCMP\OUT\M03_SUBCD.OUT
DIR ROOT.TXT >> F:\MAPCMP\OUT\M03_SUBCD.OUT
F:

ECHO === M04 MAP ROOT G:=SYS:MAPTEST fake-root === >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP DEL G: >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP ROOT G:=SYS:MAPTEST > F:\MAPCMP\OUT\M04_ROOTMAP.OUT
NPUBLIC\MAP >> F:\MAPCMP\OUT\M04_ROOTMAP.OUT
G:
CD
DIR
TYPE ROOT.TXT >> F:\MAPCMP\OUT\M04_ROOTMAP.OUT
DIR PUB >> F:\MAPCMP\OUT\M04_ROOTMAP.OUT
TYPE PUB\PUB.TXT >> F:\MAPCMP\OUT\M04_ROOTMAP.OUT
F:

ECHO === M05 MAP ROOT after CD backslash should stay in fake-root === >> F:\MAPCMP\RUN.LOG
G:
CD \
CD > F:\MAPCMP\OUT\M05_ROOTCD.OUT
DIR >> F:\MAPCMP\OUT\M05_ROOTCD.OUT
DIR ROOT.TXT >> F:\MAPCMP\OUT\M05_ROOTCD.OUT
TYPE ROOT.TXT >> F:\MAPCMP\OUT\M05_ROOTCD.OUT
F:

ECHO === M06 MAP ROOT to SYS:NPUBLIC and find NDIR.EXE === >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP DEL G: >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP ROOT G:=SYS:NPUBLIC > F:\MAPCMP\OUT\M06_NPUBLIC.OUT
NPUBLIC\MAP >> F:\MAPCMP\OUT\M06_NPUBLIC.OUT
G:
CD \
CD >> F:\MAPCMP\OUT\M06_NPUBLIC.OUT
DIR NDIR.EXE >> F:\MAPCMP\OUT\M06_NPUBLIC.OUT
F:

ECHO === M07 map H to HOME: volume root === >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP DEL H: >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP H:=HOME: > F:\MAPCMP\OUT\M07_HOME.OUT
NPUBLIC\MAP >> F:\MAPCMP\OUT\M07_HOME.OUT
DIR H:\ >> F:\MAPCMP\OUT\M07_HOME.OUT

ECHO === M08 map I to QUOTA: volume root === >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP DEL I: >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP I:=QUOTA: > F:\MAPCMP\OUT\M08_QUOTA.OUT
NPUBLIC\MAP >> F:\MAPCMP\OUT\M08_QUOTA.OUT
DIR I:\ >> F:\MAPCMP\OUT\M08_QUOTA.OUT

ECHO === M09 map ROOT J to QUOTA:USERQUOTA fake-root === >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP DEL J: >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP ROOT J:=QUOTA:USERQUOTA > F:\MAPCMP\OUT\M09_UQUOTA.OUT
NPUBLIC\MAP >> F:\MAPCMP\OUT\M09_UQUOTA.OUT
J:
CD \
CD >> F:\MAPCMP\OUT\M09_UQUOTA.OUT
DIR >> F:\MAPCMP\OUT\M09_UQUOTA.OUT
F:

ECHO === M10 delete mapped drives G H I J === >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP DEL G: > F:\MAPCMP\OUT\M10_DEL.OUT
NPUBLIC\MAP DEL H: >> F:\MAPCMP\OUT\M10_DEL.OUT
NPUBLIC\MAP DEL I: >> F:\MAPCMP\OUT\M10_DEL.OUT
NPUBLIC\MAP DEL J: >> F:\MAPCMP\OUT\M10_DEL.OUT
NPUBLIC\MAP >> F:\MAPCMP\OUT\M10_DEL.OUT

ECHO === M11 access after delete should fail === >> F:\MAPCMP\RUN.LOG
DIR G:\ > F:\MAPCMP\OUT\M11_AFTER.OUT
DIR H:\ >> F:\MAPCMP\OUT\M11_AFTER.OUT
DIR I:\ >> F:\MAPCMP\OUT\M11_AFTER.OUT
DIR J:\ >> F:\MAPCMP\OUT\M11_AFTER.OUT

ECHO === M12 expected failure bad map target === >> F:\MAPCMP\RUN.LOG
NPUBLIC\MAP K:=SYS:NO_SUCH_DIR > F:\MAPCMP\OUT\M12_BAD.OUT
NPUBLIC\MAP DEL K: >> F:\MAPCMP\OUT\M12_BAD.OUT

ECHO === SUMMARY === > F:\MAPCMP\SUMMARY.TXT
ECHO MAPTSTA Novell MAP baseline finished. >> F:\MAPCMP\SUMMARY.TXT
ECHO. >> F:\MAPCMP\SUMMARY.TXT
ECHO Expected: >> F:\MAPCMP\SUMMARY.TXT
ECHO - M02 non-root G:=SYS:MAPTEST starts in MAPTEST and can read ROOT.TXT. >> F:\MAPCMP\SUMMARY.TXT
ECHO - M03 after CD \ on non-root map, G: is back at SYS:\ and ROOT.TXT is not found. >> F:\MAPCMP\SUMMARY.TXT
ECHO - M04 MAP ROOT G:=SYS:MAPTEST can read ROOT.TXT and PUB\PUB.TXT. >> F:\MAPCMP\SUMMARY.TXT
ECHO - M05 after CD \ on MAP ROOT, G: stays inside fake-root and ROOT.TXT is found. >> F:\MAPCMP\SUMMARY.TXT
ECHO - M06 MAP ROOT G:=SYS:NPUBLIC finds NDIR.EXE. >> F:\MAPCMP\SUMMARY.TXT
ECHO - M07 maps H to HOME:. >> F:\MAPCMP\SUMMARY.TXT
ECHO - M08 maps I to QUOTA:. >> F:\MAPCMP\SUMMARY.TXT
ECHO - M09 maps ROOT J to QUOTA:USERQUOTA if that directory exists. >> F:\MAPCMP\SUMMARY.TXT
ECHO - M10 deletes G/H/I/J mappings. >> F:\MAPCMP\SUMMARY.TXT
ECHO - M11 access after delete should fail. >> F:\MAPCMP\SUMMARY.TXT
ECHO - M12 bad target should fail. >> F:\MAPCMP\SUMMARY.TXT
ECHO Optional pack results with MAPTZIP.BAT. >> F:\MAPCMP\SUMMARY.TXT

ECHO.
ECHO MAPTSTA fertig.
ECHO Ergebnisse liegen in F:\MAPCMP
ECHO Optional: MAPTZIP ausfuehren.
ECHO.
