Files

67 lines
1.8 KiB
Python
Raw Permalink Normal View History

2020-07-26 22:01:16 -07:00
load("//tools:defs.bzl", "go_library", "go_test")
2019-09-03 22:01:34 -07:00
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
2019-09-03 22:01:34 -07:00
2024-09-11 20:37:38 -07:00
# We copy the `run_sniffer` binary here because `go:embed` can only embed
# from the current directory or subdirectories, not parents of it.
genrule(
name = "run_sniffer_bin",
srcs = [
"//tools/ioctl_sniffer:run_sniffer",
],
outs = ["run_sniffer_copy"],
cmd = "cat < $(SRCS) > $@",
)
2019-09-03 22:01:34 -07:00
go_library(
name = "dockerutil",
testonly = 1,
2020-07-08 13:24:58 -07:00
srcs = [
"container.go",
"dockerutil.go",
"exec.go",
2023-12-04 17:23:50 -08:00
"gpu.go",
2020-07-08 13:24:58 -07:00
"network.go",
2020-07-26 22:01:16 -07:00
"profile.go",
2020-07-08 13:24:58 -07:00
],
2024-09-11 20:37:38 -07:00
embedsrcs = [
":run_sniffer_bin", # keep
2024-09-09 16:29:45 -07:00
],
2024-09-11 20:37:38 -07:00
nogo = False,
2019-09-03 22:01:34 -07:00
visibility = ["//:sandbox"],
deps = [
"//pkg/sync",
2020-04-23 11:32:08 -07:00
"//pkg/test/testutil",
2022-03-17 15:01:17 -07:00
"//runsc/cgroup",
2020-07-08 13:24:58 -07:00
"@com_github_docker_docker//api/types:go_default_library",
2024-11-20 14:49:46 -08:00
"@com_github_docker_docker//api/types/checkpoint:go_default_library",
2020-07-08 13:24:58 -07:00
"@com_github_docker_docker//api/types/container:go_default_library",
"@com_github_docker_docker//api/types/mount:go_default_library",
"@com_github_docker_docker//api/types/network:go_default_library",
"@com_github_docker_go_connections//nat:go_default_library",
2023-08-09 20:46:35 -07:00
"@com_github_moby_moby//client:go_default_library",
"@com_github_moby_moby//pkg/stdcopy:go_default_library",
"@org_golang_x_sys//unix:go_default_library",
2019-09-03 22:01:34 -07:00
],
)
2020-07-26 22:01:16 -07:00
go_test(
name = "profile_test",
size = "large",
srcs = [
"profile_test.go",
],
library = ":dockerutil",
nogo = False,
2020-07-26 22:01:16 -07:00
tags = [
# Requires docker and runsc to be configured before test runs.
# Also requires the test to be run as root.
"local",
2021-04-20 13:09:36 -07:00
"manual",
2020-07-26 22:01:16 -07:00
],
visibility = ["//:sandbox"],
)