Hardcode the repository releases come from
routerUpdate.repository (a module option beside the update keys, not a router.* setting) defaults to the project's repository; the Updates page names it but no longer has a field for it. Forks and tests set it in a module. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
+7
-3
@@ -125,6 +125,8 @@ let
|
||||
{
|
||||
imports = [ (modulesPath + "/testing/test-instrumentation.nix") ];
|
||||
router.rollback.timeout = "90s";
|
||||
# Releases from git: the builder's repository, not the real one.
|
||||
routerUpdate.repository = "http://${builderIp}:8005/router.git";
|
||||
routerSettings.upgrade = {
|
||||
channelsUrl = "http://192.168.10.60:8080";
|
||||
nixpkgsRef = "path:/var/lib/newer-nixpkgs?lastModified=${toString self.inputs.nixpkgs.lastModified}&rev=%rev%";
|
||||
@@ -390,13 +392,15 @@ pkgs.testers.runNixOSTest {
|
||||
builder.succeed("systemd-run --unit=git-server /etc/git-server.py /srv/git 8005")
|
||||
builder.wait_for_open_port(8005, "${builderIp}")
|
||||
|
||||
# Nothing to look at until a repository is named.
|
||||
assert "no repository" in target.succeed("router-update check 2>&1")
|
||||
# The repository is part of the installed version; the page names it and has no field for it.
|
||||
assert target.succeed("cat /etc/router-update-repository").strip() == repo
|
||||
login()
|
||||
token = csrf("/update")
|
||||
page = builder.succeed(f"curl -sk -b /tmp/jar {ui}/update")
|
||||
assert repo in page and 'name="repository"' not in page, page
|
||||
form = lambda path, data: builder.succeed(
|
||||
f"curl -sk -b /tmp/jar -o /tmp/out -w '%{{http_code}}' --data-urlencode csrf={token} {data} {ui}{path}").strip()
|
||||
assert form("/update/repository", f"--data-urlencode repository={repo}/") == "303"
|
||||
assert form("/update/repository", f"--data-urlencode repository={repo}") in ("404", "405")
|
||||
assert form("/update/gitcheck", "") == "303"
|
||||
target.wait_until_succeeds(
|
||||
"test $(systemctl show -p ActiveState --value router-update-check.service) = inactive"
|
||||
|
||||
Reference in New Issue
Block a user