Skip to content

Commit a1d5a13

Browse files
authored
remove deprecated Cluster variable in tests (#666)
1 parent 544f0ee commit a1d5a13

File tree

2 files changed

+63
-15
lines changed

2 files changed

+63
-15
lines changed

test/integration/fixtures/TestObjectStorageBuckets_List.yaml

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ interactions:
4242
Content-Type:
4343
- application/json
4444
Expires:
45-
- Wed, 08 Jan 2025 06:03:18 GMT
45+
- Thu, 30 Jan 2025 19:34:04 GMT
4646
Pragma:
4747
- no-cache
4848
Strict-Transport-Security:
@@ -78,10 +78,50 @@ interactions:
7878
url: https://api.linode.com/v4beta/object-storage/buckets?page=1
7979
method: GET
8080
response:
81-
body: '{"data": [{"hostname": "go-bucket-test-def.us-east-1.linodeobjects.com",
81+
body: '{"data": [{"hostname": "bucket-1736798274052633022.gb-lon-1.linodeobjects.com",
82+
"label": "bucket-1736798274052633022", "created": "2018-01-02T03:04:05", "region":
83+
"gb-lon", "cluster": "", "size": 0, "objects": 0, "endpoint_type": "E3", "s3_endpoint":
84+
"gb-lon-1.linodeobjects.com"}, {"hostname": "bucket-1738000793614673680.gb-lon-1.linodeobjects.com",
85+
"label": "bucket-1738000793614673680", "created": "2018-01-02T03:04:05", "region":
86+
"gb-lon", "cluster": "", "size": 0, "objects": 0, "endpoint_type": "E3", "s3_endpoint":
87+
"gb-lon-1.linodeobjects.com"}, {"hostname": "go-bucket-test-def.us-east-1.linodeobjects.com",
8288
"label": "go-bucket-test-def", "created": "2018-01-02T03:04:05", "region": "us-east",
8389
"cluster": "us-east-1", "size": 0, "objects": 0, "endpoint_type": "E0", "s3_endpoint":
84-
"us-east-1.linodeobjects.com"}], "page": 1, "pages": 1, "results": 1}'
90+
"us-east-1.linodeobjects.com"}, {"hostname": "tf-test-1543819153442410267.sg-sin-1.linodeobjects.com",
91+
"label": "tf-test-1543819153442410267", "created": "2018-01-02T03:04:05", "region":
92+
"sg-sin-2", "cluster": "", "size": 0, "objects": 0, "endpoint_type": "E2", "s3_endpoint":
93+
"sg-sin-1.linodeobjects.com"}, {"hostname": "tf-test-2484676038142344857.it-mil-1.linodeobjects.com",
94+
"label": "tf-test-2484676038142344857", "created": "2018-01-02T03:04:05", "region":
95+
"it-mil", "cluster": "it-mil-1", "size": 0, "objects": 0, "endpoint_type": "E1",
96+
"s3_endpoint": "it-mil-1.linodeobjects.com"}, {"hostname": "tf-test-3502349996573909406.us-iad-1.linodeobjects.com",
97+
"label": "tf-test-3502349996573909406", "created": "2018-01-02T03:04:05", "region":
98+
"us-iad", "cluster": "us-iad-1", "size": 0, "objects": 0, "endpoint_type": "E1",
99+
"s3_endpoint": "us-iad-1.linodeobjects.com"}, {"hostname": "tf-test-3632911602253826896.gb-lon-1.linodeobjects.com",
100+
"label": "tf-test-3632911602253826896", "created": "2018-01-02T03:04:05", "region":
101+
"gb-lon", "cluster": "", "size": 0, "objects": 0, "endpoint_type": "E3", "s3_endpoint":
102+
"gb-lon-1.linodeobjects.com"}, {"hostname": "tf-test-3691810287020261631.us-iad-1.linodeobjects.com",
103+
"label": "tf-test-3691810287020261631", "created": "2018-01-02T03:04:05", "region":
104+
"us-iad", "cluster": "us-iad-1", "size": 0, "objects": 0, "endpoint_type": "E1",
105+
"s3_endpoint": "us-iad-1.linodeobjects.com"}, {"hostname": "tf-test-3847259615974034792.us-iad-1.linodeobjects.com",
106+
"label": "tf-test-3847259615974034792", "created": "2018-01-02T03:04:05", "region":
107+
"us-iad", "cluster": "us-iad-1", "size": 0, "objects": 0, "endpoint_type": "E1",
108+
"s3_endpoint": "us-iad-1.linodeobjects.com"}, {"hostname": "tf-test-5629732048996817677.us-iad-1.linodeobjects.com",
109+
"label": "tf-test-5629732048996817677", "created": "2018-01-02T03:04:05", "region":
110+
"us-iad", "cluster": "us-iad-1", "size": 0, "objects": 0, "endpoint_type": "E1",
111+
"s3_endpoint": "us-iad-1.linodeobjects.com"}, {"hostname": "tf-test-6566002079784759866.us-iad-1.linodeobjects.com",
112+
"label": "tf-test-6566002079784759866", "created": "2018-01-02T03:04:05", "region":
113+
"us-iad", "cluster": "us-iad-1", "size": 0, "objects": 0, "endpoint_type": "E1",
114+
"s3_endpoint": "us-iad-1.linodeobjects.com"}, {"hostname": "tf-test-6680232593917341773.us-iad-1.linodeobjects.com",
115+
"label": "tf-test-6680232593917341773", "created": "2018-01-02T03:04:05", "region":
116+
"us-iad", "cluster": "us-iad-1", "size": 0, "objects": 0, "endpoint_type": "E1",
117+
"s3_endpoint": "us-iad-1.linodeobjects.com"}, {"hostname": "tf-test-6921913936824551527.id-cgk-1.linodeobjects.com",
118+
"label": "tf-test-6921913936824551527", "created": "2018-01-02T03:04:05", "region":
119+
"id-cgk", "cluster": "id-cgk-1", "size": 0, "objects": 0, "endpoint_type": "E1",
120+
"s3_endpoint": "id-cgk-1.linodeobjects.com"}, {"hostname": "tf-test-8637208670123446138.us-iad-1.linodeobjects.com",
121+
"label": "tf-test-8637208670123446138", "created": "2018-01-02T03:04:05", "region":
122+
"us-iad", "cluster": "us-iad-1", "size": 0, "objects": 0, "endpoint_type": "E1",
123+
"s3_endpoint": "us-iad-1.linodeobjects.com"}], "page": 1, "pages": 1, "results":
124+
14}'
85125
headers:
86126
Access-Control-Allow-Credentials:
87127
- "true"
@@ -99,21 +139,20 @@ interactions:
99139
- max-age=0, no-cache, no-store
100140
Connection:
101141
- keep-alive
102-
Content-Length:
103-
- "315"
104142
Content-Security-Policy:
105143
- default-src 'none'
106144
Content-Type:
107145
- application/json
108146
Expires:
109-
- Wed, 08 Jan 2025 06:03:20 GMT
147+
- Thu, 30 Jan 2025 19:34:09 GMT
110148
Pragma:
111149
- no-cache
112150
Strict-Transport-Security:
113151
- max-age=31536000
114152
Vary:
115153
- Authorization, X-Filter
116154
- Authorization, X-Filter
155+
- Accept-Encoding
117156
X-Accepted-Oauth-Scopes:
118157
- object_storage:read_only
119158
X-Content-Type-Options:
@@ -168,7 +207,7 @@ interactions:
168207
Content-Type:
169208
- application/json
170209
Expires:
171-
- Wed, 08 Jan 2025 06:03:26 GMT
210+
- Thu, 30 Jan 2025 19:34:13 GMT
172211
Pragma:
173212
- no-cache
174213
Strict-Transport-Security:

