Files
lix/tests/functional2/cli/test_doctor.py
T
Raito Bezariusandrootile 782d967342 nix/doctor: check nixpkgs provenance
Many issues stems from `<nixpkgs>` not resolving anywhere or having the
wrong version, let's make it awfully obvious again here.

Towards #230.

Change-Id: If630e9616566e77143f028cdcfe0b7f00a1d486d
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-07-13 16:47:18 +02:00

40 lines
1.1 KiB
Python

from testlib.fixtures.nix import Nix
import pytest
pytestmark = pytest.mark.no_daemon
@pytest.mark.usefixtures("fake_nixpkgs")
def test_doctor_local_store(nix: Nix):
res = nix.nix(["doctor", "-v"]).run().ok()
out = res.stderr_plain
assert "[PASS] All profiles are gcroots." in out
assert "[PASS] Client protocol matches store protocol." in out
assert "You are trusted" in out
assert "[FAIL] Error: current generation cannot be discovered" in out
@pytest.mark.usefixtures("fake_nixpkgs")
def test_doctor_remote_store(nix: Nix):
res = (
nix.nix(
[
"--store",
f"ssh-ng://localhost?remote-store={nix.env.dirs.test_root}/other-store",
"doctor",
]
)
.run()
.ok()
)
assert "Running checks against store uri ssh-ng://localhost" in res.stderr_plain
@pytest.mark.usefixtures("fake_nixpkgs")
def test_doctor_nixpkgs(nix: Nix):
res = nix.nix(["doctor", "-v"], flake=True).run().ok()
out = res.stderr_plain
assert "[INFO] Nixpkgs provenance: nixpkgs=" in out