Skip to content

Commit 6464d50

Browse files
alexng-canuckrcohenma
authored andcommitted
Fix image datasource test to avoid checking for specific launch options
Depending on the tenancy/region; the order of images returned by this may be inconsistent. If checking against the first result, then the launch options may vary across tenancy/regions. Avoid checking for specific launch options values and only check for values that are guaranteed by the datasource query.
1 parent fb44def commit 6464d50

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

provider/core_images_data_source_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ func (s *DatasourceCoreImageTestSuite) TestAccImage_basic() {
6262
resource.TestCheckResourceAttr(s.ResourceName, "images.0.create_image_allowed", "true"),
6363
TestCheckResourceAttributesEqual(s.ResourceName, "images.0.display_name", "data.oci_core_images.allOracleImages", "images.0.display_name"),
6464
resource.TestCheckResourceAttr(s.ResourceName, "images.0.state", string(core.ImageLifecycleStateAvailable)),
65-
resource.TestCheckResourceAttr(s.ResourceName, "images.0.launch_mode", "NATIVE"),
65+
resource.TestCheckResourceAttrSet(s.ResourceName, "images.0.launch_mode"),
6666
resource.TestCheckResourceAttr(s.ResourceName, "images.0.launch_options.#", "1"),
67-
resource.TestCheckResourceAttr(s.ResourceName, "images.0.launch_options.0.boot_volume_type", "ISCSI"),
68-
resource.TestCheckResourceAttr(s.ResourceName, "images.0.launch_options.0.firmware", "UEFI_64"),
69-
resource.TestCheckResourceAttr(s.ResourceName, "images.0.launch_options.0.network_type", "VFIO"),
70-
resource.TestCheckResourceAttr(s.ResourceName, "images.0.launch_options.0.remote_data_volume_type", "PARAVIRTUALIZED"),
67+
resource.TestCheckResourceAttrSet(s.ResourceName, "images.0.launch_options.0.boot_volume_type"),
68+
resource.TestCheckResourceAttrSet(s.ResourceName, "images.0.launch_options.0.firmware"),
69+
resource.TestCheckResourceAttrSet(s.ResourceName, "images.0.launch_options.0.network_type"),
70+
resource.TestCheckResourceAttrSet(s.ResourceName, "images.0.launch_options.0.remote_data_volume_type"),
7171
resource.TestCheckResourceAttr(s.ResourceName, "images.0.operating_system", s.OperatingSystem),
7272
TestCheckResourceAttributesEqual(s.ResourceName, "images.0.operating_system_version", "data.oci_core_images.allOracleImages", "images.0.operating_system_version"),
7373
resource.TestCheckResourceAttrSet(s.ResourceName, "images.0.time_created"),

0 commit comments

Comments
 (0)