One upgrade for nixos-router and the packages
Check, preview and apply look at the repository's release tags and the channel together; the new nixos-router is a highlighted row in the preview table. The update server section and the separate git update are gone; bundles stay. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
+5
-3
@@ -47,6 +47,8 @@ let
|
||||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/testing/test-instrumentation.nix") ];
|
||||
# No release repository: this test is about the packages (update.nix has one).
|
||||
routerUpdate.repository = null;
|
||||
routerSettings.upgrade = {
|
||||
channelsUrl = "http://192.168.10.50:8080";
|
||||
nixpkgsRef = "path:/var/lib/newer-nixpkgs?lastModified=${toString self.inputs.nixpkgs.lastModified}&rev=%rev%";
|
||||
@@ -352,7 +354,7 @@ pkgs.testers.runNixOSTest {
|
||||
rev = "0123456789abcdef0123456789abcdef01234567"
|
||||
channel(rev)
|
||||
out = target.succeed("router-upgrade check 2>&1")
|
||||
assert "a newer revision is available" in out, out
|
||||
assert "a newer version is available" in out, out
|
||||
assert json.loads(target.succeed("cat /var/lib/router/upgrade/check.json"))["upToDate"] is False
|
||||
channel(running_rev)
|
||||
out = target.succeed("router-upgrade check 2>&1")
|
||||
@@ -448,7 +450,7 @@ pkgs.testers.runNixOSTest {
|
||||
|
||||
assert curl(f"-o /dev/null -w '%{{redirect_url}}' {ui}/upgrade").endswith("/update#packages")
|
||||
page = curl(f"{ui}/update")
|
||||
assert "Packages" in page and "Router software" in page and 'value="26.05" selected' in page and target.succeed("cat /run/current-system/nixos-version").strip() in page, page
|
||||
assert "Check for upgrades" in page and "Install a bundle" in page and 'value="26.05" selected' in page and target.succeed("cat /run/current-system/nixos-version").strip() in page, page
|
||||
assert curl(f"-o /dev/null -w '%{{http_code}}' -d csrf={csrf('/update')} -d 'channel=nixos-26.05%3Bx' {ui}/upgrade/channel") == "303"
|
||||
assert "26.05" in target.succeed("jq -r .router.update.channel /var/lib/router/config/settings.json")
|
||||
assert curl(f"-o /dev/null -w '%{{http_code}}' -d csrf=wrong {ui}/upgrade/check") == "403"
|
||||
@@ -461,6 +463,6 @@ pkgs.testers.runNixOSTest {
|
||||
step("apply")
|
||||
assert "Upgrade to" not in curl(f"{ui}/update")
|
||||
assert json.loads(target.succeed("cat /var/lib/router/config/nixpkgs-pin.json"))["rev"] == running_rev
|
||||
assert "Last package run" in curl(f"{ui}/update")
|
||||
assert "Last upgrade run" in curl(f"{ui}/update")
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user