From ceccf54bfdfa7ebceb60229c0271173d582b1938 Mon Sep 17 00:00:00 2001 From: Tao He Date: Mon, 4 Nov 2024 11:26:57 +0800 Subject: [PATCH] Compatible with mock server --- .../provider/data_source_redfish_bios_test.go | 2 +- ...urce_redfish_dell_idrac_attributes_test.go | 2 +- ...sh_directory_service_auth_provider_test.go | 2 +- ..._source_redfish_firmware_inventory_test.go | 2 +- .../provider/data_source_redfish_nic_test.go | 16 +++--- ..._source_redfish_storage_controller_test.go | 18 +++---- .../data_source_redfish_storage_test.go | 8 +-- .../data_source_redfish_system_boot_test.go | 4 +- .../data_source_redfish_virtual_media_test.go | 2 +- redfish/provider/provider_test.go | 18 ++++++- redfish/provider/redfish_sweeper_test.go | 2 +- redfish/provider/resource_certificate_test.go | 2 +- .../provider/resource_redfish_bios_test.go | 12 ++--- .../provider/resource_redfish_boot_order.go | 2 +- .../resource_redfish_boot_order_test.go | 10 ++-- ...urce_redfish_boot_sources_override_test.go | 6 +-- .../resource_redfish_dell_idrac_attributes.go | 2 +- ...urce_redfish_dell_idrac_attributes_test.go | 8 +-- ...ll_lifecycle_controller_attributes_test.go | 10 ++-- ...rce_redfish_dell_system_attributes_test.go | 8 +-- ...sh_directory_service_auth_provider_test.go | 54 +++++++++---------- ...urce_redfish_idrac_firmware_update_test.go | 8 +-- .../resource_redfish_manager_reset_test.go | 2 +- redfish/provider/resource_redfish_nic_test.go | 24 ++++----- .../provider/resource_redfish_power_test.go | 4 +- redfish/provider/resource_redfish_scp_test.go | 2 +- .../resource_redfish_simple_update_test.go | 2 +- ...esource_redfish_storage_controller_test.go | 40 +++++++------- .../resource_redfish_storage_volume_test.go | 10 ++-- ...urce_redfish_user_account_password_test.go | 2 +- .../resource_redfish_user_account_test.go | 8 +-- .../resource_redfish_virtual_media_test.go | 10 ++-- 32 files changed, 158 insertions(+), 144 deletions(-) diff --git a/redfish/provider/data_source_redfish_bios_test.go b/redfish/provider/data_source_redfish_bios_test.go index ecb22318..49dc5967 100644 --- a/redfish/provider/data_source_redfish_bios_test.go +++ b/redfish/provider/data_source_redfish_bios_test.go @@ -53,7 +53,7 @@ func testAccRedfishDataSourceBiosConfig(testingInfo TestingServerCredentials) st redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "System.Embedded.1" diff --git a/redfish/provider/data_source_redfish_dell_idrac_attributes_test.go b/redfish/provider/data_source_redfish_dell_idrac_attributes_test.go index 4a188ee7..b4ee9241 100644 --- a/redfish/provider/data_source_redfish_dell_idrac_attributes_test.go +++ b/redfish/provider/data_source_redfish_dell_idrac_attributes_test.go @@ -42,7 +42,7 @@ func testAccRedfishDataSourceiDRACConfig(testingInfo TestingServerCredentials) s redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } } diff --git a/redfish/provider/data_source_redfish_directory_service_auth_provider_test.go b/redfish/provider/data_source_redfish_directory_service_auth_provider_test.go index 4e4ce192..305a6283 100644 --- a/redfish/provider/data_source_redfish_directory_service_auth_provider_test.go +++ b/redfish/provider/data_source_redfish_directory_service_auth_provider_test.go @@ -49,7 +49,7 @@ func testAccRedfishDatasourceDirectoryServiceAuthProviderConfig(testingInfo Test redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } } diff --git a/redfish/provider/data_source_redfish_firmware_inventory_test.go b/redfish/provider/data_source_redfish_firmware_inventory_test.go index ede4dbf4..11249650 100644 --- a/redfish/provider/data_source_redfish_firmware_inventory_test.go +++ b/redfish/provider/data_source_redfish_firmware_inventory_test.go @@ -45,7 +45,7 @@ func testAccRedfishDataSourceFirmwareConfig(testingInfo TestingServerCredentials redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } } diff --git a/redfish/provider/data_source_redfish_nic_test.go b/redfish/provider/data_source_redfish_nic_test.go index 52057dc9..b2155cbc 100644 --- a/redfish/provider/data_source_redfish_nic_test.go +++ b/redfish/provider/data_source_redfish_nic_test.go @@ -87,7 +87,7 @@ func testAccRedfishDataSourceNICConfig(testingInfo TestingServerCredentials) str redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } }`, @@ -103,7 +103,7 @@ func testAccNICDatasourceWithSystemID(testingInfo TestingServerCredentials) stri redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } nic_filter { @@ -126,7 +126,7 @@ func testAccNICDatasourceWithInvalidSystemID(testingInfo TestingServerCredential redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } nic_filter { @@ -149,7 +149,7 @@ func testAccNICDatasourceWithAdapterID(testingInfo TestingServerCredentials) str redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } nic_filter { @@ -177,7 +177,7 @@ func testAccNICDatasourceWithInvalidAdapterID(testingInfo TestingServerCredentia redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } nic_filter { @@ -205,7 +205,7 @@ func testAccNICDatasourceWithConfiguredFilter(testingInfo TestingServerCredentia redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -236,7 +236,7 @@ func testAccNICDatasourceWithInvalidPortID(testingInfo TestingServerCredentials) redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -266,7 +266,7 @@ func testAccNICDatasourceWithTwoAdapterIDs(testingInfo TestingServerCredentials) redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } diff --git a/redfish/provider/data_source_redfish_storage_controller_test.go b/redfish/provider/data_source_redfish_storage_controller_test.go index e28f8a8e..3ec815f8 100644 --- a/redfish/provider/data_source_redfish_storage_controller_test.go +++ b/redfish/provider/data_source_redfish_storage_controller_test.go @@ -100,7 +100,7 @@ func testAccRedfishDataSourceStorageControllerConfig(testingInfo TestingServerCr redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } }`, @@ -116,7 +116,7 @@ func testAccStorageControllerDatasourceWithEmptySystemFilter(testingInfo Testing redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } storage_controller_filter { @@ -135,7 +135,7 @@ func testAccStorageControllerDatasourceWithSystemID(testingInfo TestingServerCre redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } storage_controller_filter { @@ -158,7 +158,7 @@ func testAccStorageControllerDatasourceWithStorageID(testingInfo TestingServerCr redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } storage_controller_filter { @@ -186,7 +186,7 @@ func testAccStorageControllerDatasourceWithControllerID(testingInfo TestingServe redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } storage_controller_filter { @@ -215,7 +215,7 @@ func testAccStorageControllerDatasourceWithMultipleStorageIDs(testingInfo Testin redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } storage_controller_filter { @@ -248,7 +248,7 @@ func testAccStorageControllerDatasourceWithInvalidSystemID(testingInfo TestingSe redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } storage_controller_filter { @@ -277,7 +277,7 @@ func testAccStorageControllerDatasourceWithInvalidStorageID(testingInfo TestingS redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } storage_controller_filter { @@ -306,7 +306,7 @@ func testAccStorageControllerDatasourceWithInvalidControllerID(testingInfo Testi redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } storage_controller_filter { diff --git a/redfish/provider/data_source_redfish_storage_test.go b/redfish/provider/data_source_redfish_storage_test.go index 9a7c95d0..4ee3dfdd 100644 --- a/redfish/provider/data_source_redfish_storage_test.go +++ b/redfish/provider/data_source_redfish_storage_test.go @@ -54,7 +54,7 @@ func testAccRedfishDataSourceStorageConfig(testingInfo TestingServerCredentials) redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } } @@ -71,7 +71,7 @@ func testAccStorageDatasourceWithControllerID(testingInfo TestingServerCredentia redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } controller_ids = ["AHCI.Embedded.2-1"] @@ -89,7 +89,7 @@ func testAccStorageDatasourceWithControllerName(testingInfo TestingServerCredent redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } controller_names = ["PERC H730P Mini"] @@ -107,7 +107,7 @@ func testAccStorageDatasourceWithBothConfig(testingInfo TestingServerCredentials redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "System.Embedded.1" diff --git a/redfish/provider/data_source_redfish_system_boot_test.go b/redfish/provider/data_source_redfish_system_boot_test.go index e40bc49c..b6a4591f 100644 --- a/redfish/provider/data_source_redfish_system_boot_test.go +++ b/redfish/provider/data_source_redfish_system_boot_test.go @@ -60,7 +60,7 @@ func testAccRedfishDatasourceSystemBootConfig(testingInfo TestingServerCredentia redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } } @@ -78,7 +78,7 @@ func testAccRedfishDatasourceSystemBootConfigBasic(testingInfo TestingServerCred redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } } diff --git a/redfish/provider/data_source_redfish_virtual_media_test.go b/redfish/provider/data_source_redfish_virtual_media_test.go index 278635dc..63689ffd 100644 --- a/redfish/provider/data_source_redfish_virtual_media_test.go +++ b/redfish/provider/data_source_redfish_virtual_media_test.go @@ -43,7 +43,7 @@ func testAccRedfishDatasourceVirtualMediaConfig(testingInfo TestingServerCredent redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } } diff --git a/redfish/provider/provider_test.go b/redfish/provider/provider_test.go index 7c6d712b..b73d8e52 100644 --- a/redfish/provider/provider_test.go +++ b/redfish/provider/provider_test.go @@ -70,10 +70,16 @@ func init() { PasswordNIC: os.Getenv("TF_TESTING_PASSWORD_NIC"), Insecure: false, } + if creds.Endpoint2 == "" { + os.Setenv("TF_TESTING_ENDPOINT2", creds.Endpoint) + creds.Endpoint2 = creds.Endpoint + } if creds.EndpointNIC == "" { + os.Setenv("TF_TESTING_ENDPOINT_NIC", creds.Endpoint) creds.EndpointNIC = creds.Endpoint } if creds.PasswordNIC == "" { + os.Setenv("TF_TESTING_PASSWORD_NIC", creds.Password) creds.PasswordNIC = creds.Password } // virtual media environment variable @@ -97,8 +103,16 @@ func testAccPreCheck(t *testing.T) { t.Fatal("TF_TESTING_ENDPOINT must be set for acceptance tests") } - if v := os.Getenv("TF_TESTING_ENDPOINT2"); v == "" { - t.Fatal("TF_TESTING_ENDPOINT2 must be set for acceptance tests") + if v := os.Getenv("TF_TESTING_ENDPOINT"); !strings.HasPrefix(v, "https://") && !strings.HasPrefix(v, "http://") { + t.Fatal("TF_TESTING_ENDPOINT must start with `https://` for acceptance tests or `http://` for unit tests") + } + + if v := os.Getenv("TF_TESTING_ENDPOINT2"); !strings.HasPrefix(v, "https://") && !strings.HasPrefix(v, "http://") { + t.Fatal("TF_TESTING_ENDPOINT2 must start with `https://` for acceptance tests or `http://` for unit tests") + } + + if v := os.Getenv("TF_TESTING_ENDPOINT_NIC"); !strings.HasPrefix(v, "https://") && !strings.HasPrefix(v, "http://") { + t.Fatal("TF_TESTING_ENDPOINT_NIC must start with `https://` for acceptance tests or `http://` for unit tests") } } diff --git a/redfish/provider/redfish_sweeper_test.go b/redfish/provider/redfish_sweeper_test.go index 5225a38a..146acb75 100644 --- a/redfish/provider/redfish_sweeper_test.go +++ b/redfish/provider/redfish_sweeper_test.go @@ -30,7 +30,7 @@ func TestMain(m *testing.M) { } func getSweeperClient(region string) (*gofish.Service, error) { - endpoint := "https://" + creds.Endpoint + endpoint := creds.Endpoint clientConfig := gofish.ClientConfig{ Endpoint: endpoint, Username: creds.Username, diff --git a/redfish/provider/resource_certificate_test.go b/redfish/provider/resource_certificate_test.go index c5884fe3..f9baeb7e 100644 --- a/redfish/provider/resource_certificate_test.go +++ b/redfish/provider/resource_certificate_test.go @@ -64,7 +64,7 @@ func testAccRedfishResourceCustomCertificate(testingInfo TestingServerCredential redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } diff --git a/redfish/provider/resource_redfish_bios_test.go b/redfish/provider/resource_redfish_bios_test.go index 8a0c2f96..96498bb6 100644 --- a/redfish/provider/resource_redfish_bios_test.go +++ b/redfish/provider/resource_redfish_bios_test.go @@ -88,7 +88,7 @@ func TestAccRedfishBios_Import(t *testing.T) { creds), ResourceName: "redfish_bios.bios", ImportState: true, - ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: nil, }, }, @@ -105,7 +105,7 @@ func TestAccRedfishBios_ImportSystemID(t *testing.T) { creds), ResourceName: "redfish_bios.bios", ImportState: true, - ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true,\"system_id\":\"System.Embedded.1\"}", + ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true,\"system_id\":\"System.Embedded.1\"}", ExpectError: nil, }, }, @@ -120,7 +120,7 @@ func testAccRedfishResourceBiosConfigOn(testingInfo TestingServerCredentials) st redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -145,7 +145,7 @@ func testAccRedfishResourceBiosConfigOff(testingInfo TestingServerCredentials) s redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -172,7 +172,7 @@ func testAccRedfishResourceBiosConfigInvalidSettingsApplyTime(testingInfo Testin redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -195,7 +195,7 @@ func testAccRedfishResourceBiosConfigInvalidAttributes(testingInfo TestingServer redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } diff --git a/redfish/provider/resource_redfish_boot_order.go b/redfish/provider/resource_redfish_boot_order.go index 1ecde695..1e5c62a2 100644 --- a/redfish/provider/resource_redfish_boot_order.go +++ b/redfish/provider/resource_redfish_boot_order.go @@ -503,7 +503,7 @@ func (r *BootOrderResource) updateBootOptions(service *gofish.Service, d *models } for _, ele := range serverBootOptions { payload.BootOptionEnabled = ele.BootOptionEnabled.ValueBool() - finalURL := fmt.Sprintf(url + "/" + ele.BootOptionReference.ValueString()) + finalURL := fmt.Sprintf("%s/%s", url, ele.BootOptionReference.ValueString()) resp, err = service.GetClient().Patch(finalURL, payload) if err != nil { diags.AddError("Unable to update boot option data", err.Error()) diff --git a/redfish/provider/resource_redfish_boot_order_test.go b/redfish/provider/resource_redfish_boot_order_test.go index c8aa319f..c0d15c95 100644 --- a/redfish/provider/resource_redfish_boot_order_test.go +++ b/redfish/provider/resource_redfish_boot_order_test.go @@ -37,7 +37,7 @@ func TestAccRedfishBootOrder_basic(t *testing.T) { { ResourceName: "redfish_boot_order.boot", ImportState: true, - ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: nil, // ImportStateVerify: true, // state is not verified since there are multiple boot options and import fetches all while using CRUD you can change specific boot options or none }, @@ -56,13 +56,13 @@ func TestAccRedfishBootOrderOptions_basic(t *testing.T) { { ResourceName: "redfish_boot_order.boot", ImportState: true, - ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: nil, }, { ResourceName: "redfish_boot_order.boot", ImportState: true, - ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true, \"system_id\":\"System.Embedded.1\"}", + ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true, \"system_id\":\"System.Embedded.1\"}", ExpectError: nil, }, { @@ -79,7 +79,7 @@ func testAccRedfishResourceBootOrder(testingInfo TestingServerCredentials, bootO redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "System.Embedded.1" @@ -101,7 +101,7 @@ func testAccRedfishResourceBootOptions(testingInfo TestingServerCredentials, boo redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } reset_timeout=400 diff --git a/redfish/provider/resource_redfish_boot_sources_override_test.go b/redfish/provider/resource_redfish_boot_sources_override_test.go index 3b13a714..56968f85 100644 --- a/redfish/provider/resource_redfish_boot_sources_override_test.go +++ b/redfish/provider/resource_redfish_boot_sources_override_test.go @@ -73,7 +73,7 @@ func testAccRedfishResourceBootSourceLegacyconfig(testingInfo TestingServerCrede redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "System.Embedded.1" @@ -97,7 +97,7 @@ func testAccRedfishResourceBootSourceUEFIconfig(testingInfo TestingServerCredent redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -121,7 +121,7 @@ func testAccRedfishResourceBootSourceResetType(testingInfo TestingServerCredenti redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } diff --git a/redfish/provider/resource_redfish_dell_idrac_attributes.go b/redfish/provider/resource_redfish_dell_idrac_attributes.go index a7984752..576c8cfe 100644 --- a/redfish/provider/resource_redfish_dell_idrac_attributes.go +++ b/redfish/provider/resource_redfish_dell_idrac_attributes.go @@ -479,7 +479,7 @@ func checkManagerAttributes(attrRegistry *dell.ManagerAttributeRegistry, attribu } } if len(errors) > 0 { - return fmt.Errorf(errors) + return fmt.Errorf("%s", errors) } return nil diff --git a/redfish/provider/resource_redfish_dell_idrac_attributes_test.go b/redfish/provider/resource_redfish_dell_idrac_attributes_test.go index ba203a52..eab1afe7 100644 --- a/redfish/provider/resource_redfish_dell_idrac_attributes_test.go +++ b/redfish/provider/resource_redfish_dell_idrac_attributes_test.go @@ -74,7 +74,7 @@ func TestAccRedfishIDRACAttributeImport(t *testing.T) { }`, ResourceName: "redfish_dell_idrac_attributes.idrac", ImportState: true, - ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: nil, }, }, @@ -91,7 +91,7 @@ func TestAccRedfishIDRACAttributeImportByFilter(t *testing.T) { }`, ResourceName: "redfish_dell_idrac_attributes.idrac", ImportState: true, - ImportStateId: "{\"attributes\":[\"Users.2.UserName\"],\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"attributes\":[\"Users.2.UserName\"],\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: nil, }, }, @@ -104,7 +104,7 @@ func testAccRedfishResourceIDracAttributesConfig(testingInfo TestingServerCreden redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -131,7 +131,7 @@ func testAccRedfishResourceIDracAttributesConfigInvalid(testingInfo TestingServe redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } diff --git a/redfish/provider/resource_redfish_dell_lifecycle_controller_attributes_test.go b/redfish/provider/resource_redfish_dell_lifecycle_controller_attributes_test.go index 5a720c9a..78311b79 100644 --- a/redfish/provider/resource_redfish_dell_lifecycle_controller_attributes_test.go +++ b/redfish/provider/resource_redfish_dell_lifecycle_controller_attributes_test.go @@ -42,7 +42,7 @@ func TestAccRedfishLCAttributesBasic(t *testing.T) { }`, ResourceName: "redfish_dell_lc_attributes.lc", ImportState: true, - ImportStateId: "{\"attributes\":[\"LCAttributes.1.CollectSystemInventoryOnRestart\"],\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"attributes\":[\"LCAttributes.1.CollectSystemInventoryOnRestart\"],\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: nil, }, }, @@ -96,7 +96,7 @@ func TestAccRedfishLCAttributeImport(t *testing.T) { }`, ResourceName: "redfish_dell_lc_attributes.lc", ImportState: true, - ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: nil, }, }, @@ -109,7 +109,7 @@ func testAccRedfishResourceLCAttributesConfig(testingInfo TestingServerCredentia redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -131,7 +131,7 @@ func testAccRedfishResourceLCAttributesUpdateConfig(testingInfo TestingServerCre redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -153,7 +153,7 @@ func testAccRedfishResourceLCConfigInvalid(testingInfo TestingServerCredentials) redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } diff --git a/redfish/provider/resource_redfish_dell_system_attributes_test.go b/redfish/provider/resource_redfish_dell_system_attributes_test.go index 58531a78..02d1726e 100644 --- a/redfish/provider/resource_redfish_dell_system_attributes_test.go +++ b/redfish/provider/resource_redfish_dell_system_attributes_test.go @@ -88,7 +88,7 @@ func TestAccRedfishSystemAttributesImport(t *testing.T) { }`, ResourceName: "redfish_dell_system_attributes.system", ImportState: true, - ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: nil, }, }, @@ -101,7 +101,7 @@ func testAccRedfishResourceSystemAttributesConfig(testingInfo TestingServerCrede redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -123,7 +123,7 @@ func testAccRedfishResourceSystemAttributesUpdateConfig(testingInfo TestingServe redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -145,7 +145,7 @@ func testAccRedfishResourceSystemConfigInvalid(testingInfo TestingServerCredenti redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } diff --git a/redfish/provider/resource_redfish_directory_service_auth_provider_test.go b/redfish/provider/resource_redfish_directory_service_auth_provider_test.go index d9c28f93..2b54a8e0 100644 --- a/redfish/provider/resource_redfish_directory_service_auth_provider_test.go +++ b/redfish/provider/resource_redfish_directory_service_auth_provider_test.go @@ -212,7 +212,7 @@ func TestAccRedfishDirectoryServiceAuthProviderImport(t *testing.T) { }`, ResourceName: "redfish_directory_service_auth_provider.ds_auth", ImportState: true, - ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: nil, }, }, @@ -225,7 +225,7 @@ func testAccRedfishDirectoryServiceAuthProviderErrorConfig(testingInfo TestingSe redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -300,7 +300,7 @@ func testAccRedfishDirectoryServiceAuthProviderADConfig(testingInfo TestingServe redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } active_directory = { @@ -335,7 +335,7 @@ func testAccRedfishDirectoryServiceAuthProviderLDAPConfig(testingInfo TestingSer redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } ldap = { @@ -383,7 +383,7 @@ func testAccRedfishDirectoryServiceAuthProviderAD_UpdateConfig(testingInfo Testi redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -421,7 +421,7 @@ func testAccRedfishDirectoryServiceAuthProviderEmptyAuth(testingInfo TestingServ redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -458,7 +458,7 @@ func testAccRedfishDirectoryServiceAuthProviderInvalidAuth(testingInfo TestingSe redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -497,7 +497,7 @@ func testAccRedfishDirectoryServiceAuthProviderADDisableSSOEnable(testingInfo Te redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -536,7 +536,7 @@ func testAccRedfishDirectoryServiceAuthProviderADEnSSOEnNoKb(testingInfo Testing redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -574,7 +574,7 @@ func testAccRedfishDirectoryServiceAuthProviderDClookUpEnServiceAddEmpty(testing redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -608,7 +608,7 @@ func testAccRedfishDirectoryServiceAuthProviderDCLookupByUserDomainConfig(testin redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -649,7 +649,7 @@ func testAccRedfishDirectoryServiceAuthProviderDCLookupDomainNameConfig(testingI redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -691,7 +691,7 @@ func testAccRedfishDirectoryServiceAuthProviderDDCLookupEnableNoServiceAddConfig redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -733,7 +733,7 @@ func testAccRedfishDirectoryServiceAuthProviderDCLookupByUserDomainEmptyConfig(t redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -771,7 +771,7 @@ func testAccRedfishDirectoryServiceAuthProviderDCLookupDomainNameEmptyConfig(tes redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -810,7 +810,7 @@ func testAccRedfishDirectoryServiceAuthProviderDCLookupEnableDCLookupDomainNameC redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -849,7 +849,7 @@ func testAccRedfishDirectoryServiceAuthProviderExtendedNoRacConfig(testingInfo T redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -885,7 +885,7 @@ func testAccRedfishDirectoryServiceAuthProviderExtendedEmptyRacConfig(testingInf redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -923,7 +923,7 @@ func testAccRedfishDirectoryServiceAuthProviderExtendedGCLookUpConfig(testingInf redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -962,7 +962,7 @@ func testAccRedfishDirectoryServiceAuthProviderExtendedRemoteRoleConfig(testingI redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -1007,7 +1007,7 @@ func testAccRedfishDirectoryServiceAuthProviderExtendedADGroupDomainConfig(testi redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -1047,7 +1047,7 @@ func testAccRedfishDirectoryServiceAuthProviderStandardSchemaAndRacConfig(testin redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -1085,7 +1085,7 @@ func testAccRedfishDirectoryServiceAuthProviderStandardSchemaNoGCLookUpConfig(te redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -1121,7 +1121,7 @@ func testAccRedfishDirectoryServiceAuthProviderStandardSchemaNoGCRootConfig(test redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -1158,7 +1158,7 @@ func testAccRedfishDirectoryServiceAuthProviderStandardSchemaGlobalCatalogConfig redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -1197,7 +1197,7 @@ func testAccRedfishDirectoryServiceAuthProviderStandardSchemaNoGlobalCatalogConf redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -1235,7 +1235,7 @@ func testAccRedfishDirectoryServiceAuthProviderStandardSchemaGCRootConfig(testin redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } diff --git a/redfish/provider/resource_redfish_idrac_firmware_update_test.go b/redfish/provider/resource_redfish_idrac_firmware_update_test.go index 2c7e54d2..55466715 100644 --- a/redfish/provider/resource_redfish_idrac_firmware_update_test.go +++ b/redfish/provider/resource_redfish_idrac_firmware_update_test.go @@ -78,7 +78,7 @@ func testAccRedfishIdracFirmwareUpdateCreate(testingInfo TestingServerCredential redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "System.Embedded.1" @@ -104,7 +104,7 @@ func testAccRedfishIdracFirmwareUpdateCreateError(testingInfo TestingServerCrede redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -125,7 +125,7 @@ func testAccRedfishIdracFirmwareUpdateCreateError2(testingInfo TestingServerCred redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } ip_address = "downloads.dell.com" @@ -145,7 +145,7 @@ func testAccRedfishIdracFirmwareUpdateReapply(testingInfo TestingServerCredentia redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } diff --git a/redfish/provider/resource_redfish_manager_reset_test.go b/redfish/provider/resource_redfish_manager_reset_test.go index c70e29be..346fbb02 100644 --- a/redfish/provider/resource_redfish_manager_reset_test.go +++ b/redfish/provider/resource_redfish_manager_reset_test.go @@ -99,7 +99,7 @@ func testAccRedfishResourceManagerResetConfig(testingInfo TestingServerCredentia redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } diff --git a/redfish/provider/resource_redfish_nic_test.go b/redfish/provider/resource_redfish_nic_test.go index cb6d0285..e09a7b2b 100644 --- a/redfish/provider/resource_redfish_nic_test.go +++ b/redfish/provider/resource_redfish_nic_test.go @@ -169,7 +169,7 @@ func TestAccRedfishNICAttributesISCSI(t *testing.T) { } func TestAccRedfishNICAttributesImport(t *testing.T) { - importReqID := fmt.Sprintf("{\"system_id\":\"%s\",\"network_adapter_id\":\"%s\",\"network_device_function_id\":\"%s\",\"username\":\"%s\",\"password\":\"%s\",\"endpoint\":\"https://%s\",\"ssl_insecure\":true}", + importReqID := fmt.Sprintf("{\"system_id\":\"%s\",\"network_adapter_id\":\"%s\",\"network_device_function_id\":\"%s\",\"username\":\"%s\",\"password\":\"%s\",\"endpoint\":\"%s\",\"ssl_insecure\":true}", nicParams.SystemID, nicParams.NetworkAdapterID, nicParams.NetworkDeviceFunctionID, nicParams.Username, nicParams.Password, nicParams.Endpoint) resource.Test(t, resource.TestCase{ @@ -194,7 +194,7 @@ func testAccRedfishResourceNICAttributesConfigNetworkAttrs(testingInfo testingNI redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -230,7 +230,7 @@ func testAccRedfishResourceNICAttributesConfig(testingInfo testingNICInputs) str redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -273,7 +273,7 @@ func testAccRedfishResourceNICAttributesConfigUpdateNetAttrs(testingInfo testing redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -316,7 +316,7 @@ func testAccRedfishResourceFCConfigWithoutMW(testingInfo testingNICInputs) strin redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -352,7 +352,7 @@ func testAccRedfishResourceFCConfigOutDatedMW(testingInfo testingNICInputs) stri redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -392,7 +392,7 @@ func testAccRedfishResourceFCConfigNetworkAttrs(testingInfo testingNICInputs) st redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -428,7 +428,7 @@ func testAccRedfishResourceFCConfigUpdateOutDatedMW(testingInfo testingNICInputs redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -475,7 +475,7 @@ func testAccRedfishResourceFCConfig(testingInfo testingNICInputs) string { redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -518,7 +518,7 @@ func testAccRedfishResourceFCConfigUpdateNetAttrs(testingInfo testingNICInputs) redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -561,7 +561,7 @@ func testAccRedfishResourceNICAttributesIscsiConfig(testingInfo testingNICInputs redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -592,7 +592,7 @@ func testAccRedfishResourceNICAttributesIscsiConfigUpdate(testingInfo testingNIC redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" diff --git a/redfish/provider/resource_redfish_power_test.go b/redfish/provider/resource_redfish_power_test.go index 40d3a5cd..2ff6eab5 100644 --- a/redfish/provider/resource_redfish_power_test.go +++ b/redfish/provider/resource_redfish_power_test.go @@ -113,7 +113,7 @@ func testAccRedfishResourcePowerConfig(testingInfo TestingServerCredentials, redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "System.Embedded.1" @@ -141,7 +141,7 @@ func testAccRedfishResourcePowerConfig1(testingInfo TestingServerCredentials, redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } diff --git a/redfish/provider/resource_redfish_scp_test.go b/redfish/provider/resource_redfish_scp_test.go index 27a39d89..cb598c79 100644 --- a/redfish/provider/resource_redfish_scp_test.go +++ b/redfish/provider/resource_redfish_scp_test.go @@ -35,7 +35,7 @@ var redfishServer = fmt.Sprintf(` redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } `, os.Getenv("TF_TESTING_USERNAME"), os.Getenv("TF_TESTING_PASSWORD"), os.Getenv("TF_TESTING_ENDPOINT")) diff --git a/redfish/provider/resource_redfish_simple_update_test.go b/redfish/provider/resource_redfish_simple_update_test.go index cf778829..6519a21a 100644 --- a/redfish/provider/resource_redfish_simple_update_test.go +++ b/redfish/provider/resource_redfish_simple_update_test.go @@ -105,7 +105,7 @@ func testAccRedfishResourceUpdateConfig(testingInfo TestingServerCredentials, redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "System.Embedded.1" diff --git a/redfish/provider/resource_redfish_storage_controller_test.go b/redfish/provider/resource_redfish_storage_controller_test.go index 1722df7d..00af1162 100644 --- a/redfish/provider/resource_redfish_storage_controller_test.go +++ b/redfish/provider/resource_redfish_storage_controller_test.go @@ -270,7 +270,7 @@ func TestAccRedfishStorageControllerAttributesError(t *testing.T) { func TestAccRedfishStorageControllerAttributesImport(t *testing.T) { storageControllerResourceName := "redfish_storage_controller.test" - importReqID := fmt.Sprintf("{\"system_id\":\"%s\",\"storage_id\":\"%s\",\"controller_id\":\"%s\",\"username\":\"%s\",\"password\":\"%s\",\"endpoint\":\"https://%s\",\"ssl_insecure\":true}", + importReqID := fmt.Sprintf("{\"system_id\":\"%s\",\"storage_id\":\"%s\",\"controller_id\":\"%s\",\"username\":\"%s\",\"password\":\"%s\",\"endpoint\":\"%s\",\"ssl_insecure\":true}", storageControllerParams.SystemID, storageControllerParams.StorageID, storageControllerParams.ControllerID, storageControllerParams.Username, storageControllerParams.Password, storageControllerParams.Endpoint) resource.Test(t, resource.TestCase{ @@ -295,7 +295,7 @@ func testAccRedfishResourceStorageControllerBasicConfig(testingInfo testingStora redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -320,7 +320,7 @@ func testAccRedfishResourceStorageControllerFirstAvailableChoiceSelectedConfig(t redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -366,7 +366,7 @@ func testAccRedfishResourceStorageControllerSecondAvailableChoiceSelectedConfig( redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -412,7 +412,7 @@ func testAccRedfishResourceStorageControllerSecuritySetControllerKeyConfig(testi redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -442,7 +442,7 @@ func testAccRedfishResourceStorageControllerSecurityReKeyConfig(testingInfo test redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -474,7 +474,7 @@ func testAccRedfishResourceStorageControllerSecurityRemoveControllerKeyConfig(te redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -502,7 +502,7 @@ func testAccRedfishResourceStorageControllerDifferentSystemIDConfig(testingInfo redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -527,7 +527,7 @@ func testAccRedfishResourceStorageControllerDifferentStorageIDConfig(testingInfo redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -552,7 +552,7 @@ func testAccRedfishResourceStorageControllerDifferentControllerIDConfig(testingI redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -577,7 +577,7 @@ func testAccRedfishResourceStorageControllerControllerModeAndOtherAttributeUpdat redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -626,7 +626,7 @@ func testAccRedfishResourceStorageControllerControllerModeAndSecurityUpdateConfi redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -667,7 +667,7 @@ func testAccRedfishResourceStorageControllerControllerModeAndEnhancedAutoImportF redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -704,7 +704,7 @@ func testAccRedfishResourceStorageControllerControllerModeWithoutOnResetApplyTim redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -738,7 +738,7 @@ func testAccRedfishResourceStorageControllerSecurityAndOtherAttributeUpdateConfi redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -788,7 +788,7 @@ func testAccRedfishResourceStorageControllerSecurityWithMaintenanceTypeApplyTime redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -822,7 +822,7 @@ func testAccRedfishResourceStorageControllerSecurityWithoutActionConfig(testingI redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -851,7 +851,7 @@ func testAccRedfishResourceStorageControllerSecuritySetControllerKeyIncorrectCon redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -880,7 +880,7 @@ func testAccRedfishResourceStorageControllerSecurityReKeyIncorrectConfig(testing redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" @@ -911,7 +911,7 @@ func testAccRedfishResourceStorageControllerSecurityRemoveControllerKeyIncorrect redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "%s" diff --git a/redfish/provider/resource_redfish_storage_volume_test.go b/redfish/provider/resource_redfish_storage_volume_test.go index 6f7f96bc..9929ca71 100644 --- a/redfish/provider/resource_redfish_storage_volume_test.go +++ b/redfish/provider/resource_redfish_storage_volume_test.go @@ -33,7 +33,7 @@ func getVolumeImportConf(d *terraform.State, creds TestingServerCredentials) (st if err != nil { return id, err } - return fmt.Sprintf("{\"id\":\"%s\",\"username\":\"%s\",\"password\":\"%s\",\"endpoint\":\"https://%s\",\"ssl_insecure\":true}", + return fmt.Sprintf("{\"id\":\"%s\",\"username\":\"%s\",\"password\":\"%s\",\"endpoint\":\"%s\",\"ssl_insecure\":true}", id, creds.Username, creds.Password, creds.Endpoint), nil } @@ -207,7 +207,7 @@ func TestAccRedfishStorageVolumeCreate_basic(t *testing.T) { { ResourceName: "redfish_storage_volume.volume", ImportState: true, - ImportStateId: "{\"id\":\"invalid\",\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"id\":\"invalid\",\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: regexp.MustCompile("There was an error with the API"), }, }, @@ -335,7 +335,7 @@ func testAccRedfishResourceStorageVolumeConfig(testingInfo TestingServerCredenti redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -389,7 +389,7 @@ func testAccRedfishResourceStorageVolumeEncryptedConfig(testingInfo TestingServe redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -434,7 +434,7 @@ func testAccRedfishResourceStorageVolumeMinConfig(testingInfo TestingServerCrede redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } system_id = "System.Embedded.1" diff --git a/redfish/provider/resource_redfish_user_account_password_test.go b/redfish/provider/resource_redfish_user_account_password_test.go index 540c72be..1dc6796e 100644 --- a/redfish/provider/resource_redfish_user_account_password_test.go +++ b/redfish/provider/resource_redfish_user_account_password_test.go @@ -75,7 +75,7 @@ func testAccRedfishResourceUserPasswordConfig( resource "redfish_user_account_password" "user" { username = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true old_password = "%s" new_password = "%s" diff --git a/redfish/provider/resource_redfish_user_account_test.go b/redfish/provider/resource_redfish_user_account_test.go index 7ee934a9..cdfa637d 100644 --- a/redfish/provider/resource_redfish_user_account_test.go +++ b/redfish/provider/resource_redfish_user_account_test.go @@ -266,7 +266,7 @@ func TestAccRedfishUserImportUser_basic(t *testing.T) { userID), ResourceName: "redfish_user_account.user_config", ImportState: true, - ImportStateId: "{\"id\":\"3\",\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"id\":\"3\",\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: nil, }, }, @@ -289,7 +289,7 @@ func TestAccRedfishUserImportUser_invalid(t *testing.T) { userID), ResourceName: "redfish_user_account.user_config", ImportState: true, - ImportStateId: "{\"id\":\"invalid\",\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"https://" + creds.Endpoint + "\",\"ssl_insecure\":true}", + ImportStateId: "{\"id\":\"invalid\",\"username\":\"" + creds.Username + "\",\"password\":\"" + creds.Password + "\",\"endpoint\":\"" + creds.Endpoint + "\",\"ssl_insecure\":true}", ExpectError: regexp.MustCompile("Error when retrieving accounts"), }, }, @@ -425,7 +425,7 @@ func testAccRedfishResourceUserConfig(testingInfo TestingServerCredentials, redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } @@ -454,7 +454,7 @@ func testAccRedfishProviderWithServersConfig(serverAlias, username, password, en "%s" = { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true }, } diff --git a/redfish/provider/resource_redfish_virtual_media_test.go b/redfish/provider/resource_redfish_virtual_media_test.go index 8c04cc61..099c96ba 100644 --- a/redfish/provider/resource_redfish_virtual_media_test.go +++ b/redfish/provider/resource_redfish_virtual_media_test.go @@ -34,7 +34,7 @@ func getVMedImportConf(d *terraform.State, creds TestingServerCredentials) (stri if err != nil { return id, err } - return fmt.Sprintf("{\"id\":\"%s\",\"username\":\"%s\",\"password\":\"%s\",\"endpoint\":\"https://%s\",\"ssl_insecure\":true}", + return fmt.Sprintf("{\"id\":\"%s\",\"username\":\"%s\",\"password\":\"%s\",\"endpoint\":\"%s\",\"ssl_insecure\":true}", id, creds.Username, creds.Password, creds.Endpoint), nil } @@ -71,7 +71,7 @@ func TestAccRedfishVirtualMedia_basic(t *testing.T) { { ResourceName: testAccVMedResName, ImportState: true, - ImportStateId: fmt.Sprintf("{\"id\":\"invalid\",\"username\":\"%s\",\"password\":\"%s\",\"endpoint\":\"https://%s\",\"ssl_insecure\":true}", + ImportStateId: fmt.Sprintf("{\"id\":\"invalid\",\"username\":\"%s\",\"password\":\"%s\",\"endpoint\":\"%s\",\"ssl_insecure\":true}", creds.Username, creds.Password, creds.Endpoint), ExpectError: regexp.MustCompile("Virtual Media with ID invalid doesn't exist"), }, @@ -384,7 +384,7 @@ func testAccRedfishResourceVirtualMediaConfig(testingInfo TestingServerCredentia redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } image = "%s" @@ -418,7 +418,7 @@ func testAccRedfishResourceVirtualMediaConfigServer5x(testingInfo TestingServerC redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } image = "%s" @@ -452,7 +452,7 @@ func testAccRedfishResourceVirtualMediaConfigDependency(testingInfo TestingServe redfish_server { user = "%s" password = "%s" - endpoint = "https://%s" + endpoint = "%s" ssl_insecure = true } image = "%s"