blob: 94d96dc5400cc888429d912b333d43f428c35e79 [file]
# Copyright 2026 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.
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@rules_python//python:py_library.bzl", "py_library")
load("//build/bazel/platforms:constraints.bzl", "HOST_OS_CONSTRAINTS")
load("//build/bazel/rules/host_tests:host_py_test.bzl", "host_py_test")
package(default_applicable_licenses = ["//:license"])
# Bazel py_library() lacks GN's library_name, so stage *.py under storage_e2e_testing/.
# @bazel2gn:skip
copy_file(
name = "copy_init",
testonly = True,
src = "__init__.py",
out = "storage_e2e_testing/__init__.py",
)
# @bazel2gn:skip
copy_file(
name = "copy_keymint",
testonly = True,
src = "keymint.py",
out = "storage_e2e_testing/keymint.py",
)
# Bazel py_library() has no library_name attribute; match GN's direct sources
# (whose default library_name is "storage_e2e_testing") and preserve GN's
# default enable_mypy = true so downstream mypy consumers retain type info.
# @bazel2gn:raw_attribute:enable_mypy = true
# @bazel2gn:raw_attribute:sources = [ "__init__.py", "keymint.py" ]
py_library(
name = "storage_e2e_testing",
testonly = True,
# GN stages sources under library_name = "storage_e2e_testing"; Bazel stages them via copy_file.
# @bazel2gn:skip
srcs = [
"storage_e2e_testing/__init__.py",
"storage_e2e_testing/keymint.py",
],
# GN python_library() forbids `imports` alongside default `library_name`.
# @bazel2gn:skip
imports = ["."],
target_compatible_with = HOST_OS_CONSTRAINTS,
visibility = ["//vendor/google:__subpackages__"],
deps = [
"//sdk/fidl/fuchsia.fs:fuchsia.fs_python",
"//sdk/fidl/fuchsia.io:fuchsia.io_python",
"//sdk/fidl/fuchsia.security.keymint:fuchsia.security.keymint_python",
"//src/developer/fuchsia-controller:fuchsia_controller_py",
"//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_python",
],
)
host_py_test(
name = "storage_e2e_testing_keymint_test",
testonly = True,
srcs = ["keymint_test.py"],
main = "keymint_test.py",
deps = [
":storage_e2e_testing",
"//sdk/fidl/fuchsia.fs:fuchsia.fs_python",
"//sdk/fidl/fuchsia.io:fuchsia.io_python",
"//sdk/fidl/fuchsia.security.keymint:fuchsia.security.keymint_python",
"//sdk/fidl/fuchsia.unknown:fuchsia.unknown_python",
"//src/developer/fuchsia-controller:fuchsia_controller_py",
"//src/storage/fidl/fuchsia.fs.startup:fuchsia.fs.startup_python",
],
)