mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-05-09 18:23:21 +08:00
refactor: simplify test setup and improve SSH compatibility
- Remove unused import of strconv - Remove environment variables PUID and PGID from the test container setup - Enable UseInsecureCipher in SSH options for compatibility Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
parent
3fd8cd5cc0
commit
e899efd3c6
@ -7,7 +7,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -978,8 +977,6 @@ func TestSSHWithTestcontainers(t *testing.T) {
|
|||||||
Image: "linuxserver/openssh-server:latest",
|
Image: "linuxserver/openssh-server:latest",
|
||||||
ExposedPorts: []string{"2222/tcp"}, // Default port for this image is 2222
|
ExposedPorts: []string{"2222/tcp"}, // Default port for this image is 2222
|
||||||
Env: map[string]string{
|
Env: map[string]string{
|
||||||
"PUID": strconv.Itoa(os.Getuid()), // Use current user's UID
|
|
||||||
"PGID": strconv.Itoa(os.Getgid()), // Use current user's GID
|
|
||||||
"USER_NAME": "testuser",
|
"USER_NAME": "testuser",
|
||||||
"USER_PASSWORD": "testpass",
|
"USER_PASSWORD": "testpass",
|
||||||
"PASSWORD_ACCESS": "true", // Enable password authentication
|
"PASSWORD_ACCESS": "true", // Enable password authentication
|
||||||
@ -1027,6 +1024,7 @@ func TestSSHWithTestcontainers(t *testing.T) {
|
|||||||
Password: "testpass", // Use the configured password
|
Password: "testpass", // Use the configured password
|
||||||
Script: []string{"whoami"},
|
Script: []string{"whoami"},
|
||||||
CommandTimeout: 60 * time.Second,
|
CommandTimeout: 60 * time.Second,
|
||||||
|
UseInsecureCipher: true, // Allow insecure ciphers for compatibility
|
||||||
},
|
},
|
||||||
Writer: &buffer,
|
Writer: &buffer,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user