Files
claudetools/temp/test-nas-v2.ps1
Mike Swanson 470638ff86 sync: Dataforth sync fixes, TestDataDB stability, and client scripts
Dataforth DOS:
- TestDataDB: singleton DB connection fix (crash prevention), WAL mode,
  WinSW service config, backup script, uncaught exception handlers
- Sync-FromNAS.ps1: Get-NASFileList temp file approach to avoid SSH
  stdout deadlock, *> $null output suppression, 8.3 filename filter
  for PUSH phase, backslash-escaped SCP paths, rename-to-.synced
- import.js: INSERT OR REPLACE for re-tested devices
- Full import run: 1,028,275 -> 1,632,793 records, indexes added
- Deploy script for sync fixes to AD2

Client scripts (temp/):
- BG Builders: Lesley account check, MFA phone update
- Lonestar Electrical: Kyla/Russ Google Workspace setup, 2FA bypass
- AD2 diagnostics and NAS connectivity tests

PENDING: Investigate why newest test_date is Jan 19 despite daily tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 06:08:31 -07:00

33 lines
1.6 KiB
PowerShell

# Run ON AD2: Tests NAS SSH operations
# Deploy: scp test-nas-v2.ps1 AD2:C:\Shares\testdatadb\
# Run: powershell -NoProfile -ExecutionPolicy Bypass -File C:\Shares\testdatadb\test-nas-v2.ps1
$SSH = "C:\Program Files\OpenSSH\ssh.exe"
$SSH_KEY = "C:\Users\sysadmin\.ssh\id_ed25519"
Write-Host "=== Test A: echo ==="
$t = Get-Date
$r = & $SSH -i $SSH_KEY -o BatchMode=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new root@192.168.0.9 "echo NAS_OK" 2>&1
Write-Host " Result: $r ($(((Get-Date)-$t).TotalSeconds)s)"
Write-Host "=== Test B: ls data dir ==="
$t = Get-Date
$r = & $SSH -i $SSH_KEY -o BatchMode=yes -o ConnectTimeout=10 root@192.168.0.9 "ls /data/test/ | head -5" 2>&1
foreach ($l in $r) { Write-Host " $l" }
Write-Host " ($(((Get-Date)-$t).TotalSeconds)s)"
Write-Host "=== Test C: find with wc -l only ==="
$t = Get-Date
$r = & $SSH -i $SSH_KEY -o BatchMode=yes -o ConnectTimeout=10 root@192.168.0.9 "find /data/test/TS-*/LOGS -name '*.DAT' -type f -mmin -1440 2>/dev/null | wc -l" 2>&1
Write-Host " Count: $r ($(((Get-Date)-$t).TotalSeconds)s)"
Write-Host "=== Test D: find to temp file ==="
$t = Get-Date
& $SSH -i $SSH_KEY -o BatchMode=yes -o ConnectTimeout=10 root@192.168.0.9 "find /data/test/TS-*/LOGS -name '*.DAT' -type f -mmin -1440 > /tmp/test-list.txt 2>/dev/null" *> $null
Write-Host " ($(((Get-Date)-$t).TotalSeconds)s)"
Write-Host "=== Test E: check temp file ==="
$r = & $SSH -i $SSH_KEY -o BatchMode=yes -o ConnectTimeout=10 root@192.168.0.9 "wc -l /tmp/test-list.txt; rm -f /tmp/test-list.txt" 2>&1
Write-Host " $r"
Write-Host "=== ALL DONE ==="