From ec20de4e9449c4a50c7afcc9312242d6285b0396 Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Wed, 21 Dec 2022 14:02:52 -0800 Subject: [PATCH] Simplify tests --- .../samples/fixed.os_policy_assignment.json | 57 ------------------- .../samples/fixed_os_policy_assignment.yaml | 34 ----------- .../samples/percent.os_policy_assignment.json | 4 +- .../samples/percent_os_policy_assignment.yaml | 3 - .../update_fixed.os_policy_assignment.json | 52 ----------------- .../update_percent.os_policy_assignment.json | 46 --------------- 6 files changed, 2 insertions(+), 194 deletions(-) delete mode 100755 tpgtools/api/osconfig/samples/fixed.os_policy_assignment.json delete mode 100755 tpgtools/api/osconfig/samples/fixed_os_policy_assignment.yaml delete mode 100755 tpgtools/api/osconfig/samples/update_fixed.os_policy_assignment.json delete mode 100755 tpgtools/api/osconfig/samples/update_percent.os_policy_assignment.json diff --git a/tpgtools/api/osconfig/samples/fixed.os_policy_assignment.json b/tpgtools/api/osconfig/samples/fixed.os_policy_assignment.json deleted file mode 100755 index 86ae2c05a6e6..000000000000 --- a/tpgtools/api/osconfig/samples/fixed.os_policy_assignment.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "{{assignment}}", - "project": "{{project}}", - "location": "us-central1-f", - "description": "A test os policy assignment", - "osPolicies": [ - { - "id": "policy", - "description": "A test os policy", - "mode": "VALIDATION", - "resourceGroups": [ - { - "inventoryFilters": [ - { - "osShortName": "centos", - "osVersion": "8.*" - } - ], - "resources": [ - { - "id": "apt", - "pkg": { - "desiredState": "INSTALLED", - "apt": { - "name": "bazel" - } - } - } - ] - } - ], - "allowNoResourceGroupMatch": true - } - ], - "instanceFilter": { - "all": true, - "inclusionLabels": [ - { - "labels": { - "label-one": "value-one" - } - } - ], - "inventories": [ - { - "osShortName": "centos", - "osVersion": "8.*" - } - ] - }, - "rollout": { - "disruptionBudget": { - "fixed": 100 - }, - "minWaitDuration": "3.5s" - } -} diff --git a/tpgtools/api/osconfig/samples/fixed_os_policy_assignment.yaml b/tpgtools/api/osconfig/samples/fixed_os_policy_assignment.yaml deleted file mode 100755 index 621e5c03cac5..000000000000 --- a/tpgtools/api/osconfig/samples/fixed_os_policy_assignment.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2021 Google LLC. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -name: fixed_os_policy_assignment -description: An example of an osconfig os policy assignment with fixed rollout disruption - budget -type: os_policy_assignment -versions: -- ga -- beta -- alpha -resource: samples/fixed.os_policy_assignment.json -updates: -- resource: samples/update_fixed.os_policy_assignment.json - dependencies: [] -- resource: samples/percent.os_policy_assignment.json - dependencies: [] -variables: -- name: assignment - type: resource_name -- name: project - type: project -- name: zone - type: zone diff --git a/tpgtools/api/osconfig/samples/percent.os_policy_assignment.json b/tpgtools/api/osconfig/samples/percent.os_policy_assignment.json index 583efe8a58e2..02fa677f6e05 100755 --- a/tpgtools/api/osconfig/samples/percent.os_policy_assignment.json +++ b/tpgtools/api/osconfig/samples/percent.os_policy_assignment.json @@ -1,7 +1,7 @@ { "name": "{{assignment}}", "project": "{{project}}", - "location": "us-central1-f", + "location": "europe-west1-a", "description": "A test os policy assignment", "osPolicies": [ { @@ -37,6 +37,6 @@ "disruptionBudget": { "percent": 100 }, - "minWaitDuration": "3.5s" + "minWaitDuration": "3s" } } diff --git a/tpgtools/api/osconfig/samples/percent_os_policy_assignment.yaml b/tpgtools/api/osconfig/samples/percent_os_policy_assignment.yaml index 111974d27f9f..1eab84a87230 100755 --- a/tpgtools/api/osconfig/samples/percent_os_policy_assignment.yaml +++ b/tpgtools/api/osconfig/samples/percent_os_policy_assignment.yaml @@ -20,9 +20,6 @@ versions: - beta - alpha resource: samples/percent.os_policy_assignment.json -updates: -- resource: samples/update_percent.os_policy_assignment.json - dependencies: [] variables: - name: assignment type: resource_name diff --git a/tpgtools/api/osconfig/samples/update_fixed.os_policy_assignment.json b/tpgtools/api/osconfig/samples/update_fixed.os_policy_assignment.json deleted file mode 100755 index 409129623a93..000000000000 --- a/tpgtools/api/osconfig/samples/update_fixed.os_policy_assignment.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "{{assignment}}", - "project": "{{project}}", - "location": "us-central1-f", - "description": "An updated test os policy assignment", - "osPolicies": [ - { - "id": "policy", - "description": "An updated test os policy", - "mode": "ENFORCEMENT", - "resourceGroups": [ - { - "inventoryFilters": [ - { - "osShortName": "", - "osVersion": "9.*" - } - ], - "resources": [ - { - "id": "apt", - "pkg": { - "desiredState": "INSTALLED", - "apt": { - "name": "firefox" - } - } - } - ] - } - ], - "allowNoResourceGroupMatch": true - } - ], - "instanceFilter": { - "all": true, - "inclusionLabels": [], - "exclusionLabels": [], - "inventories": [ - { - "osShortName": "", - "osVersion": "9.*" - } - ] - }, - "rollout": { - "disruptionBudget": { - "fixed": 100 - }, - "minWaitDuration": "7.5s" - } -} diff --git a/tpgtools/api/osconfig/samples/update_percent.os_policy_assignment.json b/tpgtools/api/osconfig/samples/update_percent.os_policy_assignment.json deleted file mode 100755 index 61ddbf307e98..000000000000 --- a/tpgtools/api/osconfig/samples/update_percent.os_policy_assignment.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "{{assignment}}", - "project": "{{project}}", - "location": "us-central1-f", - "description": "A test os policy assignment", - "osPolicies": [ - { - "id": "new-policy", - "mode": "VALIDATION", - "resourceGroups": [ - { - "resources": [ - { - "id": "apt-to-yum", - "repository": { - "yum": { - "id": "new-yum", - "displayName": "new-yum", - "baseUrl": "http://mirrors.rcs.alaska.edu/centos/", - "gpgKeys": ["RPM-GPG-KEY-CentOS-Debug-7"] - } - } - } - ] - } - ] - } - ], - "instanceFilter": { - "all": true, - "osShortNames": ["centos"], - "inclusionLabels": [ - { - "labels": { - "label-one": "value-one" - } - } - ] - }, - "rollout": { - "disruptionBudget": { - "percent": 100 - }, - "minWaitDuration": "3.5s" - } -}