Обновление: компоненты, которых не знает прежний root-установщик (igate-dist), — вторым заходом, сразу или после перезапуска
Старый bj-component-install отклонял обновление целиком из-за незнакомого igate-dist — вместе со своей новой версией (рабочий сервер: установщик .06.2). installerSince: с какой версии установщик знает компонент; отложенное ставится тем же нажатием после нового установщика, а если перезапускался bj-server — само после старта (Update.Pending). Тест TestLKAgentEndToEnd: ждёт счётчик агента (гонка). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FsEKyJrYF69Cj9ZXzFLRi
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package lkgateway
|
||||
|
||||
import (
|
||||
"git.zetit.ru/zuevav/Bridge-and-Join-s/internal/release"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"path/filepath"
|
||||
@@ -184,3 +185,24 @@ func TestCreateUserLoginTaken(t *testing.T) {
|
||||
t.Fatal("один администратор — шаг не выполнен")
|
||||
}
|
||||
}
|
||||
|
||||
// Старый root-установщик не знает igate-dist (рабочий сервер 06.10.2026: установщик .06.2) — сначала ставится
|
||||
// новый установщик, igate-dist откладывается на второй заход; новый установщик — всё одним заходом.
|
||||
func TestDeferForInstaller(t *testing.T) {
|
||||
st := func(name, inst string, upd, isNew bool) release.ComponentState {
|
||||
return release.ComponentState{Component: release.Component{Name: name}, Installed: inst, Update: upd, New: isNew}
|
||||
}
|
||||
plan := []release.ComponentState{st("bj-component-install", "2026.10.06.2", true, false), st("igate-dist", "", true, true), st("bj-server", "2026.10.06.26", true, false)}
|
||||
kept, deferred := deferForInstaller(plan, plan)
|
||||
if len(kept) != 2 || len(deferred) != 1 || deferred[0] != "igate-dist" {
|
||||
t.Fatalf("старый установщик: оставлено %v, отложено %v", kept, deferred)
|
||||
}
|
||||
plan[0] = st("bj-component-install", "2026.10.06.15", true, false)
|
||||
if kept, deferred := deferForInstaller(plan, plan); len(kept) != 3 || len(deferred) != 0 {
|
||||
t.Fatalf("установщик знает igate-dist: оставлено %d, отложено %v", len(kept), deferred)
|
||||
}
|
||||
plan[0] = st("bj-component-install", "2026.10.06.2", false, false) // установщик не обновляется — откладывать нечем
|
||||
if kept, deferred := deferForInstaller(plan, plan); len(kept) != 3 || len(deferred) != 0 {
|
||||
t.Fatalf("без нового установщика: оставлено %d, отложено %v", len(kept), deferred)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user