File tree Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -988,7 +988,7 @@ jobs:
988
988
result=${result%\%}
989
989
echo "result:"
990
990
echo $result
991
- threshold=52.1
991
+ threshold=52.7
992
992
if (( $(echo "$result >= $threshold" |bc -l) )); then
993
993
echo "It is equal or greater than threshold, passed!"
994
994
else
Original file line number Diff line number Diff line change @@ -169,3 +169,47 @@ func TestRestartService(t *testing.T) {
169
169
}
170
170
171
171
}
172
+
173
+ func ListPoliciesWithBucket (bucketName string ) (* http.Response , error ) {
174
+ /*
175
+ Helper function to List Policies With Given Bucket
176
+ HTTP Verb: GET
177
+ URL: /bucket-policy/{bucket}
178
+ */
179
+ request , err := http .NewRequest (
180
+ "GET" , "http://localhost:9090/api/v1/bucket-policy/" + bucketName , nil )
181
+ if err != nil {
182
+ log .Println (err )
183
+ }
184
+ request .Header .Add ("Cookie" , fmt .Sprintf ("token=%s" , token ))
185
+ request .Header .Add ("Content-Type" , "application/json" )
186
+ client := & http.Client {
187
+ Timeout : 2 * time .Second ,
188
+ }
189
+ response , err := client .Do (request )
190
+ return response , err
191
+ }
192
+
193
+ func TestListPoliciesWithBucket (t * testing.T ) {
194
+
195
+ // Test Variables
196
+ bucketName := "testlistpolicieswithbucket"
197
+ assert := assert .New (t )
198
+
199
+ // Test
200
+ response , err := ListPoliciesWithBucket (bucketName )
201
+ assert .Nil (err )
202
+ if err != nil {
203
+ log .Println (err )
204
+ return
205
+ }
206
+ parsedResponse := inspectHTTPResponse (response )
207
+ if response != nil {
208
+ assert .Equal (
209
+ 200 ,
210
+ response .StatusCode ,
211
+ parsedResponse ,
212
+ )
213
+ }
214
+
215
+ }
You can’t perform that action at this time.
0 commit comments