bucket-policy: Delete policy should remove policy properly. (#1456)

master
Harshavardhana 9 years ago committed by Anand Babu (AB) Periasamy
parent afd59c45dc
commit ac7a7cec20
  1. 3
      bucket-policy.go
  2. 9
      server_test.go

@ -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…
Cancel
Save