fix(vxlan): подтвердить достоверность опроса и экспорта раздела

This commit is contained in:
Denozordec committed 2026-10-09 10:38:24 +07:00
1 parent 6b068ac39a
commit e2d81f9657
23 files changed
+689 -89

No files matched your search

+17
View File
@@ -174,6 +174,8 @@ test("VXLAN: повреждённые записи не заменяют пос
{ tunnels: [valid], failures: [{ serverId: "1", error: "Конфликт" }] },
{ tunnels: [], failures: [{ serverId: "1", error: "Сбой" }, { serverId: "1", error: "Повтор" }] },
{ tunnels: [{ ...valid, arpMode: "enabled", arpProxy: true }] },
{ tunnels: [{ ...valid, mtu: 0 }] },
{ tunnels: [{ ...valid, mtu: "1400" }] },
]) {
control.payload = payload
await page.getByRole("button", { name: "Обновить", exact: true }).click()
@@ -185,6 +187,21 @@ test("VXLAN: повреждённые записи не заменяют пос
await expect(page.getByText("Ошибка загрузки:", { exact: false })).toHaveCount(0)
})
test("VXLAN: меню экспорта сохраняется при обновлении и использует последний MTU", async ({ page }) => {
const control = await setup(page, "/vxlan?server=1")
const tunnel = { id: "stable", serverId: "1", name: "vx-actions", vni: 100, port: 0, dstPort: 4789, vtepIp: "192.0.2.1", remoteVteps: [], l2mtu: 65535, mtu: 1400, arpProxy: false, macLearning: true, comment: "", enabled: true, status: "up" }
control.payload = { tunnels: [tunnel] }
await page.getByRole("button", { name: "Обновить", exact: true }).click()
await expect(page.locator("tr[data-row-id]")).toHaveCount(1)
await page.getByRole("button", { name: "Действия: vx-actions" }).click()
await expect(page.getByRole("menuitem", { name: "Экспорт .rsc" })).toBeVisible()
control.payload = { tunnels: [{ ...tunnel, mtu: 1380 }] }
await page.getByRole("button", { name: "Обновить", exact: true }).evaluate(button => (button as HTMLButtonElement).click())
await expect(page.locator("tr[data-row-id]")).toContainText("1380")
await page.getByRole("menuitem", { name: "Экспорт .rsc" }).click()
await expect(page.getByRole("dialog").locator("pre")).toContainText("mtu=1380")
})
for (const oldFails of [false, true]) {
test(`VXLAN: поздний ответ старого устройства игнорируется ${oldFails}`, async ({ page }) => {
await setup(page, "/vxlan?server=1")