// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Mozilla Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://mozilla.org/MPL/2.0/
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: MPL-2.0

// Code generated by "gen/generator.go"; DO NOT EDIT.

package provider

// Section below is generated&owned by "gen/generator.go". //template:begin imports
import (
	"testing"

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

// End of section. //template:end imports

// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource

func TestAccDataSourceIosxeAccessListExtended(t *testing.T) {
	var checks []resource.TestCheckFunc
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.sequence", "10"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.remark", "Description"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.ace_rule_action", "permit"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.ace_rule_protocol", "tcp"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.source_prefix", "10.0.0.0"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.source_prefix_mask", "0.0.0.255"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.source_port_equal", "1000"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.destination_host", "10.1.1.1"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.destination_port_range_from", "1000"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.destination_port_range_to", "2000"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.ack", "true"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.fin", "true"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.psh", "true"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.rst", "true"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.syn", "true"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.urg", "true"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.dscp", "46"))
	checks = append(checks, resource.TestCheckResourceAttr("data.iosxe_access_list_extended.test", "entries.0.log", "true"))
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t) },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config: testAccDataSourceIosxeAccessListExtendedConfig(),
				Check:  resource.ComposeTestCheckFunc(checks...),
			},
		},
	})
}

// End of section. //template:end testAccDataSource

// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
// End of section. //template:end testPrerequisites

// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig

func testAccDataSourceIosxeAccessListExtendedConfig() string {
	config := `resource "iosxe_access_list_extended" "test" {` + "\n"
	config += `	name = "EACL1"` + "\n"
	config += `	entries = [{` + "\n"
	config += `		sequence = 10` + "\n"
	config += `		remark = "Description"` + "\n"
	config += `		ace_rule_action = "permit"` + "\n"
	config += `		ace_rule_protocol = "tcp"` + "\n"
	config += `		source_prefix = "10.0.0.0"` + "\n"
	config += `		source_prefix_mask = "0.0.0.255"` + "\n"
	config += `		source_port_equal = "1000"` + "\n"
	config += `		destination_host = "10.1.1.1"` + "\n"
	config += `		destination_port_range_from = "1000"` + "\n"
	config += `		destination_port_range_to = "2000"` + "\n"
	config += `		ack = true` + "\n"
	config += `		fin = true` + "\n"
	config += `		psh = true` + "\n"
	config += `		rst = true` + "\n"
	config += `		syn = true` + "\n"
	config += `		urg = true` + "\n"
	config += `		dscp = "46"` + "\n"
	config += `		log = true` + "\n"
	config += `	}]` + "\n"
	config += `}` + "\n"

	config += `
		data "iosxe_access_list_extended" "test" {
			name = "EACL1"
			depends_on = [iosxe_access_list_extended.test]
		}
	`
	return config
}

// End of section. //template:end testAccDataSourceConfig
