From 741a995c37e391ec7db38b6d123475667aeaffbc Mon Sep 17 00:00:00 2001 From: Meghana R Date: Thu, 18 Aug 2022 13:26:24 +0530 Subject: [PATCH 1/7] Testcases for odata support --- tests/common/odata_test.tf | 310 ++++++++++++++++++++++++ tests/negative_cases/odata_negatives.tf | 53 ++++ 2 files changed, 363 insertions(+) create mode 100644 tests/common/odata_test.tf create mode 100644 tests/negative_cases/odata_negatives.tf diff --git a/tests/common/odata_test.tf b/tests/common/odata_test.tf new file mode 100644 index 0000000000..10cb32e11a --- /dev/null +++ b/tests/common/odata_test.tf @@ -0,0 +1,310 @@ +data "intersight_search_search_item" "odata_top_skip_value1"{ + odata { + top = 143 + skip = 200 + } +} + +data "intersight_aaa_audit_record" "odata_top_skip_small_value1"{ + odata { + top = 80 + skip = 40 + } +} + +data "intersight_workflow_task_info" "odata_top_skip_small_value2"{ + odata { + top = 30 + skip = 60 + } +} + +data "intersight_search_search_item" "odata_top_and_skip_small_value3"{ + odata { + top = 20 + skip = 10 + } +} + +data "intersight_workflow_task_info" "odata_top_skip_value2"{ + odata { + top = 230 + skip = 150 + } +} + +data "intersight_aaa_audit_record" "odata_top_and_skip_value3"{ + odata { + top = 70 + skip = 65 + } +} + +data "intersight_workflow_task_info" "odata_top_and_skip_value4"{ + odata { + top = 174 + skip = 133 + } +} + +data "intersight_search_search_item" "odata_top_and_skip_value5"{ + odata { + top = 440 + skip = 250 + } +} + +data "intersight_aaa_audit_record" "odata_top_and_skip_value6"{ + odata { + top = 748 + skip = 660 + } +} + +data "intersight_aaa_audit_record" "odata_top_and_skip_large_values1"{ + odata { + top = 1000 + skip = 500 + } +} + +data "intersight_aaa_audit_record" "odata_top_value1"{ + odata { + top = 12 + } +} + +data "intersight_appliance_app_status" "odata_skip_value1"{ + odata { + skip = 60 + } +} + +data "intersight_appliance_app_status" "odata_top_value2"{ + odata { + top = 80 + } +} + +data "intersight_search_search_item" "odata_top_value3"{ + odata { + top = 890 + } +} + +data "intersight_workflow_task_metadata" "odata_skip_large_value1"{ + odata { + skip = 200 + } +} + +data "intersight_workflow_task_definition" "odata_skip_large_value2"{ + odata { + skip = 1200 + } +} + +data "intersight_appliance_app_status" "odata_top_zero_value"{ + odata { + top = 0 + } +} + +data "intersight_appliance_app_status" "odata_skip_zero_value"{ + odata { + skip = 0 + } +} + +data "intersight_workflow_workflow_info" "odata_top_negative_value"{ + odata { + top = -20 + } +} + +data "intersight_aaa_audit_record" "odata_top_and_skip_value8"{ + odata { + skip = 500 + top = 700 + } +} + +data "intersight_aaa_audit_record" "odata_top_and_skip_value9"{ + odata { + top = 1300 + skip = 500 + } +} + +data "intersight_workflow_task_definition" "odata_count_true_value"{ + odata { + nr_count = true + } +} + +data "intersight_workflow_task_metadata" "odata_count_false_value"{ + odata { + nr_count = false + } +} + +data "intersight_workflow_task_metadata" "odata_count_filter"{ + odata { + nr_count = true + filter = "Label eq 'Restart IMC'" + } +} + +data "intersight_iam_role" "odata_count_orderby"{ + odata { + nr_count = false + orderby = "CreateTime" + } +} + +data "intersight_hyperflex_software_distribution_component" "odata_orderby_descending"{ + odata { + orderby = "CreateTime desc" + } +} + +data "intersight_adapter_ext_eth_interface" "odata_orderby_ascending_select"{ + odata { + orderby = "CreateTime" + nr_select = "CreateTime,MacAddress" + } +} + +data "intersight_adapter_ext_eth_interface" "odata_orderby_ascending"{ + odata { + orderby = "Moid" + } +} + +data "intersight_appliance_app_status" "odata_orderby_top_skip"{ + odata { + orderby = "ModTime desc" + top = 10 + skip = 50 + } +} + +data "intersight_compute_rack_unit" "odata_filter_equal"{ + odata { + filter = "Name eq 'C125-WZP22360YWC'" + } +} + +data "intersight_adapter_host_eth_interface" "odata_filter_not_equal"{ + odata { + filter = "Moid ne '6167ee1576752d32341e2df3'" + } +} + +data "intersight_adapter_host_eth_interface" "odata_filter_orderby_select"{ + odata { + filter = "Moid ne '6167ee1576752d32341e2df3'" + orderby = "Name" + nr_select = "Name,ModTime" + } +} + +data "intersight_compute_rack_unit" "odata_filter_greater_than"{ + odata { + filter = "AvailableMemory gt 98304" + } +} + +data "intersight_compute_rack_unit" "odata_filter_greater_than_or_equal"{ + odata { + filter = "AvailableMemory ge 98304" + } +} + +data "intersight_compute_rack_unit" "odata_filter_lesser_than"{ + odata { + filter = "AvailableMemory lt 98304" + } +} + +data "intersight_search_search_item" "odata_filter_less_than_or_equal"{ + odata { + filter = "MemorySize le 50" + } +} + +data "intersight_compute_rack_unit" "odata_filter_and_additional_property"{ + odata { + filter = "AvailableMemory gt 65000" + } + additional_properties = jsonencode({ "Model" = "UCSC-C240-M5L"}) +} + +data "intersight_compute_rack_unit" "odata_filter_not_and_top_and_select"{ + odata { + nr_select = "Model,Serial" + top=10 + filter = "not(Model eq 'UCSC-C125' or Model eq 'HX220C-M5S')" + } +} + +data "intersight_compute_rack_unit" "odata_filter_in"{ + odata { + filter = "Model in ('UCSC-C125', 'UCSC-C240-M5L')" + } +} + +data "intersight_compute_rack_unit" "odata_filter_contains"{ + odata { + filter = "contains(Model,'C240')" + } +} + +data "intersight_server_profile" "odata_filter_startswith"{ + odata { + filter = "startswith(Name,'cloned')" + } +} + +data "intersight_server_profile" "odata_filter_endswith"{ + odata { + filter = "endswith(Name,'test')" + } +} + +data "intersight_appliance_app_status" "odata_top_filter_empty_array"{ + odata { + filter = "not(Tags/any())" + top = 5 + } +} + +data "intersight_workflow_workflow_info" "odata_top_filter_not_empty_array"{ + odata { + filter = "Message/any()" + } +} + +data "intersight_compute_rack_unit" "odata_top_skip_select"{ + odata { + top = 20 + skip = 1 + nr_select = "Model,Serial" + } +} + +data "intersight_adapter_host_fc_interface" "odata_top_inlinecount_allpages"{ + odata { + top = 2 + inlinecount = "allpages" + } +} + +data "intersight_adapter_host_fc_interface" "odata_top_inlinecount_none"{ + odata { + top = 3 + inlinecount = "none" + } +} + + diff --git a/tests/negative_cases/odata_negatives.tf b/tests/negative_cases/odata_negatives.tf new file mode 100644 index 0000000000..572a09b330 --- /dev/null +++ b/tests/negative_cases/odata_negatives.tf @@ -0,0 +1,53 @@ +data "intersight_aaa_audit_record" "odata_top_and_skip_negative_values"{ + odata { + skip = -90 + top = -20 + } +} + +data "intersight_search_search_item" "odata_skip_negative_value"{ + odata { + skip = -200 + } +} + +data "intersight_compute_rack_unit" "odata_skip_negative_top_positive_value"{ + odata { + skip = -200 + top = 50 + } +} + +data "intersight_smtp_policy" "odata_skip_negative_top_positive_zero_result_mo"{ + odata { + skip = -600 + top = 10 + } +} + +data "intersight_access_policy" "odata_skip_negative_top_positive_zero_result_mo"{ + odata { + skip = -950 + } +} + +data "intersight_smtp_policy" "odata_top_skip_zero_results"{ + odata { + top = 10 + skip = 23 + } +} + +data "intersight_hyperflex_software_distribution_version" "odata_at1"{ + odata { + at = "Version eq '1.3(1b)'" + } +} + +data "intersight_hyperflex_hxdp_version" "odata_at2"{ + odata { + at = "Version eq '4.0(2e)'" + } +} + + From 36bd976bfd440edbbfce95d593201b912b8b74ab Mon Sep 17 00:00:00 2001 From: Meghana R Date: Thu, 18 Aug 2022 20:28:34 +0530 Subject: [PATCH 2/7] Update "type" with "nr_type" since it's a go reserved word --- examples/chassis/chassis_profile.md | 4 ++-- examples/fabric/fabric_switch_cluster_profile.md | 4 ++-- examples/fabric/fabric_switch_profile.md | 4 ++-- examples/iam/iam_idp.md | 4 ++-- examples/iam/iam_qualifier.md | 4 ++-- examples/kubernetes/kubernetes_aci_cni_profile.md | 4 ++-- examples/kubernetes/kubernetes_cluster_profile.md | 4 ++-- examples/kubernetes/kubernetes_node_group_profile.md | 4 ++-- .../kubernetes/kubernetes_virtual_machine_node_profile.md | 4 ++-- examples/recovery/recovery_backup_profile.md | 4 ++-- examples/sample_modules/server_configurations/sdcard.tf | 4 ++-- examples/sample_modules/server_configurations/snmp.tf | 4 ++-- examples/sdcard/sdcard_policy.md | 4 ++-- examples/snmp/snmp_policy.md | 4 ++-- examples/softwarerepository/softwarerepository_release.md | 4 ++-- examples/tam/tam_advisory_definition.md | 8 ++++---- examples/tam/tam_security_advisory.md | 4 ++-- examples/workflow/workflow_error_response_handler.md | 6 +++--- tests/common/chassis_profile.tf | 2 +- tests/common/fabric_switch_cluster_profile.tf | 2 +- tests/common/fabric_switch_profile.tf | 2 +- tests/common/kubernetes_aci_cni_profile.tf | 2 +- tests/common/sdcard_policy.tf | 2 +- tests/server_configurations/sdcard.tf | 4 ++-- tests/server_configurations/snmp.tf | 4 ++-- tests/server_configurations/storage_drive_group.tf | 4 ++-- 26 files changed, 50 insertions(+), 50 deletions(-) diff --git a/examples/chassis/chassis_profile.md b/examples/chassis/chassis_profile.md index 1f9b04f104..2576cfdad5 100644 --- a/examples/chassis/chassis_profile.md +++ b/examples/chassis/chassis_profile.md @@ -4,7 +4,7 @@ resource "intersight_chassis_profile" "chassis_profile1" { name = "chassis_profile1" description = "chassis profile" - type = "instance" + nr_type = "instance" target_platform = "FIAttached" action = "Validate" config_context { @@ -17,4 +17,4 @@ resource "intersight_chassis_profile" "chassis_profile1" { moid = var.organization } } -``` \ No newline at end of file +``` diff --git a/examples/fabric/fabric_switch_cluster_profile.md b/examples/fabric/fabric_switch_cluster_profile.md index 542e675c4e..dd2886cdb3 100644 --- a/examples/fabric/fabric_switch_cluster_profile.md +++ b/examples/fabric/fabric_switch_cluster_profile.md @@ -4,10 +4,10 @@ resource "intersight_fabric_switch_cluster_profile" "fabric_switch_cluster_profile1" { name = "fabric_switch_cluster_profile" description = "demo fabric switch cluster profile" - type = "instance" + nr_type = "instance" organization { object_type = "organization.Organization" moid = var.organization } } -``` \ No newline at end of file +``` diff --git a/examples/fabric/fabric_switch_profile.md b/examples/fabric/fabric_switch_profile.md index 590f738dff..71e3cd2011 100644 --- a/examples/fabric/fabric_switch_profile.md +++ b/examples/fabric/fabric_switch_profile.md @@ -4,11 +4,11 @@ resource "intersight_fabric_switch_profile" "fabric_switch_profile1" { name = "fabric_switch_profile1" description = "demo fabric switch profile" - type = "instance" + nr_type = "instance" action = "No-op" switch_cluster_profile { moid = intersight_fabric_switch_cluster_profile.fabric_switch_cluster_profile1.moid object_type = "fabric.SwitchClusterProfile" } } -``` \ No newline at end of file +``` diff --git a/examples/iam/iam_idp.md b/examples/iam/iam_idp.md index 3463947631..ef1fe4cc80 100644 --- a/examples/iam/iam_idp.md +++ b/examples/iam/iam_idp.md @@ -17,7 +17,7 @@ resource "intersight_iam_idp" "idp1" { moid = var.iam_system object_type = "iam.System" } - type = "saml" + nr_type = "saml" } @@ -30,4 +30,4 @@ resource "intersight_iam_idp" "idp1" { type = string description = "value for iam account" } -``` \ No newline at end of file +``` diff --git a/examples/iam/iam_qualifier.md b/examples/iam/iam_qualifier.md index aaaed6db0f..258e4a65f6 100644 --- a/examples/iam/iam_qualifier.md +++ b/examples/iam/iam_qualifier.md @@ -13,7 +13,7 @@ resource "intersight_iam_qualifier" "iam_qualifier1" { object_type = "iam.Account" moid = var.iam_account } - type = "saml" + nr_type = "saml" } permissions = [ { @@ -33,4 +33,4 @@ variable "iam_account" { type = string description = "value for iam_account" } -``` \ No newline at end of file +``` diff --git a/examples/kubernetes/kubernetes_aci_cni_profile.md b/examples/kubernetes/kubernetes_aci_cni_profile.md index 8885b34e3f..c53b67396c 100644 --- a/examples/kubernetes/kubernetes_aci_cni_profile.md +++ b/examples/kubernetes/kubernetes_aci_cni_profile.md @@ -4,7 +4,7 @@ resource "intersight_kubernetes_aci_cni_profile" "kubernetes_aci_cni_profile1" { description = "kubernetes aci cni profile" name = "kubernetes_aci_cni_profile1" - type = "instance" + nr_type = "instance" node_svc_subnet_start = "10.0.0.0/8" pod_subnet_start = "10.0.0.0/8" organization { @@ -21,4 +21,4 @@ variable "asset_device_registration_acni_cni" { type = string description = "Moid of asset.DeviceRegistrations Mo" } -``` \ No newline at end of file +``` diff --git a/examples/kubernetes/kubernetes_cluster_profile.md b/examples/kubernetes/kubernetes_cluster_profile.md index 156f88ea2a..6c731e7b92 100644 --- a/examples/kubernetes/kubernetes_cluster_profile.md +++ b/examples/kubernetes/kubernetes_cluster_profile.md @@ -4,7 +4,7 @@ resource "intersight_kubernetes_cluster_profile" "kubernetes_cluster_profile1" { description = "kubernetes cluster profile" name = "kubernetes_cluster_profile1" - type = "instance" + nr_type = "instance" action = "Deploy" config_context { control_action = "Deploy" @@ -27,4 +27,4 @@ variable "workflow_workflow_info" { type = string description = "Moid of the workflow.WorkflowInfo " } -``` \ No newline at end of file +``` diff --git a/examples/kubernetes/kubernetes_node_group_profile.md b/examples/kubernetes/kubernetes_node_group_profile.md index 252554bcf0..82cd56824d 100644 --- a/examples/kubernetes/kubernetes_node_group_profile.md +++ b/examples/kubernetes/kubernetes_node_group_profile.md @@ -4,7 +4,7 @@ resource "intersight_kubernetes_node_group_profile" "kubernetes_node_group_profile1" { description = "kubernetes node group profile" name = "kubernetes_node_group_profile1" - type = "instance" + nr_type = "instance" action = "Deploy" config_context { control_action = "Deploy" @@ -22,4 +22,4 @@ variable "kubernetes_cluster_profile" { type = string description = "Moid of kubernetes.ClusterProfile" } -``` \ No newline at end of file +``` diff --git a/examples/kubernetes/kubernetes_virtual_machine_node_profile.md b/examples/kubernetes/kubernetes_virtual_machine_node_profile.md index 1a077138be..a1c3de5c5a 100644 --- a/examples/kubernetes/kubernetes_virtual_machine_node_profile.md +++ b/examples/kubernetes/kubernetes_virtual_machine_node_profile.md @@ -4,7 +4,7 @@ resource "intersight_kubernetes_virtual_machine_node_profile" "kubernetes_virtual_machine_node_profile1" { description = "kubernetes virtual machine node profile" name = "kubernetes_virtual_machine_node_profile1" - type = "instance" + nr_type = "instance" action = "Deploy" config_context { control_action = "Deploy" @@ -13,4 +13,4 @@ resource "intersight_kubernetes_virtual_machine_node_profile" "kubernetes_virtua } cloud_provider = "noProvider" } -``` \ No newline at end of file +``` diff --git a/examples/recovery/recovery_backup_profile.md b/examples/recovery/recovery_backup_profile.md index f0ca1115f7..3b3e58381d 100644 --- a/examples/recovery/recovery_backup_profile.md +++ b/examples/recovery/recovery_backup_profile.md @@ -4,7 +4,7 @@ resource "intersight_recovery_backup_profile" "recovery_backup_profile1" { name = "recovery_backup_profile1" description = "recovery_backup_profile" - type = "instance" + nr_type = "instance" config_context { object_type = "policy.ConfigContext" control_action = "deploy" @@ -38,4 +38,4 @@ resource "intersight_recovery_backup_profile" "recovery_backup_profile1" { type = string description = "value for recovery schedule config policy" } -``` \ No newline at end of file +``` diff --git a/examples/sample_modules/server_configurations/sdcard.tf b/examples/sample_modules/server_configurations/sdcard.tf index 5faa6d0445..bb2f0d28b7 100644 --- a/examples/sample_modules/server_configurations/sdcard.tf +++ b/examples/sample_modules/server_configurations/sdcard.tf @@ -6,7 +6,7 @@ resource "intersight_sdcard_policy" "tf_sdcard" { object_type = "organization.Organization" } partitions { - type = "OS" + nr_type = "OS" object_type = "sdcard.Partition" virtual_drives { @@ -17,4 +17,4 @@ resource "intersight_sdcard_policy" "tf_sdcard" { }) } } -} \ No newline at end of file +} diff --git a/examples/sample_modules/server_configurations/snmp.tf b/examples/sample_modules/server_configurations/snmp.tf index e6400da6b9..d336aec66b 100644 --- a/examples/sample_modules/server_configurations/snmp.tf +++ b/examples/sample_modules/server_configurations/snmp.tf @@ -22,7 +22,7 @@ resource "intersight_snmp_policy" "tf_snmp" { destination = "10.10.10.1" enabled = false port = 660 - type = "Trap" + nr_type = "Trap" user = "demouser" nr_version = "V3" object_type = "snmp.Trap" @@ -31,4 +31,4 @@ resource "intersight_snmp_policy" "tf_snmp" { moid = data.intersight_organization_organization.default.results.0.moid object_type = "organization.Organization" } -} \ No newline at end of file +} diff --git a/examples/sdcard/sdcard_policy.md b/examples/sdcard/sdcard_policy.md index 0786594f6f..a742b36405 100644 --- a/examples/sdcard/sdcard_policy.md +++ b/examples/sdcard/sdcard_policy.md @@ -9,7 +9,7 @@ resource "intersight_sdcard_policy" "sdcard1" { moid = var.organization } partitions { - type = "OS" + nr_type = "OS" object_type = "sdcard.Partition" virtual_drives { @@ -26,4 +26,4 @@ resource "intersight_sdcard_policy" "sdcard1" { type = string description = "value for organization" } -``` \ No newline at end of file +``` diff --git a/examples/snmp/snmp_policy.md b/examples/snmp/snmp_policy.md index 8c34be380e..8218b197c2 100644 --- a/examples/snmp/snmp_policy.md +++ b/examples/snmp/snmp_policy.md @@ -25,7 +25,7 @@ resource "intersight_snmp_policy" "snmp1" { destination = "10.10.10.1" enabled = false port = 660 - type = "Trap" + nr_type = "Trap" user = "demouser" nr_version = "V3" object_type = "snmp.Trap" @@ -59,4 +59,4 @@ variable "profile" { type = string description = "Moid of server.Profile" } -``` \ No newline at end of file +``` diff --git a/examples/softwarerepository/softwarerepository_release.md b/examples/softwarerepository/softwarerepository_release.md index 44f616138a..6c819fe899 100644 --- a/examples/softwarerepository/softwarerepository_release.md +++ b/examples/softwarerepository/softwarerepository_release.md @@ -2,7 +2,7 @@ ```hcl resource "intersight_softwarerepository_release" "softwarerepository_release1" { - type = "FabricSwitch" + nr_type = "FabricSwitch" catalog { object_type = "softwarerepository.Catalog" moid = var.softwarerepository_catalog @@ -13,4 +13,4 @@ resource "intersight_softwarerepository_release" "softwarerepository_release1" { type = string description = "value for moid" } -``` \ No newline at end of file +``` diff --git a/examples/tam/tam_advisory_definition.md b/examples/tam/tam_advisory_definition.md index 9d4a5c32f3..f53587ab9b 100644 --- a/examples/tam/tam_advisory_definition.md +++ b/examples/tam/tam_advisory_definition.md @@ -10,15 +10,15 @@ resource "intersight_tam_advisory_definition" "tam_advisory_definition" { actions { operation_type = "create" name = "tam_security_advisories1" - type = "restApi" + nr_type = "restApi" object_type = "tam.SecurityAdvisoryDetails" alert_type = "psirt" } - type = "securityAdvisory" + nr_type = "securityAdvisory" api_data_sources { object_type = "tam.ApiDataSource" name = "api_data_source_1" - type = "intersightApi" + nr_type = "intersightApi" } advisory_details { @@ -37,4 +37,4 @@ variable "organization" { type = string description = "" } -``` \ No newline at end of file +``` diff --git a/examples/tam/tam_security_advisory.md b/examples/tam/tam_security_advisory.md index 82a6bb5d16..e8b090b236 100644 --- a/examples/tam/tam_security_advisory.md +++ b/examples/tam/tam_security_advisory.md @@ -16,7 +16,7 @@ resource "intersight_tam_security_advisory" "tam_security_advisory1" { name = "tam_security_advisories1" object_type = "tam.SecurityAdvisoryDetails" alert_type = "psirt" - type = "restApi" + nr_type = "restApi" } status = "final" @@ -30,4 +30,4 @@ variable "organization" { type = string description = "value for moid" } -``` \ No newline at end of file +``` diff --git a/examples/workflow/workflow_error_response_handler.md b/examples/workflow/workflow_error_response_handler.md index b85adf2fa8..94c7add0e6 100644 --- a/examples/workflow/workflow_error_response_handler.md +++ b/examples/workflow/workflow_error_response_handler.md @@ -11,7 +11,7 @@ resource "intersight_workflow_error_response_handler" "workflow_error_response_h object_type = "content.TextParameter" name = "show-pure" item_type = "string" - type = "string" + nr_type = "string" } types { object_type = "content.ComplexType" @@ -22,7 +22,7 @@ resource "intersight_workflow_error_response_handler" "workflow_error_response_h object_type = "content.TextParameter" name = "show-hitachi" item_type = "string" - type = "string" + nr_type = "string" } } catalog { @@ -36,4 +36,4 @@ variable "workflow_catalog" { type = string description = "moid for workflow catalog" } -``` \ No newline at end of file +``` diff --git a/tests/common/chassis_profile.tf b/tests/common/chassis_profile.tf index a7bc87d355..f602d54674 100644 --- a/tests/common/chassis_profile.tf +++ b/tests/common/chassis_profile.tf @@ -2,7 +2,7 @@ resource "intersight_chassis_profile" "chassis_profile1" { name = "chassis_profile1" description = "chassis profile" - type = "instance" + nr_type = "instance" target_platform = "FIAttached" action = "Validate" config_context { diff --git a/tests/common/fabric_switch_cluster_profile.tf b/tests/common/fabric_switch_cluster_profile.tf index 197179dbff..dc051b9fa4 100644 --- a/tests/common/fabric_switch_cluster_profile.tf +++ b/tests/common/fabric_switch_cluster_profile.tf @@ -2,7 +2,7 @@ resource "intersight_fabric_switch_cluster_profile" "fabric_switch_cluster_profile1" { name = "fabric_switch_cluster_profile" description = "demo fabric switch cluster profile" - type = "instance" + nr_type = "instance" organization { object_type = "organization.Organization" moid = data.intersight_organization_organization.default.results.0.moid diff --git a/tests/common/fabric_switch_profile.tf b/tests/common/fabric_switch_profile.tf index f70ddd0cdc..c1d063f4dd 100644 --- a/tests/common/fabric_switch_profile.tf +++ b/tests/common/fabric_switch_profile.tf @@ -2,7 +2,7 @@ resource "intersight_fabric_switch_profile" "fabric_switch_profile1" { name = "fabric_switch_profile1" description = "demo fabric switch profile" - type = "instance" + nr_type = "instance" action = "No-op" switch_cluster_profile { moid = intersight_fabric_switch_cluster_profile.fabric_switch_cluster_profile1.moid diff --git a/tests/common/kubernetes_aci_cni_profile.tf b/tests/common/kubernetes_aci_cni_profile.tf index 0a2e2245de..3e063ea1bd 100644 --- a/tests/common/kubernetes_aci_cni_profile.tf +++ b/tests/common/kubernetes_aci_cni_profile.tf @@ -2,7 +2,7 @@ resource "intersight_kubernetes_aci_cni_profile" "kubernetes_aci_cni_profile1" { description = "kubernetes aci cni profile" name = "kubernetes_aci_cni_profile1" - type = "instance" + nr_type = "instance" node_svc_subnet_start = "10.0.0.0/8" pod_subnet_start = "10.0.0.0/8" organization { diff --git a/tests/common/sdcard_policy.tf b/tests/common/sdcard_policy.tf index 4b337f235e..6209c0bea4 100644 --- a/tests/common/sdcard_policy.tf +++ b/tests/common/sdcard_policy.tf @@ -7,7 +7,7 @@ resource "intersight_sdcard_policy" "sdcard1" { moid = data.intersight_organization_organization.default.results.0.moid } partitions { - type = "OS" + nr_type = "OS" object_type = "sdcard.Partition" virtual_drives { diff --git a/tests/server_configurations/sdcard.tf b/tests/server_configurations/sdcard.tf index aea9099c01..96b2f18703 100644 --- a/tests/server_configurations/sdcard.tf +++ b/tests/server_configurations/sdcard.tf @@ -5,7 +5,7 @@ resource "intersight_sdcard_policy" "tf_sdcard" { moid = data.intersight_organization_organization.default.results.0.moid } partitions { - type = "OS" + nr_type = "OS" object_type = "sdcard.Partition" virtual_drives { @@ -16,4 +16,4 @@ resource "intersight_sdcard_policy" "tf_sdcard" { }) } } -} \ No newline at end of file +} diff --git a/tests/server_configurations/snmp.tf b/tests/server_configurations/snmp.tf index 8fe6214d14..5f6b3c8c02 100644 --- a/tests/server_configurations/snmp.tf +++ b/tests/server_configurations/snmp.tf @@ -21,11 +21,11 @@ resource "intersight_snmp_policy" "tf_snmp" { destination = "10.10.10.1" enabled = false port = 660 - type = "Trap" + nr_type = "Trap" user = "demouser" nr_version = "V3" } organization { moid = data.intersight_organization_organization.default.results.0.moid } -} \ No newline at end of file +} diff --git a/tests/server_configurations/storage_drive_group.tf b/tests/server_configurations/storage_drive_group.tf index 3124007391..6706d03a76 100644 --- a/tests/server_configurations/storage_drive_group.tf +++ b/tests/server_configurations/storage_drive_group.tf @@ -1,5 +1,5 @@ resource "intersight_storage_drive_group" "tf_drive_gp" { - type = 0 + nr_type = 0 name = "tf_drive_gp" raid_level = "Raid0" manual_drive_group { @@ -36,4 +36,4 @@ resource "intersight_storage_drive_group" "tf_drive_gp" { storage_policy { moid = intersight_storage_storage_policy.tf_storage_policy.moid } -} \ No newline at end of file +} From 3f803cb7f3a1d5cf528029994d25be58671b0693 Mon Sep 17 00:00:00 2001 From: Meghana R Date: Fri, 19 Aug 2022 10:47:56 +0530 Subject: [PATCH 3/7] Added odata testcases to resource list --- tests/negative_cases/resource_list.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/negative_cases/resource_list.txt b/tests/negative_cases/resource_list.txt index e595036f3c..71b2aced7f 100644 --- a/tests/negative_cases/resource_list.txt +++ b/tests/negative_cases/resource_list.txt @@ -15,3 +15,10 @@ intersight_iam_end_point_user_role.match_pattern_max_range intersight_iam_end_point_user_role.match_pattern_min_range intersight_softwarerepository_release.min_items intersight_ntp_policy.max_items +intersight_search_search_item.odata_skip_negative_value +intersight_compute_rack_unit.odata_skip_negative_top_positive_value +intersight_smtp_policy.odata_skip_negative_top_positive_zero_result_mo +intersight_access_policy.odata_skip_negative_top_positive_zero_result_mo +intersight_smtp_policy.odata_top_skip_zero_results +intersight_hyperflex_software_distribution_version.odata_at1 +intersight_hyperflex_hxdp_version.odata_at2 From ede56724f5bb77d54901a1962e9634be3cfc9842 Mon Sep 17 00:00:00 2001 From: Meghana R Date: Fri, 19 Aug 2022 11:32:29 +0530 Subject: [PATCH 4/7] Adding separate dir for negative odata --- tests/negative_cases/resource_list.txt | 7 ------- tests/negative_odata/main.tf | 18 ++++++++++++++++++ .../odata_negatives.tf | 0 tests/negative_odata/terraform.tfvars.example | 3 +++ tests/negative_odata/variables.tf | 15 +++++++++++++++ 5 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 tests/negative_odata/main.tf rename tests/{negative_cases => negative_odata}/odata_negatives.tf (100%) create mode 100644 tests/negative_odata/terraform.tfvars.example create mode 100644 tests/negative_odata/variables.tf diff --git a/tests/negative_cases/resource_list.txt b/tests/negative_cases/resource_list.txt index 71b2aced7f..e595036f3c 100644 --- a/tests/negative_cases/resource_list.txt +++ b/tests/negative_cases/resource_list.txt @@ -15,10 +15,3 @@ intersight_iam_end_point_user_role.match_pattern_max_range intersight_iam_end_point_user_role.match_pattern_min_range intersight_softwarerepository_release.min_items intersight_ntp_policy.max_items -intersight_search_search_item.odata_skip_negative_value -intersight_compute_rack_unit.odata_skip_negative_top_positive_value -intersight_smtp_policy.odata_skip_negative_top_positive_zero_result_mo -intersight_access_policy.odata_skip_negative_top_positive_zero_result_mo -intersight_smtp_policy.odata_top_skip_zero_results -intersight_hyperflex_software_distribution_version.odata_at1 -intersight_hyperflex_hxdp_version.odata_at2 diff --git a/tests/negative_odata/main.tf b/tests/negative_odata/main.tf new file mode 100644 index 0000000000..bdebcf4225 --- /dev/null +++ b/tests/negative_odata/main.tf @@ -0,0 +1,18 @@ +terraform { + required_providers { + intersight = { + source = "CiscoDevNet/intersight" + version = "1.0.31" + } + } +} + +provider "intersight" { + apikey = var.api_key + secretkey = var.secretkey + endpoint = var.endpoint +} + +data "intersight_organization_organization" "default" { + name = "default" +} diff --git a/tests/negative_cases/odata_negatives.tf b/tests/negative_odata/odata_negatives.tf similarity index 100% rename from tests/negative_cases/odata_negatives.tf rename to tests/negative_odata/odata_negatives.tf diff --git a/tests/negative_odata/terraform.tfvars.example b/tests/negative_odata/terraform.tfvars.example new file mode 100644 index 0000000000..cb73e6b06e --- /dev/null +++ b/tests/negative_odata/terraform.tfvars.example @@ -0,0 +1,3 @@ +api_key = "changeMe" +secret_key = "changeMe" +endpoint = "changeMe" \ No newline at end of file diff --git a/tests/negative_odata/variables.tf b/tests/negative_odata/variables.tf new file mode 100644 index 0000000000..54e9ba39e7 --- /dev/null +++ b/tests/negative_odata/variables.tf @@ -0,0 +1,15 @@ +variable "api_key" { + type = string + description = "API Key Id from Intersight" +} + +variable "secretkey" { + type = string + description = "Secret Key File Path or String" +} + +variable "endpoint" { + type = string + description = "Endpoint URL" +} + From 9121e50bfaf8756847dd9b9bc882019044117264 Mon Sep 17 00:00:00 2001 From: Meghana R Date: Fri, 19 Aug 2022 14:32:27 +0530 Subject: [PATCH 5/7] Removing zero results testcases as they might not always be true --- tests/negative_odata/odata_negatives.tf | 33 ------------------------- 1 file changed, 33 deletions(-) diff --git a/tests/negative_odata/odata_negatives.tf b/tests/negative_odata/odata_negatives.tf index 572a09b330..a62512cd6f 100644 --- a/tests/negative_odata/odata_negatives.tf +++ b/tests/negative_odata/odata_negatives.tf @@ -18,36 +18,3 @@ data "intersight_compute_rack_unit" "odata_skip_negative_top_positive_value"{ } } -data "intersight_smtp_policy" "odata_skip_negative_top_positive_zero_result_mo"{ - odata { - skip = -600 - top = 10 - } -} - -data "intersight_access_policy" "odata_skip_negative_top_positive_zero_result_mo"{ - odata { - skip = -950 - } -} - -data "intersight_smtp_policy" "odata_top_skip_zero_results"{ - odata { - top = 10 - skip = 23 - } -} - -data "intersight_hyperflex_software_distribution_version" "odata_at1"{ - odata { - at = "Version eq '1.3(1b)'" - } -} - -data "intersight_hyperflex_hxdp_version" "odata_at2"{ - odata { - at = "Version eq '4.0(2e)'" - } -} - - From 47c0e6dfb7738957bd29a49acdf16467af6a3db9 Mon Sep 17 00:00:00 2001 From: jingiris05 <167278817+jingiris05@users.noreply.github.com> Date: Fri, 8 Nov 2024 08:32:52 +0530 Subject: [PATCH 6/7] Update odata_test.tf --- tests/common/odata_test.tf | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tests/common/odata_test.tf b/tests/common/odata_test.tf index 10cb32e11a..3f01b156f8 100644 --- a/tests/common/odata_test.tf +++ b/tests/common/odata_test.tf @@ -162,12 +162,6 @@ data "intersight_iam_role" "odata_count_orderby"{ } } -data "intersight_hyperflex_software_distribution_component" "odata_orderby_descending"{ - odata { - orderby = "CreateTime desc" - } -} - data "intersight_adapter_ext_eth_interface" "odata_orderby_ascending_select"{ odata { orderby = "CreateTime" @@ -191,7 +185,7 @@ data "intersight_appliance_app_status" "odata_orderby_top_skip"{ data "intersight_compute_rack_unit" "odata_filter_equal"{ odata { - filter = "Name eq 'C125-WZP22360YWC'" + filter = "Name eq ' C220-WZP22440YVX'" } } @@ -279,12 +273,6 @@ data "intersight_appliance_app_status" "odata_top_filter_empty_array"{ } } -data "intersight_workflow_workflow_info" "odata_top_filter_not_empty_array"{ - odata { - filter = "Message/any()" - } -} - data "intersight_compute_rack_unit" "odata_top_skip_select"{ odata { top = 20 From be0af9f07d53aa27dbfbe450e0100bad5be70005 Mon Sep 17 00:00:00 2001 From: jingiris05 <167278817+jingiris05@users.noreply.github.com> Date: Mon, 11 Nov 2024 19:10:44 +0530 Subject: [PATCH 7/7] Update main.tf Version upgrade for negative odata test cases --- tests/negative_odata/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/negative_odata/main.tf b/tests/negative_odata/main.tf index bdebcf4225..3ee2ee0327 100644 --- a/tests/negative_odata/main.tf +++ b/tests/negative_odata/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { intersight = { source = "CiscoDevNet/intersight" - version = "1.0.31" + version = "1.0.58" } } }