From ce4263217d7d87bf15432d251fbde535cd3622b3 Mon Sep 17 00:00:00 2001 From: codex Date: Wed, 4 Nov 2026 01:26:12 +0800 Subject: [PATCH] test: update snapshot workflow for dual stack --- web/tests/CloudSnapshotWorkflowTest.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/web/tests/CloudSnapshotWorkflowTest.php b/web/tests/CloudSnapshotWorkflowTest.php index 654ac1b5..a2335c6f 100644 --- a/web/tests/CloudSnapshotWorkflowTest.php +++ b/web/tests/CloudSnapshotWorkflowTest.php @@ -247,13 +247,33 @@ namespace { $instance->network_status = 'active'; $instance->expires_at = null; $instance->spec_json = json_encode([ + 'managed' => true, 'template_id' => 'debian-12', 'os_source' => 'cloud_template', 'os_name' => 'Debian 12', 'login_name' => 'root', 'guest_hostname' => 'snapshot-old', - 'public_ip_cidr' => '192.0.2.10/24', 'region' => 'HKG', + 'public_network' => [ + 'contract' => 1, + 'network_selector' => 'bridge:br0', + 'ipv4' => [ + 'pool_key' => str_repeat('1', 32), + 'pool_cidr' => '8.8.8.0/24', + 'address_cidr' => '8.8.8.10/24', + 'gateway' => '8.8.8.1', + 'gateway_on_link' => false, + ], + 'ipv6' => [ + 'pool_key' => str_repeat('2', 32), + 'pool_cidr' => '2404:c140:156:3a::/64', + 'address_cidr' => '2404:c140:156:3a::10/64', + 'gateway' => '2404:c140:156::1', + 'gateway_on_link' => true, + ], + 'dns_servers' => ['1.1.1.1', '2606:4700:4700::1111'], + ], + 'region' => 'HKG', 'vcpu' => 2, 'memory_mib' => 2048, 'disk_gib' => 40, 'agent_metadata_version' => 1, - ], JSON_THROW_ON_ERROR); + ], JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES); $instance->sealed_credential = CloudSecrets::encrypt([ 'password' => 'old-password', 'login_name' => 'root', ], 'instance-credential');