Skip to content

Commit 80b253a

Browse files
authored
Enable admin tests and configure rest for non-admin (terraform-provider-openstack#1213)
Add new job to run admin tests. Add helper function to run only when non-admin user used. Update all non-admin tests to use new helper function.
1 parent a073443 commit 80b253a

162 files changed

Lines changed: 1381 additions & 310 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.zuul.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
jobs:
55
- terraform-provider-openstack-unittest
66
- terraform-provider-openstack-acceptance-test
7+
- terraform-provider-openstack-acceptance-test-admin
78
recheck-newton:
89
jobs:
910
- terraform-provider-openstack-acceptance-test-newton

‎go.sum‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ github.com/hashicorp/terraform-json v0.5.0 h1:7TV3/F3y7QVSuN4r9BEXqnWqrAyeOtON8f
203203
github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU=
204204
github.com/hashicorp/terraform-plugin-sdk v1.16.0 h1:NrkXMRjHErUPPTHQkZ6JIn6bByiJzGnlJzH1rVdNEuE=
205205
github.com/hashicorp/terraform-plugin-sdk v1.16.0/go.mod h1:5sVxrwW6/xzFhZyql+Q9zXCUEJaGWcBIxBbZFLpVXOI=
206+
github.com/hashicorp/terraform-plugin-sdk v1.16.1 h1:G2iK7MBT4LuNcVASPXWS1ciBUuIm8oIY0zRfCmi3xy4=
206207
github.com/hashicorp/terraform-plugin-test/v2 v2.1.2 h1:p96IIn+XpvVjw7AtN8y9MKxn0x69S7wtbGf7JgDJoIk=
207208
github.com/hashicorp/terraform-plugin-test/v2 v2.1.2/go.mod h1:jerO5mrd+jVNALy8aiq+VZOg/CR8T2T1QR3jd6JKGOI=
208209
github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg=

‎openstack/data_source_openstack_blockstorage_availability_zones_v3_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import (
99

1010
func TestAccBlockStorageV3AvailabilityZonesV3_basic(t *testing.T) {
1111
resource.Test(t, resource.TestCase{
12-
PreCheck: func() { testAccPreCheck(t) },
12+
PreCheck: func() {
13+
testAccPreCheck(t)
14+
testAccPreCheckNonAdminOnly(t)
15+
},
1316
Providers: testAccProviders,
1417
Steps: []resource.TestStep{
1518
{

‎openstack/data_source_openstack_blockstorage_snapshot_v2_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ func TestAccBlockStorageV2SnapshotDataSource_basic(t *testing.T) {
3030
}
3131

3232
resource.Test(t, resource.TestCase{
33-
PreCheck: func() { testAccPreCheck(t) },
33+
PreCheck: func() {
34+
testAccPreCheck(t)
35+
testAccPreCheckNonAdminOnly(t)
36+
},
3437
Providers: testAccProviders,
3538
Steps: []resource.TestStep{
3639
{

‎openstack/data_source_openstack_blockstorage_snapshot_v3_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ func TestAccBlockStorageV3SnapshotDataSource_basic(t *testing.T) {
3030
}
3131

3232
resource.Test(t, resource.TestCase{
33-
PreCheck: func() { testAccPreCheck(t) },
33+
PreCheck: func() {
34+
testAccPreCheck(t)
35+
testAccPreCheckNonAdminOnly(t)
36+
},
3437
Providers: testAccProviders,
3538
Steps: []resource.TestStep{
3639
{

‎openstack/data_source_openstack_blockstorage_volume_v2_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ func TestAccBlockStorageV2VolumeDataSource_basic(t *testing.T) {
2828
}
2929

3030
resource.Test(t, resource.TestCase{
31-
PreCheck: func() { testAccPreCheck(t) },
31+
PreCheck: func() {
32+
testAccPreCheck(t)
33+
testAccPreCheckNonAdminOnly(t)
34+
},
3235
Providers: testAccProviders,
3336
Steps: []resource.TestStep{
3437
{

‎openstack/data_source_openstack_blockstorage_volume_v3_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ func TestAccBlockStorageV3VolumeDataSource_basic(t *testing.T) {
2828
}
2929

3030
resource.Test(t, resource.TestCase{
31-
PreCheck: func() { testAccPreCheck(t) },
31+
PreCheck: func() {
32+
testAccPreCheck(t)
33+
testAccPreCheckNonAdminOnly(t)
34+
},
3235
Providers: testAccProviders,
3336
Steps: []resource.TestStep{
3437
{

‎openstack/data_source_openstack_compute_availability_zones_v2_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import (
99

1010
func TestAccOpenStackAvailabilityZonesV2_basic(t *testing.T) {
1111
resource.Test(t, resource.TestCase{
12-
PreCheck: func() { testAccPreCheck(t) },
12+
PreCheck: func() {
13+
testAccPreCheck(t)
14+
testAccPreCheckNonAdminOnly(t)
15+
},
1316
Providers: testAccProviders,
1417
Steps: []resource.TestStep{
1518
{

‎openstack/data_source_openstack_compute_flavor_v2_test.go‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import (
1111

1212
func TestAccComputeV2FlavorDataSource_basic(t *testing.T) {
1313
resource.Test(t, resource.TestCase{
14-
PreCheck: func() { testAccPreCheck(t) },
14+
PreCheck: func() {
15+
testAccPreCheck(t)
16+
testAccPreCheckNonAdminOnly(t)
17+
},
1518
Providers: testAccProviders,
1619
Steps: []resource.TestStep{
1720
{
@@ -38,7 +41,10 @@ func TestAccComputeV2FlavorDataSource_basic(t *testing.T) {
3841

3942
func TestAccComputeV2FlavorDataSource_testQueries(t *testing.T) {
4043
resource.Test(t, resource.TestCase{
41-
PreCheck: func() { testAccPreCheck(t) },
44+
PreCheck: func() {
45+
testAccPreCheck(t)
46+
testAccPreCheckNonAdminOnly(t)
47+
},
4248
Providers: testAccProviders,
4349
Steps: []resource.TestStep{
4450
{

‎openstack/data_source_openstack_compute_instance_v2_test.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import (
1010

1111
func TestAccComputeV2InstanceDataSource(t *testing.T) {
1212
resource.Test(t, resource.TestCase{
13-
PreCheck: func() { testAccPreCheck(t) },
13+
PreCheck: func() {
14+
testAccPreCheck(t)
15+
testAccPreCheckNonAdminOnly(t)
16+
},
1417
Providers: testAccProviders,
1518
Steps: []resource.TestStep{
1619
{

0 commit comments

Comments
 (0)