fix(test): выбирать свободный id сервера в приёмках IPv6 ND и ARP
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
26cba792a8
commit
88e82702db
2 files changed
+2
-2
No files matched your search
@@ -98,7 +98,7 @@ export async function acceptArpWriteMcp(actor: AuthUser) {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const port = (router.address() as { port: number }).port
|
const port = (router.address() as { port: number }).port
|
||||||
const { rows: [server] } = await pool.query<{ id: number }>("INSERT INTO servers(name,host,port,use_ssl,password) VALUES('arp-write','127.0.0.1',$1,false,'fixture-only') RETURNING id", [port])
|
const { rows: [server] } = await pool.query<{ id: number }>("INSERT INTO servers(id,name,host,port,use_ssl,password) SELECT COALESCE(MAX(id),0)+1,'arp-write','127.0.0.1',$1::int,false,'fixture-only' FROM servers RETURNING id", [port])
|
||||||
serverId = Number(server.id)
|
serverId = Number(server.id)
|
||||||
const access = await createMcpConnection(mcpConnectionCreateSchema.parse({
|
const access = await createMcpConnection(mcpConnectionCreateSchema.parse({
|
||||||
name: "Static ARP writes", mode: "approval", expiresAt: new Date(Date.now() + 1_800_000).toISOString(),
|
name: "Static ARP writes", mode: "approval", expiresAt: new Date(Date.now() + 1_800_000).toISOString(),
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ export async function acceptIpv6NdWriteMcp(actor: AuthUser, listsOnly = false) {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const port = (router.address() as { port: number }).port
|
const port = (router.address() as { port: number }).port
|
||||||
const { rows: [server] } = await pool.query<{ id: number }>("INSERT INTO servers(name,host,port,use_ssl,password) VALUES('ipv6-nd-write','127.0.0.1',$1,false,'fixture-only') RETURNING id", [port])
|
const { rows: [server] } = await pool.query<{ id: number }>("INSERT INTO servers(id,name,host,port,use_ssl,password) SELECT COALESCE(MAX(id),0)+1,'ipv6-nd-write','127.0.0.1',$1::int,false,'fixture-only' FROM servers RETURNING id", [port])
|
||||||
serverId = Number(server.id)
|
serverId = Number(server.id)
|
||||||
const access = await createMcpConnection(mcpConnectionCreateSchema.parse({
|
const access = await createMcpConnection(mcpConnectionCreateSchema.parse({
|
||||||
name: "IPv6 ND native writes", mode: "approval", expiresAt: new Date(Date.now() + 1_800_000).toISOString(),
|
name: "IPv6 ND native writes", mode: "approval", expiresAt: new Date(Date.now() + 1_800_000).toISOString(),
|
||||||
|
|||||||
Reference in new issue
Block a user