# ----------------------------------------------------------------------------
#
#     ***     AUTO GENERATED CODE    ***    AUTO GENERATED CODE     ***
#
# ----------------------------------------------------------------------------
#
#     This file is automatically generated by Magic Modules and manual
#     changes will be clobbered when the file is regenerated.
#
#     Please read more about how to change this file in README.md and
#     CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------

title 'Test GCP google_compute_forwarding_rule resource.'

gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.')
gcp_lb_region = input(:gcp_lb_region, value: 'gcp_lb_region', description: 'The region used for the forwarding rule.')
gcp_fr_udp_name = input(:gcp_fr_udp_name, value: 'gcp_fr_udp_name', description: 'The forwarding rule name.')

control 'google_compute_forwarding_rule-1.0' do
  impact 1.0
  title 'google_compute_forwarding_rule resource test'


  describe google_compute_forwarding_rule(project: gcp_project_id, region: gcp_lb_region, name: "#{gcp_fr_udp_name}-500") do
    it { should exist }
    its('region') { should match gcp_lb_region }
    its('creation_timestamp') { should be > Time.now - 365*60*60*24*10 }
    its('load_balancing_scheme') { should match 'EXTERNAL' }
    its('port_range') { should match "500-500" }
    its('ip_protocol') { should match "UDP" }
  end

  describe google_compute_forwarding_rule(project: gcp_project_id, region: gcp_lb_region, name: "nonexistent") do
    it { should_not exist }
  end
end
