From 21de660ae111fabd1b389130ff6650b90a7474ce Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 16 Nov 2026 13:48:07 +1100 Subject: [PATCH] test(system): the rotation fixture uses a listen address without an IP (#2026) --- internal/app/archie/config_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/app/archie/config_test.go b/internal/app/archie/config_test.go index ee2d57fd3..c8c2df344 100644 --- a/internal/app/archie/config_test.go +++ b/internal/app/archie/config_test.go @@ -13,7 +13,7 @@ func TestWriteAdminHashReplacesOnlyTheHash(t *testing.T) { const oldHash = "1111111111111111111111111111111111111111111111111111111111111111" const newHash = "2222222222222222222222222222222222222222222222222222222222222222" path := filepath.Join(t.TempDir(), "config.toml") - before := "listen = \"127.0.0.1:8080\"\nadmin_token_sha256 = \"" + oldHash + "\"\n" + before := "listen = \":8080\"\nadmin_token_sha256 = \"" + oldHash + "\"\n" if err := os.WriteFile(path, []byte(before), 0o600); err != nil { t.Fatal(err) } @@ -32,7 +32,7 @@ func TestWriteAdminHashReplacesOnlyTheHash(t *testing.T) { t.Fatal("the old hash is still in the config") case !strings.Contains(text, newHash): t.Fatal("the new hash was not written") - case !strings.Contains(text, `listen = "127.0.0.1:8080"`): + case !strings.Contains(text, `listen = ":8080"`): t.Fatal("rotation changed another setting") } info, err := os.Stat(path) //nolint:gosec // a test fixture in t.TempDir. @@ -49,7 +49,7 @@ func TestWriteAdminHashReplacesOnlyTheHash(t *testing.T) { func TestWriteAdminHashAddsAMissingLine(t *testing.T) { const hash = "3333333333333333333333333333333333333333333333333333333333333333" path := filepath.Join(t.TempDir(), "config.toml") - if err := os.WriteFile(path, []byte("listen = \"127.0.0.1:8080\"\n"), 0o600); err != nil { + if err := os.WriteFile(path, []byte("listen = \":8080\"\n"), 0o600); err != nil { t.Fatal(err) } if err := WriteAdminHash(path, hash); err != nil {