forked from GoogleContainerTools/rules_distroless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
48 lines (43 loc) · 1.15 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
load("@aspect_bazel_lib//lib:diff_test.bzl", "diff_test")
load("//distroless:defs.bzl", "os_release")
load("//distroless/tests:asserts.bzl", "assert_tar_listing")
os_release(
name = "os_release",
content = {
"PRETTY_NAME": "Distroless",
"VERSION": "Debian GNU/Linux",
},
)
diff_test(
name = "test_os_release_content",
file1 = "os_release_content",
file2 = "content.expected.txt",
)
assert_tar_listing(
name = "test_os_release",
actual = "os_release",
expected = """\
#mtree
./usr time=0.0 mode=755 gid=0 uid=0 type=dir
./usr/lib time=0.0 mode=755 gid=0 uid=0 type=dir
./usr/lib/os-release time=0.0 mode=555 gid=0 uid=0 type=file size=48
""",
)
os_release(
name = "os_release_alternative_path",
content = {
"PRETTY_NAME": "Distroless",
"VERSION": "Debian GNU/Linux",
"ARCHITECTURE": "arm64",
},
path = "/etc/os-release",
)
assert_tar_listing(
name = "test_os_release_alternative_path",
actual = "os_release_alternative_path",
expected = """\
#mtree
./etc time=0.0 mode=755 gid=0 uid=0 type=dir
./etc/os-release time=0.0 mode=555 gid=0 uid=0 type=file size=67
""",
)