mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
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:
1 file changed
+2
-1
@@ -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)
|
||||||
|
|||||||
Reference in new issue
Block a user