| # 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"].join("dir-to-upload") |
| tree = api.file.symlink_tree(dir_path) |
| temp_dir = api.path.mkdtemp() |
| tree.register_link( |
| target=temp_dir.join("path", "to", "file"), linkname=tree.root.join("temp") |
| ) |
| tree.register_link( |
| target=temp_dir.join("path/to/file"), linkname=tree.root.join("temp2") |
| ) |
| tree.create_links("create links") |
| upload_paths = [ |
| tree.root, |
| tree.root.join("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"].join("output_dir")) |
| |
| |
| def GenTests(api): |
| yield api.test("basic") |