fix(sandbox): set HOME inside bwrap
This commit is contained in:
@@ -37,6 +37,17 @@ class TestBwrapBackend:
|
||||
bind_idx = [i for i, t in enumerate(tokens) if t == "--bind"]
|
||||
assert any(tokens[i + 1] == ws and tokens[i + 2] == ws for i in bind_idx)
|
||||
|
||||
def test_home_env_points_to_workspace(self, tmp_path):
|
||||
ws = str(tmp_path / "project")
|
||||
result = wrap_command("bwrap", "echo $HOME", ws, ws)
|
||||
tokens = _parse(result)
|
||||
|
||||
setenv_idx = [i for i, t in enumerate(tokens) if t == "--setenv"]
|
||||
assert any(
|
||||
tokens[i + 1] == "HOME" and tokens[i + 2] == str(tmp_path / "project")
|
||||
for i in setenv_idx
|
||||
)
|
||||
|
||||
def test_parent_dir_masked_with_tmpfs(self, tmp_path):
|
||||
ws = tmp_path / "project"
|
||||
result = wrap_command("bwrap", "ls", str(ws), str(ws))
|
||||
|
||||
Reference in New Issue
Block a user