test/integration/object_storage_buckets_test.go

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,24 @@ func TestObjectStorageBuckets_List_smoke(t *testing.T) {
137137
"fixtures/TestObjectStorageBuckets_List", nil, nil, nil)
138138
defer teardown()
139139

140-
i, err := client.ListObjectStorageBuckets(context.Background(), nil)
141140
if err != nil {
142-
t.Errorf("Error listing ObjectStorageBuckets, expected struct, got error %v", err)
141+
t.Fatalf("Failed to set up test: %v", err)
143142
}
144-
if len(i) == 0 {
145-
t.Errorf("Expected a list of ObjectStorageBuckets, but got none %v", i)
146-
} else if i[0].Label == "" ||
147-
i[0].Cluster == "" {
148-
t.Errorf("Listed Object Storage Bucket did not have attribuets %v", i)
143+
144+
buckets, err := client.ListObjectStorageBuckets(context.Background(), nil)
145+
if err != nil {
146+
t.Fatalf("Error listing Object Storage Buckets: %v", err)
147+
}
148+
149+
if len(buckets) == 0 {
150+
t.Fatalf("Expected at least one Object Storage Bucket, but got none.")
151+
}
152+
153+
for index, bucket := range buckets {
154+
if bucket.Label == "" {
155+
t.Errorf("Bucket at index %d is missing attributes: Label=%q, Full Bucket Data: %+v",
156+
index, bucket.Label, bucket)
157+
}
149158
}
150159
}
151160

@@ -163,7 +172,7 @@ func TestObjectStorageBucketsInCluster_List(t *testing.T) {
163172
t.Errorf("Expected a list of ObjectStorageBucketsInCluster, but got none %v", i)
164173
} else if i[0].Label == "" ||
165174
i[0].Cluster == "" {
166-
t.Errorf("Listed Object Storage Bucket in Cluster did not have attribuets %v", i)
175+
t.Errorf("Listed Object Storage Bucket in Cluster did not have attributes %v", i)
167176
}
168177
}
169178

0 commit comments

Comments
 (0)