@ECHO OFF
REM WHOSTA.BAT
REM Automated WHOAMI baseline and PUBLIC comparison test for MARS NWE.
REM
REM Run while logged in as SUPERVISOR or the user whose context should be captured.
REM Uses \NPUBLIC\WHOAMI as Novell baseline and \PUBLIC\WHOAMI as implementation under test.
REM
REM Result tree:
REM   F:\WHOCMP
REM     OUT         Novell baseline output
REM     PUBOUT      PUBLIC implementation output
REM     COMPARE.LOG FC comparison OUT vs PUBOUT

F:
CD \

REM --- Clean generated result directory (contents only). ---
IF EXIST WHOCMP\NUL DELTREE /Y WHOCMP\*.*
IF NOT EXIST WHOCMP\NUL MD WHOCMP
IF NOT EXIST WHOCMP\OUT\NUL MD WHOCMP\OUT
IF NOT EXIST WHOCMP\PUBOUT\NUL MD WHOCMP\PUBOUT

ECHO WHOSTA WHOAMI baseline and PUBLIC comparison test > F:\WHOCMP\RUN.LOG
ECHO Run this while logged in as the target user, normally SUPERVISOR. >> F:\WHOCMP\RUN.LOG
ECHO Captures \NPUBLIC\WHOAMI output and compares it with \PUBLIC\WHOAMI. >> F:\WHOCMP\RUN.LOG
ECHO. >> F:\WHOCMP\RUN.LOG

ECHO === Novell baseline: \NPUBLIC\WHOAMI === >> F:\WHOCMP\RUN.LOG

ECHO === D01 default WHOAMI === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI > F:\WHOCMP\OUT\D01_BASE.OUT

ECHO === D02 explicit server MARS === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI MARS > F:\WHOCMP\OUT\D02_MARS.OUT

ECHO === D10 /SECURITY === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI /SECURITY > F:\WHOCMP\OUT\D10_SECUR.OUT

ECHO === D11 /GROUPS === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI /GROUPS > F:\WHOCMP\OUT\D11_GROUP.OUT

ECHO === D12 /WORKGROUPS === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI /WORKGROUPS > F:\WHOCMP\OUT\D12_WORK.OUT

ECHO === D13 /RIGHTS === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI /RIGHTS > F:\WHOCMP\OUT\D13_RIGHT.OUT

ECHO === D14 /SYSTEM === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI /SYSTEM > F:\WHOCMP\OUT\D14_SYST.OUT

ECHO === D15 /OBJECT === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI /OBJECT > F:\WHOCMP\OUT\D15_OBJ.OUT

ECHO === D16 /ALL === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI /ALL > F:\WHOCMP\OUT\D16_ALL.OUT

ECHO === D90 missing server / negative server case === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI NWBYGONE01 > F:\WHOCMP\OUT\D90_MISS.OUT

ECHO === D91 unknown option === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI /BOGUS > F:\WHOCMP\OUT\D91_BOGUS.OUT

ECHO === D99 usage/help === >> F:\WHOCMP\RUN.LOG
\NPUBLIC\WHOAMI /? > F:\WHOCMP\OUT\D99_HELP.OUT

ECHO. >> F:\WHOCMP\RUN.LOG
ECHO === PUBLIC implementation: \PUBLIC\WHOAMI === >> F:\WHOCMP\RUN.LOG

ECHO === P01 default WHOAMI === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI > F:\WHOCMP\PUBOUT\D01_BASE.OUT

ECHO === P02 explicit server MARS === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI MARS > F:\WHOCMP\PUBOUT\D02_MARS.OUT

ECHO === P10 /SECURITY === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI /SECURITY > F:\WHOCMP\PUBOUT\D10_SECUR.OUT

ECHO === P11 /GROUPS === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI /GROUPS > F:\WHOCMP\PUBOUT\D11_GROUP.OUT

ECHO === P12 /WORKGROUPS === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI /WORKGROUPS > F:\WHOCMP\PUBOUT\D12_WORK.OUT

ECHO === P13 /RIGHTS === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI /RIGHTS > F:\WHOCMP\PUBOUT\D13_RIGHT.OUT

ECHO === P14 /SYSTEM === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI /SYSTEM > F:\WHOCMP\PUBOUT\D14_SYST.OUT

ECHO === P15 /OBJECT === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI /OBJECT > F:\WHOCMP\PUBOUT\D15_OBJ.OUT

ECHO === P16 /ALL === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI /ALL > F:\WHOCMP\PUBOUT\D16_ALL.OUT

ECHO === P90 missing server / negative server case === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI NWBYGONE01 > F:\WHOCMP\PUBOUT\D90_MISS.OUT

ECHO === P91 unknown option === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI /BOGUS > F:\WHOCMP\PUBOUT\D91_BOGUS.OUT

ECHO === P99 usage/help === >> F:\WHOCMP\RUN.LOG
\PUBLIC\WHOAMI /? > F:\WHOCMP\PUBOUT\D99_HELP.OUT

