X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/5fd7a6b976b93d15a3a66c7610fc4d8b824bb31e..2c0c6e6ba25ec56bab8c224865a7979af577adaa:/sdk/ruby/test/sdk_fixtures.rb diff --git a/sdk/ruby/test/sdk_fixtures.rb b/sdk/ruby/test/sdk_fixtures.rb index 8af81cdcf4..6bf6a9e613 100644 --- a/sdk/ruby/test/sdk_fixtures.rb +++ b/sdk/ruby/test/sdk_fixtures.rb @@ -7,6 +7,10 @@ module SDKFixtures def random_block(size=nil) sprintf("%032x+%d", rand(16 ** 32), size || rand(64 * 1024 * 1024)) end + + def random_blocks(count, size=nil) + (0...count).map { |_| random_block(size) } + end end extend StaticMethods @@ -50,4 +54,17 @@ module SDKFixtures NONNORMALIZED_MANIFEST = ["./dir2 #{random_block} 0:0:z 0:0:y 0:0:x", "./dir1 #{random_block} 0:0:p 0:0:o 0:0:n\n"].join("\n") + MANIFEST_WITH_DIRS_IN_FILENAMES = + [". #{random_block(10)} 0:3:file1 3:3:dir1/file1 6:3:dir1/dir2/file1\n"].join("") + MULTILEVEL_MANIFEST_WITH_DIRS_IN_FILENAMES = + [". #{random_block(10)} 0:3:file1 3:3:dir1/file1 6:4:dir1/dir2/file1\n", + "./dir1 #{random_block(10)} 0:3:file1 3:7:dir2/file1\n"].join("") + + ### Non-tree manifests + # These manifests follow the spec, but they express a structure that can't + # can't be represented by a POSIX filesystem tree. For example, there's a + # name conflict between a stream and a filename. + NAME_CONFLICT_MANIFEST = + [". #{random_block(9)} 0:9:conflict", + "./conflict #{random_block} 0:0:name\n"].join("\n") end