Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(148)

Unified Diff: ec2/ec2i_test.go

Issue 6501117: ec2test: allow an empty user id in AuthorizeSecurityGroupIngress.
Patch Set: ec2test: allow an empty user id in AuthorizeSecurityGroupIngress. Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « [revision details] ('k') | ec2/ec2t_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ec2/ec2i_test.go
=== modified file 'ec2/ec2i_test.go'
--- ec2/ec2i_test.go 2012-03-09 14:02:34 +0000
+++ ec2/ec2i_test.go 2012-09-11 14:55:30 +0000
@@ -151,11 +151,17 @@
c.Assert(resp2.RequestId, Matches, ".+")
}
-func uniqueName(e *ec2.EC2, prefix string) string {
+var sessionId = func() string{
buf := make([]byte, 8)
// if we have no randomness, we'll just make do, so ignore the error.
- n, _ := rand.Read(buf)
- return fmt.Sprintf("%s-%s-%x", prefix, e.AccessKey, buf[0:n])
+ rand.Read(buf)
+ return fmt.Sprintf("%x", buf)
+}()
+
+// sessionName reutrns a name that is probably
+// unique to this test session.
+func sessionName(prefix string) string {
+ return prefix + "-" + sessionId
}
var allRegions = []aws.Region{
@@ -168,7 +174,7 @@
// Communicate with all EC2 endpoints to see if they are alive.
func (s *ClientTests) TestRegions(c *C) {
- name := uniqueName(s.ec2, "goamz-region-test")
+ name := sessionName("goamz-region-test")
perms := []ec2.IPPerm{{
Protocol: "tcp",
FromPort: 80,
« no previous file with comments | « [revision details] ('k') | ec2/ec2t_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b