ECHO === FC compare OUT vs PUBOUT === > F:\WHOCMP\COMPARE.LOG
ECHO D01_BASE.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D01_BASE.OUT F:\WHOCMP\PUBOUT\D01_BASE.OUT >> F:\WHOCMP\COMPARE.LOG
ECHO. >> F:\WHOCMP\COMPARE.LOG
ECHO D02_MARS.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D02_MARS.OUT F:\WHOCMP\PUBOUT\D02_MARS.OUT >> F:\WHOCMP\COMPARE.LOG
ECHO. >> F:\WHOCMP\COMPARE.LOG
ECHO D10_SECUR.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D10_SECUR.OUT F:\WHOCMP\PUBOUT\D10_SECUR.OUT >> F:\WHOCMP\COMPARE.LOG
ECHO. >> F:\WHOCMP\COMPARE.LOG
ECHO D11_GROUP.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D11_GROUP.OUT F:\WHOCMP\PUBOUT\D11_GROUP.OUT >> F:\WHOCMP\COMPARE.LOG
ECHO. >> F:\WHOCMP\COMPARE.LOG
ECHO D12_WORK.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D12_WORK.OUT F:\WHOCMP\PUBOUT\D12_WORK.OUT >> F:\WHOCMP\COMPARE.LOG
ECHO. >> F:\WHOCMP\COMPARE.LOG
ECHO D13_RIGHT.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D13_RIGHT.OUT F:\WHOCMP\PUBOUT\D13_RIGHT.OUT >> F:\WHOCMP\COMPARE.LOG
ECHO. >> F:\WHOCMP\COMPARE.LOG
ECHO D14_SYST.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D14_SYST.OUT F:\WHOCMP\PUBOUT\D14_SYST.OUT >> F:\WHOCMP\COMPARE.LOG
ECHO. >> F:\WHOCMP\COMPARE.LOG
ECHO D15_OBJ.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D15_OBJ.OUT F:\WHOCMP\PUBOUT\D15_OBJ.OUT >> F:\WHOCMP\COMPARE.LOG
ECHO. >> F:\WHOCMP\COMPARE.LOG
ECHO D16_ALL.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D16_ALL.OUT F:\WHOCMP\PUBOUT\D16_ALL.OUT >> F:\WHOCMP\COMPARE.LOG
ECHO. >> F:\WHOCMP\COMPARE.LOG
ECHO D90_MISS.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D90_MISS.OUT F:\WHOCMP\PUBOUT\D90_MISS.OUT >> F:\WHOCMP\COMPARE.LOG
ECHO. >> F:\WHOCMP\COMPARE.LOG
ECHO D91_BOGUS.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D91_BOGUS.OUT F:\WHOCMP\PUBOUT\D91_BOGUS.OUT >> F:\WHOCMP\COMPARE.LOG
ECHO. >> F:\WHOCMP\COMPARE.LOG
ECHO D99_HELP.OUT >> F:\WHOCMP\COMPARE.LOG
FC F:\WHOCMP\OUT\D99_HELP.OUT F:\WHOCMP\PUBOUT\D99_HELP.OUT >> F:\WHOCMP\COMPARE.LOG

ECHO === SUMMARY === > F:\WHOCMP\SUMMARY.TXT
ECHO WHOSTA WHOAMI baseline and comparison finished. >> F:\WHOCMP\SUMMARY.TXT
ECHO. >> F:\WHOCMP\SUMMARY.TXT
ECHO OUT    = Novell baseline from \NPUBLIC\WHOAMI. >> F:\WHOCMP\SUMMARY.TXT
ECHO PUBOUT = implementation output from \PUBLIC\WHOAMI. >> F:\WHOCMP\SUMMARY.TXT
ECHO COMPARE.LOG contains FC comparisons for all captured files. >> F:\WHOCMP\SUMMARY.TXT
ECHO. >> F:\WHOCMP\SUMMARY.TXT
ECHO Expected coverage: >> F:\WHOCMP\SUMMARY.TXT
ECHO - D01 captures default identity output for the current login context. >> F:\WHOCMP\SUMMARY.TXT
ECHO - D02 captures explicit server syntax with MARS. >> F:\WHOCMP\SUMMARY.TXT
ECHO - D10-D16 capture documented option variants. >> F:\WHOCMP\SUMMARY.TXT
ECHO - D90-D91 capture missing-server and bad-option behavior. >> F:\WHOCMP\SUMMARY.TXT
ECHO - D99 captures Usage text from WHOAMI /?. >> F:\WHOCMP\SUMMARY.TXT
ECHO. >> F:\WHOCMP\SUMMARY.TXT
ECHO Optional: WHOZIP ausfuehren. >> F:\WHOCMP\SUMMARY.TXT

ECHO WHOSTA fertig.
ECHO Ergebnisse liegen in F:\WHOCMP
ECHO Vergleich liegt in F:\WHOCMP\COMPARE.LOG
ECHO Optional: WHOZIP ausfuehren.
