Skip to content

Commit

Permalink
Merge pull request #160 from imjoey/indent_2_whitespaces
Browse files Browse the repository at this point in the history
Format the HCL code snippets defined in acceptance tests
  • Loading branch information
imjoey authored Jul 10, 2019
2 parents cefcd56 + 80607e0 commit 02583d0
Show file tree
Hide file tree
Showing 25 changed files with 361 additions and 356 deletions.
8 changes: 4 additions & 4 deletions ovirt/data_source_ovirt_authzs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func TestAccOvirtAuthzsDataSource_nameRegexFilter(t *testing.T) {

var testAccCheckOvirtAuthzsDataSourceNameRegexConfig = `
data "ovirt_authzs" "name_regex_filtered_authz" {
name_regex = "^internal-*"
search {
max = 1
}
name_regex = "^internal-*"
search {
max = 1
}
}
`
14 changes: 7 additions & 7 deletions ovirt/data_source_ovirt_clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ func TestAccOvirtClustersDataSource_searchFilter(t *testing.T) {

var testAccCheckOvirtClustersDataSourceNameRegexConfig = `
data "ovirt_clusters" "name_regex_filtered_cluster" {
name_regex = "^Default*"
}
name_regex = "^Default*"
}
`

var testAccCheckOvirtClustersDataSourceSearchConfig = `
data "ovirt_clusters" "search_filtered_cluster" {
search = {
criteria = "name = Default"
max = 1
case_sensitive = false
}
search = {
criteria = "name = Default"
max = 1
case_sensitive = false
}
}
`
14 changes: 7 additions & 7 deletions ovirt/data_source_ovirt_datacenters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ func TestAccOvirtDataCentersDataSource_searchFilter(t *testing.T) {

var testAccCheckOvirtDataCentersDataSourceNameRegexConfig = `
data "ovirt_datacenters" "name_regex_filtered_datacenter" {
name_regex = "^Defa*"
}
name_regex = "^Defa*"
}
`

var testAccCheckOvirtDataCentersDataSourceSearchConfig = `
data "ovirt_datacenters" "search_filtered_datacenter" {
search = {
criteria = "name = Default and status = up and Storage.name = data"
max = 2
case_sensitive = false
}
search = {
criteria = "name = Default and status = up and Storage.name = data"
max = 2
case_sensitive = false
}
}
`
14 changes: 7 additions & 7 deletions ovirt/data_source_ovirt_disks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ func TestAccOvirtDisksDataSource_searchFilter(t *testing.T) {

var testAccCheckOvirtDisksDataSourceNameRegexConfig = `
data "ovirt_disks" "name_regex_filtered_disk" {
name_regex = "^test_disk*"
}
name_regex = "^test_disk*"
}
`

var testAccCheckOvirtDisksDataSourceSearchConfig = `
data "ovirt_disks" "search_filtered_disk" {
search = {
criteria = "name = test_disk1 and provisioned_size > 1024000000"
max = 1
case_sensitive = false
}
search = {
criteria = "name = test_disk1 and provisioned_size > 1024000000"
max = 1
case_sensitive = false
}
}
`
14 changes: 7 additions & 7 deletions ovirt/data_source_ovirt_hosts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ func TestAccOvirtHostsDataSource_searchFilter(t *testing.T) {

var testAccCheckOvirtHostsDataSourceNameRegexConfig = `
data "ovirt_hosts" "name_regex_filtered_host" {
name_regex = "^host*"
}
name_regex = "^host*"
}
`

var testAccCheckOvirtHostsDataSourceSearchConfig = `
data "ovirt_hosts" "search_filtered_host" {
search = {
criteria = "name = host65"
max = 1
case_sensitive = false
}
search = {
criteria = "name = host65"
max = 1
case_sensitive = false
}
}
`
8 changes: 4 additions & 4 deletions ovirt/data_source_ovirt_mac_pools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func TestAccOvirtMacPoolsDataSource_nameRegexFilter(t *testing.T) {

var testAccCheckOvirtMacPoolsDataSourceNameRegexConfig = `
data "ovirt_mac_pools" "name_regex_filtered_pool" {
name_regex = "\\w*efault*"
search {
max = 1
}
name_regex = "\\w*efault*"
search {
max = 1
}
}
`
14 changes: 7 additions & 7 deletions ovirt/data_source_ovirt_networks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ func TestAccOvirtNetworksDataSource_searchFilter(t *testing.T) {

var testAccCheckOvirtNetworksDataSourceNameRegexConfig = `
data "ovirt_networks" "name_regex_filtered_network" {
name_regex = "^ovirtmgmt-t*"
}
name_regex = "^ovirtmgmt-t*"
}
`

var testAccCheckOvirtNetworksDataSourceSearchConfig = `
data "ovirt_networks" "search_filtered_network" {
search = {
criteria = "datacenter = Default and name = ovirtmgmt-test"
max = 1
case_sensitive = false
}
search = {
criteria = "datacenter = Default and name = ovirtmgmt-test"
max = 1
case_sensitive = false
}
}
`
14 changes: 7 additions & 7 deletions ovirt/data_source_ovirt_storagedomains_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ func TestAccOvirtStorageDomainsDataSource_searchFilter(t *testing.T) {

var TestAccOvirtStorageDomainsDataSourceNameRegexConfig = `
data "ovirt_storagedomains" "name_regex_filtered_storagedomain" {
name_regex = "^MAIN_dat.*|^DEV_dat.*"
}
name_regex = "^MAIN_dat.*|^DEV_dat.*"
}
`

var TestAccOvirtStorageDomainsDataSourceSearchConfig = `
data "ovirt_storagedomains" "search_filtered_storagedomain" {
name_regex = "^DS_*"
search = {
criteria = "status != unattached and name = DS_INTERNAL and datacenter = MY_DC"
case_sensitive = false
}
name_regex = "^DS_*"
search = {
criteria = "status != unattached and name = DS_INTERNAL and datacenter = MY_DC"
case_sensitive = false
}
}
`
10 changes: 5 additions & 5 deletions ovirt/data_source_ovirt_users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ func TestAccOvirtUsersDataSource_searchFilter(t *testing.T) {

var testAccCheckOvirtUsersDataSourceNameRegexConfig = `
data "ovirt_users" "name_regex_filtered_user" {
name_regex = "^admin*"
name_regex = "^admin*"
}
`

var testAccCheckOvirtUsersDataSourceSearchConfig = `
data "ovirt_users" "search_filtered_user" {
search {
max = 1
criteria = "name = admin"
}
search {
max = 1
criteria = "name = admin"
}
}
`
12 changes: 6 additions & 6 deletions ovirt/data_source_ovirt_vms_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ func TestAccOvirtVMsDataSource_searchFilter(t *testing.T) {

var testAccCheckOvirtVMsDataSourceNameRegexConfig = `
data "ovirt_vms" "name_regex_filtered_vm" {
name_regex = "\\w*ostedEn*"
name_regex = "\\w*ostedEn*"
}
`

var testAccCheckOvirtVMsDataSourceSearchConfig = `
data "ovirt_vms" "search_filtered_vm" {
search = {
criteria = "name = HostedEngine and status = up"
max = 2
case_sensitive = false
}
search = {
criteria = "name = HostedEngine and status = up"
max = 2
case_sensitive = false
}
}
`
6 changes: 3 additions & 3 deletions ovirt/data_source_ovirt_vnic_profiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestAccOvirtVNicProfilesDataSource_nameRegexFilter(t *testing.T) {

var testAccCheckOvirtVNicProfilesDataSourceNameRegexConfig = `
data "ovirt_vnic_profiles" "name_regex_filtered_cluster" {
name_regex = ".*mirror$"
network_id = "649f2d61-7f23-477b-93bd-d55f974d8bc8"
}
name_regex = ".*mirror$"
network_id = "649f2d61-7f23-477b-93bd-d55f974d8bc8"
}
`
48 changes: 25 additions & 23 deletions ovirt/resource_ovirt_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,32 +101,34 @@ func testAccCheckOvirtClusterExists(n string, v *ovirtsdk4.Cluster) resource.Tes
func testAccClusterBasic(datacenterID, networkID string) string {
return fmt.Sprintf(`
resource "ovirt_cluster" "cluster" {
name = "testAccOvirtClusterBasic"
description = "Desc of cluster"
datacenter_id = "%s"
management_network_id = "%s"
memory_policy_over_commit_percent = 100
ballooning = true
gluster = true
threads_as_cores = true
cpu_arch = "x86_64"
cpu_type = "Intel SandyBridge Family"
compatibility_version = "4.1"
}`, datacenterID, networkID)
name = "testAccOvirtClusterBasic"
description = "Desc of cluster"
datacenter_id = "%s"
management_network_id = "%s"
memory_policy_over_commit_percent = 100
ballooning = true
gluster = true
threads_as_cores = true
cpu_arch = "x86_64"
cpu_type = "Intel SandyBridge Family"
compatibility_version = "4.1"
}
`, datacenterID, networkID)
}

func testAccClusterBasicUpdate(datacenterID, networkID string) string {
return fmt.Sprintf(`
resource "ovirt_cluster" "cluster" {
name = "testAccOvirtClusterBasicUpdate"
datacenter_id = "%s"
management_network_id = "%s"
memory_policy_over_commit_percent = 100
ballooning = true
gluster = true
threads_as_cores = true
cpu_arch = "x86_64"
cpu_type = "Intel SandyBridge Family"
compatibility_version = "4.1"
}`, datacenterID, networkID)
name = "testAccOvirtClusterBasicUpdate"
datacenter_id = "%s"
management_network_id = "%s"
memory_policy_over_commit_percent = 100
ballooning = true
gluster = true
threads_as_cores = true
cpu_arch = "x86_64"
cpu_type = "Intel SandyBridge Family"
compatibility_version = "4.1"
}
`, datacenterID, networkID)
}
12 changes: 6 additions & 6 deletions ovirt/resource_ovirt_datacenter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ func testAccCheckOvirtDataCenterExists(n string, v *ovirtsdk4.DataCenter) resour

const testAccDataCenterBasic = `
resource "ovirt_datacenter" "datacenter" {
name = "testAccOvirtDataCenterBasic"
description = "my new dc"
local = false
name = "testAccOvirtDataCenterBasic"
description = "my new dc"
local = false
}
`

const testAccDataCenterBasicUpdate = `
resource "ovirt_datacenter" "datacenter" {
name = "testAccOvirtDataCenterBasicUpdate"
description = "my updated new dc"
local = true
name = "testAccOvirtDataCenterBasicUpdate"
description = "my updated new dc"
local = true
}
`
24 changes: 12 additions & 12 deletions ovirt/resource_ovirt_disk_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,25 @@ func testAccCheckOvirtDiskAttachmentExists(n string, diskAttachment *ovirtsdk4.D
func testAccDiskAttachmentBasic(vmID, diskID string) string {
return fmt.Sprintf(`
resource "ovirt_disk_attachment" "attachment" {
vm_id = "%s"
disk_id = "%s"
bootable = true
interface = "virtio"
active = true
read_only = true
vm_id = "%s"
disk_id = "%s"
bootable = true
interface = "virtio"
active = true
read_only = true
}
`, vmID, diskID)
}

func testAccDiskAttachmentBasicUpdate(vmID, diskID string) string {
return fmt.Sprintf(`
resource "ovirt_disk_attachment" "attachment" {
vm_id = "%s"
disk_id = "%s"
bootable = false
interface = "virtio"
active = false
read_only = true
vm_id = "%s"
disk_id = "%s"
bootable = false
interface = "virtio"
active = false
read_only = true
}
`, vmID, diskID)
}
Loading

0 comments on commit 02583d0

Please sign in to comment.