@ECHO OFF
REM RUTMARIO.BAT
REM Rights User Test actions.
REM
REM Run as MARIO.
REM Writes result files to F:\RUCMP\MARIO.

F:
CD \

ECHO === RUTMARIO actions as normal user === >> F:\RUCMP\RUN.LOG

ECHO === U01 RONLY read/list should work === > F:\RUCMP\MARIO\U01.OUT
TYPE F:\RUTEST\RONLY\READ.TXT >> F:\RUCMP\MARIO\U01.OUT
NPUBLIC\NDIR F:\RUTEST\RONLY >> F:\RUCMP\MARIO\U01.OUT

ECHO === U02 RONLY create should fail === > F:\RUCMP\MARIO\U02.OUT
ECHO SHOULD FAIL > F:\RUTEST\RONLY\NEW.TXT
IF EXIST F:\RUTEST\RONLY\NEW.TXT ECHO UNEXPECTED: NEW.TXT EXISTS >> F:\RUCMP\MARIO\U02.OUT
IF NOT EXIST F:\RUTEST\RONLY\NEW.TXT ECHO OK: NEW.TXT not created >> F:\RUCMP\MARIO\U02.OUT

ECHO === U03 CREATE create should work === > F:\RUCMP\MARIO\U03.OUT
ECHO CREATE BY MARIO > F:\RUTEST\CREATE\NEW.TXT
IF EXIST F:\RUTEST\CREATE\NEW.TXT ECHO OK: CREATE\NEW.TXT exists >> F:\RUCMP\MARIO\U03.OUT
IF NOT EXIST F:\RUTEST\CREATE\NEW.TXT ECHO FAIL: CREATE\NEW.TXT missing >> F:\RUCMP\MARIO\U03.OUT
NPUBLIC\NDIR F:\RUTEST\CREATE >> F:\RUCMP\MARIO\U03.OUT

ECHO === U04 WRITE append should work === > F:\RUCMP\MARIO\U04.OUT
ECHO APPEND BY MARIO >> F:\RUTEST\WRITE\W.TXT
TYPE F:\RUTEST\WRITE\W.TXT >> F:\RUCMP\MARIO\U04.OUT

ECHO === U05 ERASE delete should work === > F:\RUCMP\MARIO\U05.OUT
DEL F:\RUTEST\ERASE\E.TXT
IF EXIST F:\RUTEST\ERASE\E.TXT ECHO FAIL: ERASE\E.TXT still exists >> F:\RUCMP\MARIO\U05.OUT
IF NOT EXIST F:\RUTEST\ERASE\E.TXT ECHO OK: ERASE\E.TXT deleted >> F:\RUCMP\MARIO\U05.OUT

ECHO === U06 MODIFY RENAME MATRIX === > F:\RUCMP\MARIO\U06.OUT

ECHO --- MOD1 rights R W M F --- >> F:\RUCMP\MARIO\U06.OUT
REN F:\RUTEST\MOD1\M.TXT M2.TXT
IF EXIST F:\RUTEST\MOD1\M2.TXT ECHO MOD1 OK: M2.TXT exists >> F:\RUCMP\MARIO\U06.OUT
IF NOT EXIST F:\RUTEST\MOD1\M2.TXT ECHO MOD1 FAIL: M2.TXT missing >> F:\RUCMP\MARIO\U06.OUT
NPUBLIC\NDIR F:\RUTEST\MOD1 >> F:\RUCMP\MARIO\U06.OUT

ECHO --- MOD2 rights R W C M F --- >> F:\RUCMP\MARIO\U06.OUT
REN F:\RUTEST\MOD2\M.TXT M2.TXT
IF EXIST F:\RUTEST\MOD2\M2.TXT ECHO MOD2 OK: M2.TXT exists >> F:\RUCMP\MARIO\U06.OUT
IF NOT EXIST F:\RUTEST\MOD2\M2.TXT ECHO MOD2 FAIL: M2.TXT missing >> F:\RUCMP\MARIO\U06.OUT
NPUBLIC\NDIR F:\RUTEST\MOD2 >> F:\RUCMP\MARIO\U06.OUT

ECHO --- MOD3 rights R W E M F --- >> F:\RUCMP\MARIO\U06.OUT
REN F:\RUTEST\MOD3\M.TXT M2.TXT
IF EXIST F:\RUTEST\MOD3\M2.TXT ECHO MOD3 OK: M2.TXT exists >> F:\RUCMP\MARIO\U06.OUT
IF NOT EXIST F:\RUTEST\MOD3\M2.TXT ECHO MOD3 FAIL: M2.TXT missing >> F:\RUCMP\MARIO\U06.OUT
NPUBLIC\NDIR F:\RUTEST\MOD3 >> F:\RUCMP\MARIO\U06.OUT

ECHO --- MOD4 rights R W C E M F --- >> F:\RUCMP\MARIO\U06.OUT
REN F:\RUTEST\MOD4\M.TXT M2.TXT
IF EXIST F:\RUTEST\MOD4\M2.TXT ECHO MOD4 OK: M2.TXT exists >> F:\RUCMP\MARIO\U06.OUT
IF NOT EXIST F:\RUTEST\MOD4\M2.TXT ECHO MOD4 FAIL: M2.TXT missing >> F:\RUCMP\MARIO\U06.OUT
NPUBLIC\NDIR F:\RUTEST\MOD4 >> F:\RUCMP\MARIO\U06.OUT

ECHO === U07 SCAN list should work, read may fail === > F:\RUCMP\MARIO\U07.OUT
NPUBLIC\NDIR F:\RUTEST\SCAN >> F:\RUCMP\MARIO\U07.OUT
TYPE F:\RUTEST\SCAN\S.TXT >> F:\RUCMP\MARIO\U07.OUT

ECHO === U08 ACCESS rights display/change attempt === > F:\RUCMP\MARIO\U08.OUT
NPUBLIC\RIGHTS F:\RUTEST\ACCESS >> F:\RUCMP\MARIO\U08.OUT
NPUBLIC\GRANT R F FOR F:\RUTEST\ACCESS TO USER MARIO >> F:\RUCMP\MARIO\U08.OUT
NPUBLIC\RIGHTS F:\RUTEST\ACCESS >> F:\RUCMP\MARIO\U08.OUT

ECHO === U09 ALL all operations should work === > F:\RUCMP\MARIO\U09.OUT
TYPE F:\RUTEST\ALL\ALL.TXT >> F:\RUCMP\MARIO\U09.OUT
ECHO ALL NEW BY MARIO > F:\RUTEST\ALL\NEW.TXT
REN F:\RUTEST\ALL\ALL.TXT ALL2.TXT
DEL F:\RUTEST\ALL\NEW.TXT
NPUBLIC\NDIR F:\RUTEST\ALL >> F:\RUCMP\MARIO\U09.OUT

NPUBLIC\NDIR F:\RUTEST /RIGHTS > F:\RUCMP\MARIO\ROOTRGHT.OUT

ECHO === RUTMARIO fertig ===
ECHO Jetzt wieder als SUPERVISOR einloggen und RUTPOST ausfuehren.
