@@ -16,12 +16,13 @@ import (
1616// Since we only have access to one test prefix range we cannot run tests in parallel
1717func TestAccComputePublicPrefixes (t * testing.T ) {
1818 testCases := map [string ]func (t * testing.T ){
19- "delegated_prefix" : testAccComputePublicDelegatedPrefix_publicDelegatedPrefixesBasicTest ,
20- "advertised_prefix" : testAccComputePublicAdvertisedPrefix_publicAdvertisedPrefixesBasicTest ,
21- "public_delegated_prefixes_ipv6" : testAccComputePublicDelegatedPrefix_publicDelegatedPrefixesIpv6Test ,
22- "public_advertised_prefixes_pdp_scope" : testAccComputePublicAdvertisedPrefix_publicAdvertisedPrefixesPdpScopeTest ,
23- "public_delegated_prefix_ipv6_subnet_mode" : testAccComputePublicDelegatedPrefix_publicDelegatedPrefixIpv6SubnetModeTest ,
24- "public_delgated_prefix_with_sub_prefix" : TestAccComputePublicDelegatedPrefix_computePublicDelegatedPrefixWithSubPrefixExample ,
19+ "delegated_prefix" : testAccComputePublicDelegatedPrefix_publicDelegatedPrefixesBasicTest ,
20+ "advertised_prefix" : testAccComputePublicAdvertisedPrefix_publicAdvertisedPrefixesBasicTest ,
21+ "public_delegated_prefixes_ipv6" : testAccComputePublicDelegatedPrefix_publicDelegatedPrefixesIpv6Test ,
22+ "public_advertised_prefixes_pdp_scope" : testAccComputePublicAdvertisedPrefix_publicAdvertisedPrefixesPdpScopeTest ,
23+ "public_delegated_prefix_ipv6_subnet_mode" : testAccComputePublicDelegatedPrefix_publicDelegatedPrefixIpv6SubnetModeTest ,
24+ "public_delgated_prefix_with_sub_prefix" : TestAccComputePublicDelegatedPrefix_computePublicDelegatedPrefixWithSubPrefixExample ,
25+ "public_advertised_prefixes_internal_ipv6_access" : testAccComputePublicAdvertisedPrefix_publicAdvertisedPrefixesInternalIpv6AccessTest ,
2526 }
2627
2728 for name , tc := range testCases {
@@ -36,8 +37,42 @@ func TestAccComputePublicPrefixes(t *testing.T) {
3637 }
3738}
3839
40+ func testAccComputePublicAdvertisedPrefix_publicAdvertisedPrefixesInternalIpv6AccessTest (t * testing.T ) {
41+ context := map [string ]interface {}{
42+ "description" : envvar .GetTestPublicAdvertisedPrefixDescriptionFromEnv (t ),
43+ "random_suffix" : acctest .RandString (t , 10 ),
44+ }
45+
46+ acctest .VcrTest (t , resource.TestCase {
47+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
48+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
49+ CheckDestroy : testAccCheckComputePublicAdvertisedPrefixDestroyProducer (t ),
50+ Steps : []resource.TestStep {
51+ {
52+ Config : testAccComputePublicAdvertisedPrefix_publicAdvertisedPrefixesInternalIpv6AccessExample (context ),
53+ },
54+ {
55+ ResourceName : "google_compute_public_advertised_prefix.prefix" ,
56+ ImportState : true ,
57+ ImportStateVerify : true ,
58+ },
59+ },
60+ })
61+ }
62+
63+ func testAccComputePublicAdvertisedPrefix_publicAdvertisedPrefixesInternalIpv6AccessExample (context map [string ]interface {}) string {
64+ return acctest .Nprintf (`
65+ resource "google_compute_public_advertised_prefix" "prefix" {
66+ name = "tf-test-my-prefix%{random_suffix}"
67+ description = "%{description}"
68+ ip_cidr_range = "2001:db8::/32"
69+ pdp_scope = "REGIONAL"
70+ ipv6_access_type = "INTERNAL"
71+ }
72+ ` , context )
73+ }
74+
3975func TestAccComputePublicDelegatedPrefix_computePublicDelegatedPrefixWithSubPrefixExample (t * testing.T ) {
40- t .Parallel ()
4176 subPrefixResourceName := "google_compute_public_delegated_prefix.subprefix"
4277 parentProject := "tf-static-byoip"
4378 parentRegion := "us-central1"
0 commit comments