Skip to content

Commit 4799c68

Browse files
akinrosslhercot
authored andcommitted
[ignore] fix test for aci_management_access_policy to only be executed on supported versions
1 parent 2831330 commit 4799c68

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

gen/definitions/classes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ commPol:
10101010
sub_category: "Fabric Policies"
10111011
ui_locations:
10121012
- "Fabric -> Fabric Policies -> Policies -> Pod -> Management Access"
1013-
class_version: "6.0(2h)"
1013+
class_version: "6.0(2h)-6.0(8g),6.1(3f)-"
10141014
contained_by:
10151015
- "polUni"
10161016
rn_prepend: "fabric"

gen/testvars/commPol.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,5 +263,5 @@ child_targets:
263263
name: "test_name"
264264

265265
test_type: both
266-
class_version: 6.0(2h)
266+
class_version: 6.0(2h)-6.0(8g),6.1(3f)-
267267
version_mismatch: true

internal/provider/data_source_aci_management_access_policy_test.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/provider/provider_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,14 @@ func testAccPreCheck(t *testing.T, testType string, testApplicableFromVersion st
104104
if err != nil {
105105
t.Fatalf("Error fetching APIC controller information: %v", err)
106106
}
107+
107108
apicVersion := extractControllerVersion(infoController)
108-
// TODO process the version when it has ranges associated with it
109-
if apicVersion != strings.TrimSuffix(testApplicableFromVersion, "-") {
110-
if IsVersionGreater(*ParseVersion(testApplicableFromVersion).Version, *ParseVersion(apicVersion).Version) {
111-
t.Skip("[WARNING] Test skipped because it is not supported on APIC version:", apicVersion)
112-
}
109+
110+
comparisonResult, err := CompareVersionsRange(apicVersion, testApplicableFromVersion, "inside")
111+
if err != nil {
112+
t.Skipf("[ERROR] Test skipped because the version '%s' couldn't be checked, error: %s", testApplicableFromVersion, err)
113+
} else if !comparisonResult {
114+
t.Skipf("[WARNING] Test skipped because the version '%s' is not supported on APIC version: %s", testApplicableFromVersion, apicVersion)
113115
}
114116

115117
}

internal/provider/resource_aci_management_access_policy_test.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)