From aefe794d013f3359afd9fa999cf3839e38bd53af Mon Sep 17 00:00:00 2001 From: balasubramanian-s Date: Tue, 20 Aug 2024 18:40:17 +0530 Subject: [PATCH] updated docs, testcases,readme Signed-off-by: balasubramanian-s --- README.md | 5 +++-- .../google_dataproc_metastore_service_backup.md | 7 +++---- .../google_dataproc_metastore_service_backups.md | 7 ++++++- .../google_dataproc_metastore_service_backup.rb | 10 +++++----- .../google_dataproc_metastore_service_backups.rb | 16 ++++++++++------ 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index c86ac964..67095f07 100644 --- a/README.md +++ b/README.md @@ -295,6 +295,9 @@ The following resources are available in the InSpec GCP Profile | [google_dataproc_cluster](docs/resources/google_dataproc_cluster.md) | [google_dataproc_clusters](docs/resources/google_dataproc_clusters.md) | | [google_dataproc_job](docs/resources/google_dataproc_job.md) | [google_dataproc_jobs](docs/resources/google_dataproc_jobs.md) | | [google_dataproc_metastore_federation](docs/resources/google_dataproc_metastore_federation.md) | [google_dataproc_metastore_federations](docs/resources/google_dataproc_metastore_federations.md) | +| [google_dataproc_metastore_service_backup](docs/resources/google_dataproc_metastore_service_backup.md) | [google_dataproc_metastore_service_backups](docs/resources/google_dataproc_metastore_service_backups.md) | +| [google_dataproc_metastore_service](docs/resources/google_dataproc_metastore_service.md) | [google_dataproc_metastore_services](docs/resources/google_dataproc_metastore_services.md) | +| [google_dataproc_session](docs/resources/google_dataproc_session.md) | [google_dataproc_sessions](docs/resources/google_dataproc_sessions.md) | | [google_dataproc_workflow_template](docs/resources/google_dataproc_workflow_template.md) | [google_dataproc_workflow_templates](docs/resources/google_dataproc_workflow_templates.md) | | [google_dns_managed_zone](docs/resources/google_dns_managed_zone.md) | [google_dns_managed_zones](docs/resources/google_dns_managed_zones.md) | | [google_dns_resource_record_set](docs/resources/google_dns_resource_record_set.md) | [google_dns_resource_record_sets](docs/resources/google_dns_resource_record_sets.md) | @@ -302,8 +305,6 @@ The following resources are available in the InSpec GCP Profile | [google_dlp_inspect_template](docs/resources/google_dlp_inspect_template.md) | [google_dlp_inspect_templates](docs/resources/google_dlp_inspect_templates.md) | | [google_dlp_job_trigger](docs/resources/google_dlp_job_trigger.md) | [google_dlp_job_triggers](docs/resources/google_dlp_job_triggers.md) | | [google_dlp_job](docs/resources/google_dlp_job.md) | [google_dlp_jobs](docs/resources/google_dlp_jobs.md) | -| [google_dataproc_metastore_service](docs/resources/google_dataproc_metastore_service.md) | [google_dataproc_metastore_services](docs/resources/google_dataproc_metastore_services.md) | -| [google_dataproc_session](docs/resources/google_dataproc_session.md) | [google_dataproc_sessions](docs/resources/google_dataproc_sessions.md) | | [google_dlp_stored_info_type](docs/resources/google_dlp_stored_info_types.md) | [google_dlp_stored_info_types](docs/resources/google_dlp_stored_info_types.md) | | [google_filestore_instance](docs/resources/google_filestore_instance.md) | [google_filestore_instances](docs/resources/google_filestore_instances.md) | | [google_iam_organization_custom_role](docs/resources/google_iam_organization_custom_role.md) | [google_iam_organization_custom_roles](docs/resources/google_iam_organization_custom_roles.md) | diff --git a/docs/resources/google_dataproc_metastore_service_backup.md b/docs/resources/google_dataproc_metastore_service_backup.md index 44cf0c4d..4150e01c 100644 --- a/docs/resources/google_dataproc_metastore_service_backup.md +++ b/docs/resources/google_dataproc_metastore_service_backup.md @@ -23,14 +23,13 @@ A `google_dataproc_metastore_service_backup` is used to test a Google ServiceBac ## Examples ``` -describe google_dataproc_metastore_service_backup(name: ' value_name') do +describe google_dataproc_metastore_service_backup(name: 'value_name') do it { should exist } its('name') { should cmp 'value_name' } its('create_time') { should cmp 'value_createtime' } its('end_time') { should cmp 'value_endtime' } its('state') { should cmp 'value_state' } its('description') { should cmp 'value_description' } - end describe google_dataproc_metastore_service_backup(name: "does_not_exit") do @@ -68,7 +67,7 @@ Properties that can be accessed from the `google_dataproc_metastore_service_back * `config_overrides`: A mapping of Hive metastore configuration key-value pairs to apply to the Hive metastore (configured in hive-site.xml). The mappings override system defaults (some keys cannot be overridden). These overrides are also applied to auxiliary versions and can be further customized in the auxiliary version's AuxiliaryVersionConfig. - * `additional_properties`: + * `additional_properties`: * `kerberos_config`: Configuration information for a Kerberos principal. @@ -98,7 +97,7 @@ Properties that can be accessed from the `google_dataproc_metastore_service_back * `labels`: User-defined labels for the metastore service. - * `additional_properties`: + * `additional_properties`: * `network`: Immutable. The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form:projects/{project_number}/global/networks/{network_id}. diff --git a/docs/resources/google_dataproc_metastore_service_backups.md b/docs/resources/google_dataproc_metastore_service_backups.md index 395023b7..cae65103 100644 --- a/docs/resources/google_dataproc_metastore_service_backups.md +++ b/docs/resources/google_dataproc_metastore_service_backups.md @@ -23,8 +23,13 @@ A `google_dataproc_metastore_service_backups` is used to test a Google ServiceBa ## Examples ``` - describe google_dataproc_metastore_service_backups(parent: ' value_parent') do + describe google_dataproc_metastore_service_backups(parent: ' value_parent') do it { should exist } + its('names') { should include 'value_name' } + its('create_times') { should include 'value_createtime' } + its('end_times') { should include 'value_endtime' } + its('states') { should include 'value_state' } + its('descriptions') { should include 'value_description' } end ``` diff --git a/test/integration/verify/controls/google_dataproc_metastore_service_backup.rb b/test/integration/verify/controls/google_dataproc_metastore_service_backup.rb index e8855733..27cfff33 100644 --- a/test/integration/verify/controls/google_dataproc_metastore_service_backup.rb +++ b/test/integration/verify/controls/google_dataproc_metastore_service_backup.rb @@ -16,11 +16,11 @@ gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') service_backup = input('service_backup', value: { - "name": "value_name", - "parent": "value_parent", - "create_time": "value_createtime", - "end_time": "value_endtime", - "state": "value_state", + "name": "projects/ppradhan/locations/us-central1/services/inspec-test/backups/inspec-backup-fa90", + "parent": "projects/ppradhan/locations/us-central1/services/inspec-test", + "create_time": "2024-08-19T12:06:12.158023685Z", + "end_time": "2024-08-19T12:09:42.670413Z", + "state": "ACTIVE", "description": "value_description" }, description: 'service_backup description') control 'google_dataproc_metastore_service_backup-1.0' do diff --git a/test/integration/verify/controls/google_dataproc_metastore_service_backups.rb b/test/integration/verify/controls/google_dataproc_metastore_service_backups.rb index 9dc2a5a2..8c565639 100644 --- a/test/integration/verify/controls/google_dataproc_metastore_service_backups.rb +++ b/test/integration/verify/controls/google_dataproc_metastore_service_backups.rb @@ -16,18 +16,22 @@ gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') service_backup = input('service_backup', value: { - "name": "value_name", - "parent": "value_parent", - "create_time": "value_createtime", - "end_time": "value_endtime", - "state": "value_state", + "name": "projects/ppradhan/locations/us-central1/services/inspec-test/backups/inspec-backup-fa90", + "parent": "projects/ppradhan/locations/us-central1/services/inspec-test", + "create_time": "2024-08-19T12:06:12.158023685Z", + "end_time": "2024-08-19T12:09:42.670413Z", + "state": "ACTIVE", "description": "value_description" }, description: 'service_backup description') control 'google_dataproc_metastore_service_backups-1.0' do impact 1.0 title 'google_dataproc_metastore_service_backups resource test' - describe google_dataproc_metastore_service_backups(parent: service_backup['parent']) do + describe google_dataproc_metastore_service_backups(parent: service_backup['parent']) do it { should exist } + its('names') { should include service_backup['name'] } + its('create_times') { should include service_backup['create_time'] } + its('end_times') { should include service_backup['end_time'] } + its('states') { should include service_backup['state'] } end end