test: give the integration SSH key a comment, since the title defaults to it

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-18 20:26:06 +02:00
1 parent fa14c6e7a4
commit 6224190bd9
1 file changed
+2 -1
+2 -1
View File
@@ -477,7 +477,8 @@ func TestGiteaMetadataLifecycle(t *testing.T) {
publicKey, err := ssh.NewPublicKey(privateKey.Public()) publicKey, err := ssh.NewPublicKey(privateKey.Public())
require.NoError(t, err) require.NoError(t, err)
keyFile := filepath.Join(t.TempDir(), "integration.pub") keyFile := filepath.Join(t.TempDir(), "integration.pub")
require.NoError(t, os.WriteFile(keyFile, ssh.MarshalAuthorizedKey(publicKey), 0o600)) // The title defaults to the key comment.
require.NoError(t, os.WriteFile(keyFile, append(bytes.TrimSpace(ssh.MarshalAuthorizedKey(publicKey)), " integration\n"...), 0o600))
var key services.SSHKey var key services.SSHKey
require.NoError(t, json.Unmarshal(execute("ssh-key", "create", keyFile, "--json"), &key)) require.NoError(t, json.Unmarshal(execute("ssh-key", "create", keyFile, "--json"), &key))
require.Positive(t, key.ID) require.Positive(t, key.ID)