|
| 1 | +// Copyright (c) HashiCorp, Inc. |
| 2 | +// SPDX-License-Identifier: MPL-2.0 |
| 3 | +// ---------------------------------------------------------------------------- |
| 4 | +// |
| 5 | +// *** AUTO GENERATED CODE *** Type: Handwritten *** |
| 6 | +// |
| 7 | +// ---------------------------------------------------------------------------- |
| 8 | +// |
| 9 | +// This code is generated by Magic Modules using the following: |
| 10 | +// |
| 11 | +// Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/osconfig/resource_os_config_patch_deployment_test.go |
| 12 | +// |
| 13 | +// DO NOT EDIT this file directly. Any changes made to this file will be |
| 14 | +// overwritten during the next generation cycle. |
| 15 | +// |
| 16 | +// ---------------------------------------------------------------------------- |
| 17 | +package osconfig_test |
| 18 | + |
| 19 | +import ( |
| 20 | + "testing" |
| 21 | + |
| 22 | + "github.com/hashicorp/terraform-plugin-testing/helper/resource" |
| 23 | + "github.com/hashicorp/terraform-provider-google/google/acctest" |
| 24 | +) |
| 25 | + |
| 26 | +func TestAccOSConfigPatchDeployment_osConfigPatchDeployment_yum_basic(t *testing.T) { |
| 27 | + t.Parallel() |
| 28 | + |
| 29 | + context := map[string]interface{}{ |
| 30 | + "random_suffix": acctest.RandString(t, 10), |
| 31 | + } |
| 32 | + |
| 33 | + acctest.VcrTest(t, resource.TestCase{ |
| 34 | + PreCheck: func() { acctest.AccTestPreCheck(t) }, |
| 35 | + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), |
| 36 | + CheckDestroy: testAccCheckOSConfigPatchDeploymentDestroyProducer(t), |
| 37 | + Steps: []resource.TestStep{ |
| 38 | + { |
| 39 | + Config: testAccOSConfigPatchDeployment_osConfigPatchDeployment_yum_basic(context), |
| 40 | + Check: resource.ComposeTestCheckFunc( |
| 41 | + resource.TestCheckResourceAttr("google_os_config_patch_deployment.patch", "patch_config.0.yum.0.minimal", "false"), |
| 42 | + ), |
| 43 | + }, |
| 44 | + { |
| 45 | + ResourceName: "google_os_config_patch_deployment.patch", |
| 46 | + ImportState: true, |
| 47 | + ImportStateVerify: true, |
| 48 | + ImportStateVerifyIgnore: []string{"patch_deployment_id"}, |
| 49 | + }, |
| 50 | + }, |
| 51 | + }) |
| 52 | +} |
| 53 | + |
| 54 | +func testAccOSConfigPatchDeployment_osConfigPatchDeployment_yum_basic(context map[string]interface{}) string { |
| 55 | + return acctest.Nprintf(` |
| 56 | +resource "google_os_config_patch_deployment" "patch" { |
| 57 | + patch_deployment_id = "tf-test-patch-deploy%{random_suffix}" |
| 58 | +
|
| 59 | + instance_filter { |
| 60 | + all = true |
| 61 | + } |
| 62 | +
|
| 63 | + patch_config { |
| 64 | + yum { |
| 65 | + minimal = false |
| 66 | + } |
| 67 | + } |
| 68 | +
|
| 69 | + one_time_schedule { |
| 70 | + execute_time = "2999-10-10T10:10:10.045123456Z" |
| 71 | + } |
| 72 | +} |
| 73 | +`, context) |
| 74 | +} |
0 commit comments