@@ -212,6 +212,55 @@ func (suite *syncContainerTestSuite) TestGetContainerContentsDirsWithAllAttrs()
212212 }
213213}
214214
215+ func (suite * syncContainerTestSuite ) TestGetContainerContentsStreamDirsWithAllAttrs () {
216+ path := fmt .Sprintf ("tmp/test/sync_test/TestGetContainerContentsStreamDirsWithAllAttrs/%d/" , time .Now ().Unix ())
217+
218+ const (
219+ shard_count = 12
220+ retention_period_hours = 2
221+ )
222+
223+ // Create some stream content (stream directory and shards)
224+ createStreamInput := & v3io.CreateStreamInput {}
225+ for i := 1 ; i <= 10 ; i ++ {
226+ createStreamInput .Path = fmt .Sprintf ("%sstream-%d/" , path , i )
227+ createStreamInput .ShardCount = shard_count
228+ createStreamInput .RetentionPeriodHours = retention_period_hours
229+
230+ // when run against a context
231+ suite .populateDataPlaneInput (& createStreamInput .DataPlaneInput )
232+ err := suite .container .CreateStreamSync (createStreamInput )
233+ suite .Require ().NoError (err , "Failed to create test content" )
234+ }
235+
236+ getContainerContentsInput := v3io.GetContainerContentsInput {
237+ Path : path ,
238+ GetAllAttributes : true ,
239+ DirectoriesOnly : true ,
240+ Limit : 10 ,
241+ }
242+
243+ // when run against a context
244+ suite .populateDataPlaneInput (& getContainerContentsInput .DataPlaneInput )
245+
246+ // get container contents
247+ response , err := suite .container .GetContainerContentsSync (& getContainerContentsInput )
248+ suite .Require ().NoError (err , "Failed to get container contents" )
249+ response .Release ()
250+
251+ getContainerContentsOutput := response .Output .(* v3io.GetContainerContentsOutput )
252+ suite .Require ().Empty (len (getContainerContentsOutput .Contents ))
253+ suite .Require ().Equal (10 , len (getContainerContentsOutput .CommonPrefixes ))
254+ suite .Require ().Equal (path + "stream-9" , getContainerContentsOutput .NextMarker )
255+ suite .Require ().Equal (false , getContainerContentsOutput .IsTruncated )
256+
257+ for _ , prefix := range getContainerContentsOutput .CommonPrefixes {
258+ validateCommonPrefix (suite , & prefix , true )
259+ suite .Require ().Equal (shard_count , prefix .ShardCount )
260+ suite .Require ().Equal (retention_period_hours , prefix .RetentionPeriodHours )
261+ }
262+ }
263+
215264// TODO: fix. Broken with:
216265// Messages: Failed to update test directory
217266// due to:
0 commit comments