Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new testcases #196

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/common/access_policy.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resource "intersight_access_policy" "access1" {
name = "access1"
description = "demo imc access policy"
organization {
object_type = "organization.Organization"
moid = data.intersight_organization_organization.default.results.0.moid
}
configuration_type{
configure_inband = false
configure_out_of_band = true
}
out_of_band_ip_pool {
object_type = "ippool.Pool"
moid = intersight_ippool_pool.ippool_pool_tf.moid
}
}
25 changes: 25 additions & 0 deletions tests/common/ippool_pool.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
resource "intersight_ippool_pool" "ippool_pool_tf" {
name = "ippool_pool_tf"
description = "ippool test"
assignment_order = "sequential"

ip_v4_blocks {
class_id = "ippool.IpV4Block"
object_type = "ippool.IpV4Block"
from = "10.1.1.1"
to = "10.1.1.3"
}

ip_v4_config {
object_type = "ippool.IpV4Config"
class_id = "ippool.IpV4Config"
gateway = "10.1.1.1"
netmask = "255.0.0.0"
primary_dns = "8.8.8.8"
}

organization {
object_type = "organization.Organization"
moid = data.intersight_organization_organization.default.results.0.moid
}
}
17 changes: 17 additions & 0 deletions tests/common/kubernetes_virtual_machine_infra_config_policy.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resource "intersight_kubernetes_virtual_machine_infra_config_policy" "vm_infra_config_policy" {
name = "TFC-Test-1"
description = "VM Infrastructure Config Policy used for Kubernetes deployment to vSphere"
organization {
object_type = "organization.Organization"
moid = data.intersight_organization_organization.default.results[0].moid
}
vm_config {
object_type = "kubernetes.EsxiVirtualMachineInfraConfig"
interfaces = ["8", "4"]
additional_properties = jsonencode({
Cluster = "abc"
Datastore = "datastore"
Passphrase = "password123"
})
}
}
6 changes: 6 additions & 0 deletions tests/common/snmp_policy.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "intersight_snmp_policy" "snmp_tf" {
name = "snmp_tf"
enabled = false
v2_enabled = false
v3_enabled = false
}
27 changes: 27 additions & 0 deletions tests/common/storage_storage_policy.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
resource "intersight_storage_storage_policy" "storage_storage1" {
name = "storage_storage_policy-testing"
description = "storage policy test"
unused_disks_state = "UnconfiguredGood"
organization {
object_type = "organization.Organization"
moid = data.intersight_organization_organization.default.results[0].moid
}
use_jbod_for_vd_creation = false
m2_virtual_drive {
enable = false
object_type = "storage.M2VirtualDriveConfig"
}
raid0_drive {
enable = true
drive_slots = "2"
object_type = "storage.R0Drive"
virtual_drive_policy {
strip_size = 64
access_policy = "Default"
read_policy = "Default"
write_policy = "Default"
drive_cache = "Default"
object_type = "storage.VirtualDrivePolicy"
}
}
}
34 changes: 34 additions & 0 deletions tests/common/workflow_workflow_definition.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
resource "intersight_workflow_workflow_definition" "ProvisionNetwork" {
name = "ProvisionNetwork"
label = "TF Testing"
default_version = true
output_definition {
object_type = "workflow.PrimitiveDataType"
name = "status"
label = "status"
required = false
default {
object_type = "workflow.DefaultValue"
override = false
value = null
}
display_meta {
object_type = "workflow.DisplayMeta"
inventory_selector = true
}
}
tasks {
description = "Create a vm"
label = "StartTask"
name = "StartTask"
object_type = "workflow.StartTask"
}
ui_rendering_data = jsonencode({
Positions = {
Name = "StartTask"
X = 209
Y = 79
}
Version = 1
})
}