|
|
|
|
@ -453,7 +453,7 @@ $createBody = [
|
|
|
|
|
'name' => 'Second public pool',
|
|
|
|
|
'cidr' => '8.8.4.0/29',
|
|
|
|
|
'gateway' => '8.8.4.1',
|
|
|
|
|
'dns_servers' => ['1.0.0.1'],
|
|
|
|
|
'dns_servers' => ['1.1.1.1'],
|
|
|
|
|
'reserved_ips' => [],
|
|
|
|
|
'guest_prefix_length' => 29,
|
|
|
|
|
'gateway_on_link' => false,
|
|
|
|
|
@ -521,6 +521,15 @@ $ipv6Body = [
|
|
|
|
|
'state' => 'active',
|
|
|
|
|
'request_key' => str_repeat('6', 32),
|
|
|
|
|
];
|
|
|
|
|
$expectCloudError(
|
|
|
|
|
static fn () => $service->create($hostId, $actor, $ipv6Body),
|
|
|
|
|
409,
|
|
|
|
|
'启用地址池必须使用完全相同且顺序一致的 DNS'
|
|
|
|
|
);
|
|
|
|
|
$assert(CloudPublicIpPool::where('host_id', $hostId)
|
|
|
|
|
->where('address_family', 6)->count() === 0,
|
|
|
|
|
'A mismatched active IPv6 DNS contract created a partial pool.');
|
|
|
|
|
$ipv6Body['dns_servers'] = ['1.1.1.1'];
|
|
|
|
|
$ipv6Created = $service->create($hostId, $actor, $ipv6Body);
|
|
|
|
|
$ipv6Pool = CloudPublicIpPool::where(
|
|
|
|
|
'pool_key', (string) $ipv6Created['saved_pool_key']
|
|
|
|
|
@ -542,15 +551,29 @@ $assert($ipv6Pool !== null
|
|
|
|
|
&& $ipv6Item['dual_stack_ready'] === true
|
|
|
|
|
&& $ipv6Item['attachment']['dual_stack_ready'] === true,
|
|
|
|
|
'IPv6 /64 was materialized or its bounded sparse capacity was not exposed.');
|
|
|
|
|
$expectCloudError(
|
|
|
|
|
static fn () => $service->update(
|
|
|
|
|
$hostId,
|
|
|
|
|
(string) $ipv6Created['saved_pool_key'],
|
|
|
|
|
$actor,
|
|
|
|
|
array_replace($ipv6Body, [
|
|
|
|
|
'dns_servers' => ['9.9.9.9'],
|
|
|
|
|
'expected_revision' => 1,
|
|
|
|
|
])
|
|
|
|
|
),
|
|
|
|
|
409,
|
|
|
|
|
'启用地址池必须使用完全相同且顺序一致的 DNS'
|
|
|
|
|
);
|
|
|
|
|
$ipv6Pool->refresh();
|
|
|
|
|
$assert((int) $ipv6Pool->desired_revision === 1
|
|
|
|
|
&& (string) $ipv6Pool->dns_servers_json === '["1.1.1.1"]',
|
|
|
|
|
'Rejecting a mismatched paired DNS update changed the IPv6 pool.');
|
|
|
|
|
|
|
|
|
|
$blockedRangeBody = array_replace($ipv6Body, [
|
|
|
|
|
'name' => 'Blocked sparse range',
|
|
|
|
|
'cidr' => '2404:c140:156:3b::/120',
|
|
|
|
|
'gateway' => '2404:c140:156:3b::10',
|
|
|
|
|
'dns_servers' => [
|
|
|
|
|
'2404:c140:156:3b::10',
|
|
|
|
|
'2404:c140:156:3b:0:0:0:10',
|
|
|
|
|
],
|
|
|
|
|
'dns_servers' => ['1.1.1.1'],
|
|
|
|
|
'reserved_ips' => ['2404:c140:156:3b::10'],
|
|
|
|
|
'allocation_start' => '2404:c140:156:3b::10',
|
|
|
|
|
'allocation_end' => '2404:c140:156:3b::13',
|
|
|
|
|
|