// Code generated by "gen/generator.go"; DO NOT EDIT.
// In order to regenerate this file execute `go generate` from the repository root.
// More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md).

package provider

import (
	"regexp"
	"testing"

	"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

func TestAccResourceNdIfPolWithFvTenant(t *testing.T) {

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.1(1j)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigNdIfPolMinDependencyWithFvTenantAllowExisting + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "controller_state.#", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "controller_state.#", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "description", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "description", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "hop_limit", "64"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "hop_limit", "64"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "mtu", "9000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "mtu", "9000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "neighbor_solicitation_interval", "1000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "neighbor_solicitation_interval", "1000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "neighbor_solicitation_retries", "3"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "neighbor_solicitation_retries", "3"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "reachable_time", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "reachable_time", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "retransmit_timer", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "retransmit_timer", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "router_advertisement_interval", "600"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "router_advertisement_interval", "600"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "router_advertisement_lifetime", "1800"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "router_advertisement_lifetime", "1800"),
					composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "nud_retry_base", "1"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "nud_retry_base", "1"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "nud_retry_interval", "1000"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "nud_retry_interval", "1000"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "nud_retry_max_attempts", "3"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "nud_retry_max_attempts", "3")),
				),
			},
		},
	})

	setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "false")
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.1(1j)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:      testConfigNdIfPolMinDependencyWithFvTenantAllowExisting + testConfigDataSourceSystem,
				ExpectError: regexp.MustCompile("Object Already Exists"),
			},
		},
	})

	setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "true")
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.1(1j)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigNdIfPolMinDependencyWithFvTenantAllowExisting + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "controller_state.#", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "controller_state.#", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "description", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "description", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "hop_limit", "64"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "hop_limit", "64"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "mtu", "9000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "mtu", "9000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "neighbor_solicitation_interval", "1000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "neighbor_solicitation_interval", "1000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "neighbor_solicitation_retries", "3"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "neighbor_solicitation_retries", "3"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "reachable_time", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "reachable_time", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "retransmit_timer", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "retransmit_timer", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "router_advertisement_interval", "600"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "router_advertisement_interval", "600"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "router_advertisement_lifetime", "1800"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "router_advertisement_lifetime", "1800"),
					composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "nud_retry_base", "1"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "nud_retry_base", "1"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "nud_retry_interval", "1000"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "nud_retry_interval", "1000"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test", "nud_retry_max_attempts", "3"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.allow_test_2", "nud_retry_max_attempts", "3")),
				),
			},
		},
	})

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "1.1(1j)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigNdIfPolMinDependencyWithFvTenant + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "controller_state.#", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "hop_limit", "64"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "mtu", "9000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "neighbor_solicitation_interval", "1000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "neighbor_solicitation_retries", "3"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "reachable_time", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "retransmit_timer", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_interval", "600"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_lifetime", "1800"),
					composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_base", "1"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_interval", "1000"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_max_attempts", "3")),
				),
			},
			// Update with all config and verify default APIC values
			{
				Config:             testConfigNdIfPolAllDependencyWithFvTenant + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotation", "annotation"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "controller_state.#", "1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "controller_state.0", "managed-cfg"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "description", "description_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "hop_limit", "40"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "mtu", "8700"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "neighbor_solicitation_interval", "1500"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "neighbor_solicitation_retries", "6"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "owner_key", "owner_key_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "owner_tag", "owner_tag_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "reachable_time", "2"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "retransmit_timer", "2"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_interval", "500"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_lifetime", "1500"),
					composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_base", "2"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_interval", "1300"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_max_attempts", "5")),
				),
			},
			// Update with minimum config and verify config is unchanged
			{
				Config:             testConfigNdIfPolMinDependencyWithFvTenant + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "name", "test_name"),
				),
			},
			// Update with empty strings config or default value
			{
				Config:             testConfigNdIfPolResetDependencyWithFvTenant + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "controller_state.#", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "hop_limit", "64"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "mtu", "9000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "neighbor_solicitation_interval", "1000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "neighbor_solicitation_retries", "3"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "reachable_time", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "retransmit_timer", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_interval", "600"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_lifetime", "1800"),
					composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_base", "1"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_interval", "1000"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_max_attempts", "3")),
				),
			},
			// Import testing
			{
				ResourceName:      "aci_neighbor_discovery_interface_policy.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children
			{
				Config:             testConfigNdIfPolChildrenDependencyWithFvTenant + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "controller_state.#", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "hop_limit", "64"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "mtu", "9000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "neighbor_solicitation_interval", "1000"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "neighbor_solicitation_retries", "3"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "reachable_time", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "retransmit_timer", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_interval", "600"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "router_advertisement_lifetime", "1800"),
					composeAggregateTestCheckFuncWithVersion(t, "5.1(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_base", "1"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_interval", "1000"),
						resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "nud_retry_max_attempts", "3")),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.1.value", "test_value"),
				),
			},
			// Refresh State before import testing to ensure that the state is up to date
			{
				RefreshState:       true,
				ExpectNonEmptyPlan: false,
			},
			// Import testing with children
			{
				ResourceName:      "aci_neighbor_discovery_interface_policy.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children removed from config
			{
				Config:             testConfigNdIfPolChildrenRemoveFromConfigDependencyWithFvTenant + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.#", "2"),
				),
			},
			// Update with children first child removed
			{
				Config:             testConfigNdIfPolChildrenRemoveOneDependencyWithFvTenant + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.#", "1"),
				),
			},
			// Update with all children removed
			{
				Config:             testConfigNdIfPolChildrenRemoveAllDependencyWithFvTenant + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_neighbor_discovery_interface_policy.test", "tags.#", "0"),
				),
			},
		},
		CheckDestroy: testCheckResourceDestroy,
	})
}

