diff --git a/docs/content/docs/analysis/TELNET-MIGRATION-METHOD.md b/docs/content/docs/analysis/TELNET-MIGRATION-METHOD.md index a856e34..7a13bfb 100644 --- a/docs/content/docs/analysis/TELNET-MIGRATION-METHOD.md +++ b/docs/content/docs/analysis/TELNET-MIGRATION-METHOD.md @@ -123,7 +123,11 @@ in-band equivalent to the HTTP `/setMargeAccount` call, useful when the about. - Useful read-only verification command: `getpdo CurrentSystemConfiguration` — prints the URLs after the changes have been applied so we can verify before - rebooting. + rebooting. **It only reflects the runtime (`sys configuration`) layer, not + the `envswitch`-persisted layer, so a matching `getpdo` here confirms the + writes were accepted, not that they will survive the reboot** — see the + layer-visibility caveat in + [TELNET-COMMAND-REFERENCE.md](TELNET-COMMAND-REFERENCE.md). - `sys reboot` is the trigger that re-reads both layers. ### 2.4 What Telnet:17000 cannot do diff --git a/pkg/service/setup/enable_ssh.go b/pkg/service/setup/enable_ssh.go index 631e908..1c79d6a 100644 --- a/pkg/service/setup/enable_ssh.go +++ b/pkg/service/setup/enable_ssh.go @@ -135,7 +135,7 @@ func (m *Manager) runTelnetInjection(deviceIP string, forbidQuote, cmds []string } if verify, err := t.SendCommand("getpdo CurrentSystemConfiguration"); err == nil { - fmt.Fprintf(&logs, "→ getpdo CurrentSystemConfiguration\n%s\n", strings.TrimRight(verify, "\r\n")) + fmt.Fprintf(&logs, "→ getpdo CurrentSystemConfiguration (runtime layer only — confirms the writes were accepted, not that they'll survive a reboot)\n%s\n", strings.TrimRight(verify, "\r\n")) } return logs.String(), nil diff --git a/pkg/service/setup/telnet_migration.go b/pkg/service/setup/telnet_migration.go index 9ef4c4d..8e00c3f 100644 --- a/pkg/service/setup/telnet_migration.go +++ b/pkg/service/setup/telnet_migration.go @@ -130,13 +130,13 @@ func (m *Manager) migrateViaTelnet(deviceIP, targetURL string, urls telnetURLs) return logs.String(), fmt.Errorf("verification command failed: %w", err) } - fmt.Fprintf(&logs, "→ getpdo CurrentSystemConfiguration\n%s\n", strings.TrimRight(verify, "\r\n")) + fmt.Fprintf(&logs, "→ getpdo CurrentSystemConfiguration (runtime layer only — confirms the writes were accepted, not that they'll survive a reboot)\n%s\n", strings.TrimRight(verify, "\r\n")) if !strings.Contains(verify, targetURL) { return logs.String(), fmt.Errorf("verification failed: getpdo response does not contain %q (device may have rejected the new URLs)", targetURL) } - logs.WriteString("Telnet migration succeeded. Reboot the device to apply.\n") + logs.WriteString("Telnet writes accepted (runtime layer). Reboot the device so the envswitch-persisted layer takes over.\n") return logs.String(), nil } diff --git a/pkg/service/setup/telnet_migration_test.go b/pkg/service/setup/telnet_migration_test.go index 12920d4..df8c916 100644 --- a/pkg/service/setup/telnet_migration_test.go +++ b/pkg/service/setup/telnet_migration_test.go @@ -90,7 +90,7 @@ func TestMigrateViaTelnet_HappyPath(t *testing.T) { } } - if !strings.Contains(logs, "succeeded") { + if !strings.Contains(logs, "accepted") { t.Errorf("logs missing success marker:\n%s", logs) }