Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support usrmerged /bin and /sbin #1477

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions base/base.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def distro_components(distro):
# directory with specific permissions.
":tmp.tar",
":nsswitch.tar",
":usrmerge.tar",
"//os_release:os_release_" + distro + ".tar",
":cacerts_" + arch + "_" + distro + ".tar",
],
Expand Down
14 changes: 13 additions & 1 deletion base/testdata/base.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
schemaVersion: "1.0.0"
schemaVersion: "2.0.0"
fileExistenceTests:
# Basic FS sanity checks.
- name: root
Expand All @@ -7,6 +7,18 @@ fileExistenceTests:
- name: tmp
path: '/tmp'
shouldExist: true
- name: '/bin -> /usr/bin'
path: '/bin'
shouldExist: true
permissions: 'Lrwxrwxrwx'
uid: 0
gid: 0
- name: '/sbin -> /usr/sbin'
path: '/sbin'
shouldExist: true
permissions: 'Lrwxrwxrwx'
uid: 0
gid: 0
- name: passwd
path: '/etc/passwd'
shouldExist: true
Expand Down
Binary file added base/usrmerge.tar
Binary file not shown.
10 changes: 8 additions & 2 deletions examples/cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ package(default_visibility = ["//visibility:public"])
[structure_test(
name = "hello_" + distro + "_test",
size = "small",
config = ["testdata/hello_" + distro + ".yaml"],
config = [
"testdata/hello_" + distro + ".yaml",
"testdata/usrmerge.yaml",
],
image = ":hello_" + distro,
tags = [
"amd64",
Expand All @@ -33,7 +36,10 @@ package(default_visibility = ["//visibility:public"])
[structure_test(
name = "hello_cc_" + distro + "_test",
size = "small",
config = ["testdata/hello_cc_" + distro + ".yaml"],
config = [
"testdata/hello_cc_" + distro + ".yaml",
"testdata/usrmerge.yaml",
],
image = ":hello_cc_" + distro,
tags = [
"amd64",
Expand Down
14 changes: 14 additions & 0 deletions examples/cc/testdata/usrmerge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
schemaVersion: "2.0.0"
fileExistenceTests:
- name: '/bin -> /usr/bin'
path: '/bin'
shouldExist: true
permissions: 'Lrwxrwxrwx'
uid: 0
gid: 0
- name: '/sbin -> /usr/sbin'
path: '/sbin'
shouldExist: true
permissions: 'Lrwxrwxrwx'
uid: 0
gid: 0
5 changes: 4 additions & 1 deletion java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,10 @@ DISTRO_SPECIFIC_LIBRARIES = {
[
structure_test(
name = "java_base" + mode + "_" + user + "_" + arch + "_" + distro + "_test",
config = ["testdata/java_base" + mode + ".yaml"],
config = [
"testdata/java_base" + mode + ".yaml",
"testdata/usrmerge.yaml",
],
image = ":java_base" + mode + "_" + user + "_" + arch + "_" + distro,
tags = [
arch,
Expand Down
14 changes: 14 additions & 0 deletions java/testdata/usrmerge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
schemaVersion: "2.0.0"
fileExistenceTests:
- name: '/bin -> /usr/bin'
path: '/bin'
shouldExist: true
permissions: 'Lrwxrwxrwx'
uid: 0
gid: 0
- name: '/sbin -> /usr/sbin'
path: '/sbin'
shouldExist: true
permissions: 'Lrwxrwxrwx'
uid: 0
gid: 0
1 change: 1 addition & 0 deletions nodejs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ USER = [
config = [
"testdata/nodejs" + major_version + ".yaml",
"testdata/check_npm.yaml",
"testdata/usrmerge.yaml",
],
image = "nodejs" + major_version + ("" if (not mode) else mode) + "_" + user + "_" + arch + "_" + distro,
tags = [
Expand Down
14 changes: 14 additions & 0 deletions nodejs/testdata/usrmerge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
schemaVersion: "2.0.0"
fileExistenceTests:
- name: '/bin -> /usr/bin'
path: '/bin'
shouldExist: true
permissions: 'Lrwxrwxrwx'
uid: 0
gid: 0
- name: '/bin -> /usr/bin'
path: '/sbin'
shouldExist: true
permissions: 'Lrwxrwxrwx'
uid: 0
gid: 0
5 changes: 4 additions & 1 deletion python3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ DISTRO_VERSION = {
structure_test(
name = "python3_" + user + "_" + arch + "_" + distro + "_test",
size = "medium",
config = ["testdata/python3.yaml"],
config = [
"testdata/python3.yaml",
"testdata/usrmerge.yaml",
],
image = ":python3_" + user + "_" + arch + "_" + distro,
tags = [
"manual",
Expand Down
14 changes: 14 additions & 0 deletions python3/testdata/usrmerge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
schemaVersion: "2.0.0"
fileExistenceTests:
- name: '/bin -> /usr/bin'
path: '/bin'
shouldExist: true
permissions: 'Lrwxrwxrwx'
uid: 0
gid: 0
- name: '/sbin -> /usr/sbin'
path: '/sbin'
shouldExist: true
permissions: 'Lrwxrwxrwx'
uid: 0
gid: 0