diff --git a/internal/provider/networking/network_ip_interface_resource_alias_test.go b/internal/provider/networking/network_ip_interface_resource_alias_test.go index 797e220c..ddca2410 100644 --- a/internal/provider/networking/network_ip_interface_resource_alias_test.go +++ b/internal/provider/networking/network_ip_interface_resource_alias_test.go @@ -18,28 +18,30 @@ func TestAccNetworkIpInterfaceResourceAlias(t *testing.T) { Steps: []resource.TestStep{ // non-existant SVM return code 2621462. Must happen before create/read { - Config: testAccNetworkIPInterfaceResourceConfigAlias("non-existant", "10.10.10.10", "ontap_cluster_1-01"), + Config: testAccNetworkIPInterfaceResourceConfigAlias("non-existant", "10.10.10.10", "ontap_cluster_1-01", "default-data-files"), ExpectError: regexp.MustCompile("2621462"), }, // non-existant home node { - Config: testAccNetworkIPInterfaceResourceConfigAlias("svm0", "10.10.10.10", "non-existant_home_node"), - ExpectError: regexp.MustCompile("393271"), + Config: testAccNetworkIPInterfaceResourceConfigAlias("svm0", "10.10.10.10", "non-existant_home_node", "default-data-files"), + ExpectError: regexp.MustCompile("53281680"), }, // Create and Read { - Config: testAccNetworkIPInterfaceResourceConfigAlias("svm0", "10.10.10.10", "ontap_cluster_1-01"), + Config: testAccNetworkIPInterfaceResourceConfigAlias("svm0", "10.10.10.10", "ontap_cluster_1-01", "default-data-files"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface_resource.example", "name", "test-interface"), resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface_resource.example", "svm_name", "svm0"), + resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface_resource.example", "service_policy", "default-data-files"), ), }, // Update and Read { - Config: testAccNetworkIPInterfaceResourceConfigAlias("svm0", "10.10.10.20", "ontap_cluster_1-01"), + Config: testAccNetworkIPInterfaceResourceConfigAlias("svm0", "10.10.10.20", "ontap_cluster_1-01", "default-data-iscsi"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface_resource.example", "name", "test-interface"), resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface_resource.example", "ip.address", "10.10.10.20"), + resource.TestCheckResourceAttr("netapp-ontap_networking_ip_interface_resource.example", "service_policy", "default-data-iscsi"), ), }, // Test importing a resource @@ -56,7 +58,7 @@ func TestAccNetworkIpInterfaceResourceAlias(t *testing.T) { }) } -func testAccNetworkIPInterfaceResourceConfigAlias(svmName, address, homeNode string) string { +func testAccNetworkIPInterfaceResourceConfigAlias(svmName, address, homeNode, servicePolicy string) string { host := os.Getenv("TF_ACC_NETAPP_HOST") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -89,6 +91,7 @@ resource "netapp-ontap_networking_ip_interface_resource" "example" { home_port = "e0d" home_node = "%s" } + service_policy = "%s" } -`, host, admin, password, svmName, address, homeNode) +`, host, admin, password, svmName, address, homeNode, servicePolicy) } diff --git a/internal/provider/networking/network_ip_interface_resource_test.go b/internal/provider/networking/network_ip_interface_resource_test.go index 4ef33956..4a252868 100644 --- a/internal/provider/networking/network_ip_interface_resource_test.go +++ b/internal/provider/networking/network_ip_interface_resource_test.go @@ -18,28 +18,30 @@ func TestAccNetworkIpInterfaceResource(t *testing.T) { Steps: []resource.TestStep{ // non-existant SVM return code 2621462. Must happen before create/read { - Config: testAccNetworkIPInterfaceResourceConfig("non-existant", "10.10.10.10", "ontap_cluster_1-01"), + Config: testAccNetworkIPInterfaceResourceConfig("non-existant", "10.10.10.10", "ontap_cluster_1-01", "default-data-files"), ExpectError: regexp.MustCompile("2621462"), }, // non-existant home node { - Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.10", "non-existant_home_node"), - ExpectError: regexp.MustCompile("393271"), + Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.10", "non-existant_home_node", "default-data-files"), + ExpectError: regexp.MustCompile("53281680"), }, // Create and Read { - Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.10", "ontap_cluster_1-01"), + Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.10", "ontap_cluster_1-01", "default-data-files"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "name", "test-interface"), resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "svm_name", "svm0"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "service_policy", "default-data-files"), ), }, // Update and Read { - Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.20", "ontap_cluster_1-01"), + Config: testAccNetworkIPInterfaceResourceConfig("svm0", "10.10.10.20", "ontap_cluster_1-01", "default-data-iscsi"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "name", "test-interface"), resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "ip.address", "10.10.10.20"), + resource.TestCheckResourceAttr("netapp-ontap_network_ip_interface.example", "service_policy", "default-data-iscsi"), ), }, // Test importing a resource @@ -56,7 +58,7 @@ func TestAccNetworkIpInterfaceResource(t *testing.T) { }) } -func testAccNetworkIPInterfaceResourceConfig(svmName, address, homeNode string) string { +func testAccNetworkIPInterfaceResourceConfig(svmName, address, homeNode, servicePolicy string) string { host := os.Getenv("TF_ACC_NETAPP_HOST") admin := os.Getenv("TF_ACC_NETAPP_USER") password := os.Getenv("TF_ACC_NETAPP_PASS") @@ -89,6 +91,7 @@ resource "netapp-ontap_network_ip_interface" "example" { home_port = "e0d" home_node = "%s" } + service_policy = "%s" } -`, host, admin, password, svmName, address, homeNode) +`, host, admin, password, svmName, address, homeNode, servicePolicy) }