const testConfigNdIfPolMinDependencyWithFvTenantAllowExisting = testConfigFvTenantMin + `
resource "aci_neighbor_discovery_interface_policy" "allow_test" {
  parent_dn = aci_tenant.test.id
  name = "test_name"
}
resource "aci_neighbor_discovery_interface_policy" "allow_test_2" {
  parent_dn = aci_tenant.test.id
  name = "test_name"
  depends_on = [aci_neighbor_discovery_interface_policy.allow_test]
}
`

const testConfigNdIfPolMinDependencyWithFvTenant = testConfigFvTenantMin + `
resource "aci_neighbor_discovery_interface_policy" "test" {
  parent_dn = aci_tenant.test.id
  name = "test_name"
}
`

const testConfigNdIfPolAllDependencyWithFvTenant = testConfigFvTenantMin + `
resource "aci_neighbor_discovery_interface_policy" "test" {
  parent_dn = aci_tenant.test.id
  name = "test_name"
  annotation = "annotation"
  controller_state = ["managed-cfg"]
  description = "description_1"
  hop_limit = "40"
  mtu = "8700"
  name_alias = "name_alias_1"
  neighbor_solicitation_interval = "1500"
  neighbor_solicitation_retries = "6"
  owner_key = "owner_key_1"
  owner_tag = "owner_tag_1"
  reachable_time = "2"
  retransmit_timer = "2"
  router_advertisement_interval = "500"
  router_advertisement_lifetime = "1500"
  nud_retry_base = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.1(1h)-") ? "2" : null
  nud_retry_interval = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.1(1h)-") ? "1300" : null
  nud_retry_max_attempts = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.1(1h)-") ? "5" : null
}
`

const testConfigNdIfPolResetDependencyWithFvTenant = testConfigFvTenantMin + `
resource "aci_neighbor_discovery_interface_policy" "test" {
  parent_dn = aci_tenant.test.id
  name = "test_name"
  annotation = "orchestrator:terraform"
  controller_state = []
  description = ""
  hop_limit = "64"
  mtu = "9000"
  name_alias = ""
  neighbor_solicitation_interval = "1000"
  neighbor_solicitation_retries = "3"
  owner_key = ""
  owner_tag = ""
  reachable_time = "0"
  retransmit_timer = "0"
  router_advertisement_interval = "600"
  router_advertisement_lifetime = "1800"
  nud_retry_base = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.1(1h)-") ? "1" : null
  nud_retry_interval = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.1(1h)-") ? "1000" : null
  nud_retry_max_attempts = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.1(1h)-") ? "3" : null
}
`
const testConfigNdIfPolChildrenDependencyWithFvTenant = testConfigFvTenantMin + `
resource "aci_neighbor_discovery_interface_policy" "test" {
  parent_dn = aci_tenant.test.id
  name = "test_name"
  annotations = [
    {
      key = "key_0"
      value = "value_1"
    },
    {
      key = "key_1"
      value = "test_value"
    },
  ]
  tags = [
    {
      key = "key_0"
      value = "value_1"
    },
    {
      key = "key_1"
      value = "test_value"
    },
  ]
}
`

const testConfigNdIfPolChildrenRemoveFromConfigDependencyWithFvTenant = testConfigFvTenantMin + `
resource "aci_neighbor_discovery_interface_policy" "test" {
  parent_dn = aci_tenant.test.id
  name = "test_name"
}
`

const testConfigNdIfPolChildrenRemoveOneDependencyWithFvTenant = testConfigFvTenantMin + `
resource "aci_neighbor_discovery_interface_policy" "test" {
  parent_dn = aci_tenant.test.id
  name = "test_name"
  annotations = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
  tags = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
}
`

const testConfigNdIfPolChildrenRemoveAllDependencyWithFvTenant = testConfigFvTenantMin + `
resource "aci_neighbor_discovery_interface_policy" "test" {
  parent_dn = aci_tenant.test.id
  name = "test_name"
  annotations = []
  tags = []
}
`
