@@ -45,16 +45,18 @@ func TestPutGoogleCloud(t *testing.T) {
4545
4646 user := username .RootUserName ()
4747 testSettings := cluster .MakeTestingClusterSettings ()
48+ testID := cloudtestutils .NewTestID ()
4849
4950 testutils .RunTrueAndFalse (t , "auth-specified-with-auth-param" , func (t * testing.T , specified bool ) {
5051 credentials := os .Getenv ("GOOGLE_CREDENTIALS_JSON" )
5152 if credentials == "" {
5253 skip .IgnoreLint (t , "GOOGLE_CREDENTIALS_JSON env var must be set" )
5354 }
5455 encoded := base64 .StdEncoding .EncodeToString ([]byte (credentials ))
55- uri := fmt .Sprintf ("gs://%s/%s?%s=%s" ,
56+ uri := fmt .Sprintf ("gs://%s/%s-%d ?%s=%s" ,
5657 bucket ,
5758 "backup-test-specified" ,
59+ testID ,
5860 CredentialsParam ,
5961 url .QueryEscape (encoded ),
6062 )
@@ -69,9 +71,10 @@ func TestPutGoogleCloud(t *testing.T) {
6971 nil , /* db */
7072 testSettings ,
7173 )
72- cloudtestutils .CheckListFiles (t , fmt .Sprintf ("gs://%s/%s/%s?%s=%s&%s=%s" ,
74+ cloudtestutils .CheckListFiles (t , fmt .Sprintf ("gs://%s/%s-%d /%s?%s=%s&%s=%s" ,
7375 bucket ,
7476 "backup-test-specified" ,
77+ testID ,
7578 "listing-test" ,
7679 cloud .AuthParam ,
7780 cloud .AuthParamSpecified ,
@@ -89,15 +92,16 @@ func TestPutGoogleCloud(t *testing.T) {
8992
9093 cloudtestutils .CheckExportStore (
9194 t ,
92- fmt .Sprintf ("gs://%s/%s?%s=%s" , bucket , "backup-test-implicit" ,
95+ fmt .Sprintf ("gs://%s/%s-%d ?%s=%s" , bucket , "backup-test-implicit" , testID ,
9396 cloud .AuthParam , cloud .AuthParamImplicit ),
9497 false ,
9598 user ,
9699 nil , /* db */
97100 testSettings )
98- cloudtestutils .CheckListFiles (t , fmt .Sprintf ("gs://%s/%s/%s?%s=%s" ,
101+ cloudtestutils .CheckListFiles (t , fmt .Sprintf ("gs://%s/%s-%d /%s?%s=%s" ,
99102 bucket ,
100103 "backup-test-implicit" ,
104+ testID ,
101105 "listing-test" ,
102106 cloud .AuthParam ,
103107 cloud .AuthParamImplicit ,
@@ -121,9 +125,10 @@ func TestPutGoogleCloud(t *testing.T) {
121125 token , err := ts .Token ()
122126 require .NoError (t , err , "getting token" )
123127
124- uri := fmt .Sprintf ("gs://%s/%s?%s=%s" ,
128+ uri := fmt .Sprintf ("gs://%s/%s-%d ?%s=%s" ,
125129 bucket ,
126130 "backup-test-specified" ,
131+ testID ,
127132 BearerTokenParam ,
128133 token .AccessToken ,
129134 )
@@ -135,9 +140,10 @@ func TestPutGoogleCloud(t *testing.T) {
135140 user ,
136141 nil , /* db */
137142 testSettings )
138- cloudtestutils .CheckListFiles (t , fmt .Sprintf ("gs://%s/%s/%s?%s=%s&%s=%s" ,
143+ cloudtestutils .CheckListFiles (t , fmt .Sprintf ("gs://%s/%s-%d /%s?%s=%s&%s=%s" ,
139144 bucket ,
140145 "backup-test-specified" ,
146+ testID ,
141147 "listing-test" ,
142148 cloud .AuthParam ,
143149 cloud .AuthParamSpecified ,
@@ -163,6 +169,8 @@ func TestGCSAssumeRole(t *testing.T) {
163169 skip .IgnoreLint (t , "ASSUME_SERVICE_ACCOUNT env var must be set" )
164170 }
165171
172+ testID := cloudtestutils .NewTestID ()
173+
166174 t .Run ("specified" , func (t * testing.T ) {
167175 credentials := os .Getenv ("GOOGLE_CREDENTIALS_JSON" )
168176 if credentials == "" {
@@ -172,17 +180,18 @@ func TestGCSAssumeRole(t *testing.T) {
172180
173181 // Verify that specified permissions with the credentials do not give us
174182 // access to the bucket.
175- cloudtestutils .CheckNoPermission (t , fmt .Sprintf ("gs://%s/%s?%s=%s" , limitedBucket , "backup-test-assume-role" ,
183+ cloudtestutils .CheckNoPermission (t , fmt .Sprintf ("gs://%s/%s-%d ?%s=%s" , limitedBucket , "backup-test-assume-role" , testID ,
176184 CredentialsParam , url .QueryEscape (encoded )), user ,
177185 nil , /* db */
178186 testSettings ,
179187 )
180188
181189 cloudtestutils .CheckExportStore (
182190 t ,
183- fmt .Sprintf ("gs://%s/%s?%s=%s&%s=%s&%s=%s" ,
191+ fmt .Sprintf ("gs://%s/%s-%d ?%s=%s&%s=%s&%s=%s" ,
184192 limitedBucket ,
185193 "backup-test-assume-role" ,
194+ testID ,
186195 cloud .AuthParam ,
187196 cloud .AuthParamSpecified ,
188197 AssumeRoleParam ,
@@ -192,9 +201,10 @@ func TestGCSAssumeRole(t *testing.T) {
192201 nil , /* db */
193202 testSettings ,
194203 )
195- cloudtestutils .CheckListFiles (t , fmt .Sprintf ("gs://%s/%s/%s?%s=%s&%s=%s&%s=%s" ,
204+ cloudtestutils .CheckListFiles (t , fmt .Sprintf ("gs://%s/%s-%d /%s?%s=%s&%s=%s&%s=%s" ,
196205 limitedBucket ,
197206 "backup-test-assume-role" ,
207+ testID ,
198208 "listing-test" ,
199209 cloud .AuthParam ,
200210 cloud .AuthParamSpecified ,
@@ -215,20 +225,21 @@ func TestGCSAssumeRole(t *testing.T) {
215225
216226 // Verify that implicit permissions with the credentials do not give us
217227 // access to the bucket.
218- cloudtestutils .CheckNoPermission (t , fmt .Sprintf ("gs://%s/%s?%s=%s" , limitedBucket , "backup-test-assume-role" ,
228+ cloudtestutils .CheckNoPermission (t , fmt .Sprintf ("gs://%s/%s-%d ?%s=%s" , limitedBucket , "backup-test-assume-role" , testID ,
219229 cloud .AuthParam , cloud .AuthParamImplicit ), user ,
220230 nil , /* db */
221231 testSettings ,
222232 )
223233
224- cloudtestutils .CheckExportStore (t , fmt .Sprintf ("gs://%s/%s?%s=%s&%s=%s" , limitedBucket , "backup-test-assume-role" ,
234+ cloudtestutils .CheckExportStore (t , fmt .Sprintf ("gs://%s/%s-%d ?%s=%s&%s=%s" , limitedBucket , "backup-test-assume-role" , testID ,
225235 cloud .AuthParam , cloud .AuthParamImplicit , AssumeRoleParam , assumedAccount ), false , user ,
226236 nil , /* db */
227237 testSettings ,
228238 )
229- cloudtestutils .CheckListFiles (t , fmt .Sprintf ("gs://%s/%s/%s?%s=%s&%s=%s" ,
239+ cloudtestutils .CheckListFiles (t , fmt .Sprintf ("gs://%s/%s-%d /%s?%s=%s&%s=%s" ,
230240 limitedBucket ,
231241 "backup-test-assume-role" ,
242+ testID ,
232243 "listing-test" ,
233244 cloud .AuthParam ,
234245 cloud .AuthParamImplicit ,
@@ -270,9 +281,10 @@ func TestGCSAssumeRole(t *testing.T) {
270281 // to access the storage.
271282 for _ , role := range roleChain {
272283 q .Set (AssumeRoleParam , role )
273- roleURI := fmt .Sprintf ("gs://%s/%s/%s?%s" ,
284+ roleURI := fmt .Sprintf ("gs://%s/%s-%d /%s?%s" ,
274285 limitedBucket ,
275286 "backup-test-assume-role" ,
287+ testID ,
276288 "listing-test" ,
277289 q .Encode (),
278290 )
@@ -284,9 +296,10 @@ func TestGCSAssumeRole(t *testing.T) {
284296
285297 // Finally, check that the chain of roles can be used to access the storage.
286298 q .Set (AssumeRoleParam , roleChainStr )
287- uri := fmt .Sprintf ("gs://%s/%s/%s?%s" ,
299+ uri := fmt .Sprintf ("gs://%s/%s-%d /%s?%s" ,
288300 limitedBucket ,
289301 "backup-test-assume-role" ,
302+ testID ,
290303 "listing-test" ,
291304 q .Encode (),
292305 )
@@ -454,13 +467,14 @@ func TestReadFileAtReturnsSize(t *testing.T) {
454467 skip .IgnoreLint (t , "GOOGLE_BUCKET env var must be set" )
455468 }
456469
470+ testID := cloudtestutils .NewTestID ()
457471 user := username .RootUserName ()
458472 ctx := context .Background ()
459473 testSettings := cluster .MakeTestingClusterSettings ()
460474 file := "testfile"
461475 data := []byte ("hello world" )
462476
463- gsURI := fmt .Sprintf ("gs://%s/%s?AUTH=implicit" , bucket , "read-file-at-returns-size" )
477+ gsURI := fmt .Sprintf ("gs://%s/%s-%d ?AUTH=implicit" , bucket , "read-file-at-returns-size" , testID )
464478 conf , err := cloud .ExternalStorageConfFromURI (gsURI , user )
465479 require .NoError (t , err )
466480 args := cloud.ExternalStorageContext {
0 commit comments