mirror of
https://github.com/minio/minio.git
synced 2025-01-24 13:13:16 -05:00
bucket-policy: Delete policy should remove policy properly. (#1456)
This commit is contained in:
parent
afd59c45dc
commit
ac7a7cec20
@ -101,6 +101,9 @@ func removeBucketPolicy(bucket string) error {
|
||||
}
|
||||
return err
|
||||
}
|
||||
if err := os.Remove(bucketPolicyFile); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -350,6 +350,15 @@ func (s *MyAPISuite) TestBucketPolicy(c *C) {
|
||||
response, err = client.Do(request)
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(response.StatusCode, Equals, http.StatusNoContent)
|
||||
|
||||
// Verify if the policy was indeed deleted.
|
||||
request, err = s.newRequest("GET", testAPIFSCacheServer.URL+"/policybucket?policy", 0, nil)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
client = http.Client{}
|
||||
response, err = client.Do(request)
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(response.StatusCode, Equals, http.StatusNotFound)
|
||||
}
|
||||
|
||||
func (s *MyAPISuite) TestDeleteBucket(c *C) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user