Skip to content

Commit bbc5ffa

Browse files
authored
Merge pull request #1000 from SUSE/bind_links
Handle symlinks in tmpfiles creation
2 parents 1c1b1db + 7529322 commit bbc5ffa

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

tests/test_base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ def test_base_size(container: ContainerData, container_runtime):
138138
base_container_max_size["x86_64"] += 10
139139
elif OS_VERSION in ("tumbleweed",):
140140
base_container_max_size: Dict[str, int] = {
141-
"x86_64": 101,
142-
"aarch64": 117,
143-
"ppc64le": 128,
144-
"s390x": 93,
141+
"x86_64": 103,
142+
"aarch64": 119,
143+
"ppc64le": 130,
144+
"s390x": 95,
145145
}
146146
elif OS_VERSION in ("16.0", "16.1"):
147147
base_container_max_size: Dict[str, int] = {

tests/test_bind.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ def test_tmpfiles_d_created(container: ContainerData) -> None:
233233
tp, path, mode, owner, group, age, arg = line.split()
234234

235235
# sanity check, we don't handle these below at all
236-
assert age == "-" and arg == "-"
236+
assert age == "-"
237237

238238
# another sanity check because we don't test other tmpfiles.d constructs
239-
assert tp in ("d", "C")
239+
assert tp in ("d", "C", "L")
240240

241241
# directories
242242
if tp == "d":
@@ -253,3 +253,12 @@ def test_tmpfiles_d_created(container: ContainerData) -> None:
253253
assert file.exists
254254
assert file.is_file
255255
assert owner == "-" and group == "-" and mode == "-"
256+
257+
# linked files
258+
elif tp == "L":
259+
file = container.connection.file(path)
260+
assert file.exists
261+
assert file.is_symlink
262+
assert (Path(path).parent / arg).resolve() == Path(
263+
file.linked_to
264+
).resolve()

0 commit comments

Comments
 (0)