blob: 937404593dc63186c02f5dad8609372acc87c2d3 [file] [log] [blame]
# Copyright 2021 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
"fuchsia/cas_util",
"recipe_engine/file",
"recipe_engine/path",
]
def RunSteps(api):
dir_path = api.path.cleanup_dir / "dir-to-upload"
tree = api.file.symlink_tree(dir_path)
temp_dir = api.path.mkdtemp()
tree.register_link(
target=temp_dir.joinpath("path", "to", "file"),
linkname=tree.root.joinpath("temp"),
)
tree.register_link(
target=temp_dir.joinpath("path/to/file"), linkname=tree.root.joinpath("temp2")
)
tree.create_links("create links")
upload_paths = [
tree.root,
tree.root / "my_file",
]
api.cas_util.upload(tree.root)
api.cas_util.upload(tree.root, upload_paths, output_property="digest")
api.cas_util.download("", api.path.cleanup_dir / "output_dir")
def GenTests(api):
yield api.test("basic")