nc_program_manager/field-test/t04_errori_connessione.bat
Trentin Davide 3fd3047584 docs(test): add Mitsubishi field-test kit (scripts + criticità checklist)
Windows batch harness + extensive IT README for on-site Mitsubishi CNC
testing. Covers connect/invia/scarica/validator/offset/param scenarios.
Documents C1-C8 criticità found in code review:
- path mapping mismatch (download /PRG/<int> vs upload relative <path>/<name>)
- Standardize leading \n may trip validator first-line gate
- hardcoded /PRG/ ProgramDirectory, no CLI override
- Int16 -path limit, ASCII-only FTP, plaintext credentials

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 09:03:10 +02:00

36 lines
1.6 KiB
Batchfile

@echo off
REM ============================================================
REM T04 - ERRORI di connessione
REM Tre casi, tutti attesi -201 "Macchina non connessa":
REM a) IP inesistente
REM b) porta errata
REM c) credenziali errate
REM NOTA: il Connect fa una LIST su /PRG/. Se il controllo usa
REM una cartella programmi DIVERSA da /PRG/, anche con IP/cred
REM corretti la connessione FALLISCE (criticita C6: ProgramDirectory
REM e' hardcoded "/PRG/", nessun flag CLI per cambiarla).
REM ============================================================
setlocal
call "%~dp0config.bat"
if not exist "%RESULTS%" mkdir "%RESULTS%"
set LOG=%RESULTS%\t04_errori_connessione.log
echo === T04 ERRORI CONNESSIONE === > "%LOG%"
echo. >> "%LOG%"
echo ----- a) IP inesistente 10.255.255.1 ----- >> "%LOG%"
"%EXE%" -manufacturer=mitsubishi -azione=Scarica -ip=10.255.255.1 -porta=%PORT% -username=%USER% -password=%PASS% -path=%PROGNUM% -pathprogramma=%RESULTS%\dl_a.txt >> "%LOG%" 2>&1
echo EXITCODE_a=%ERRORLEVEL% >> "%LOG%"
echo. >> "%LOG%"
echo ----- b) porta errata 9999 ----- >> "%LOG%"
"%EXE%" -manufacturer=mitsubishi -azione=Scarica -ip=%IP% -porta=9999 -username=%USER% -password=%PASS% -path=%PROGNUM% -pathprogramma=%RESULTS%\dl_b.txt >> "%LOG%" 2>&1
echo EXITCODE_b=%ERRORLEVEL% >> "%LOG%"
echo. >> "%LOG%"
echo ----- c) credenziali errate ----- >> "%LOG%"
"%EXE%" -manufacturer=mitsubishi -azione=Scarica -ip=%IP% -porta=%PORT% -username=NOUSER -password=NOPASS -path=%PROGNUM% -pathprogramma=%RESULTS%\dl_c.txt >> "%LOG%" 2>&1
echo EXITCODE_c=%ERRORLEVEL% >> "%LOG%"
echo Log: %LOG%
type "%LOG%"
endlocal