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"
|
||||
"os"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@ -978,8 +977,6 @@ func TestSSHWithTestcontainers(t *testing.T) {
|
||||
Image: "linuxserver/openssh-server:latest",
|
||||
ExposedPorts: []string{"2222/tcp"}, // Default port for this image is 2222
|
||||
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_PASSWORD": "testpass",
|
||||
"PASSWORD_ACCESS": "true", // Enable password authentication
|
||||
@ -1021,12 +1018,13 @@ func TestSSHWithTestcontainers(t *testing.T) {
|
||||
|
||||
plugin := Plugin{
|
||||
Config: Config{
|
||||
Host: []string{host},
|
||||
Username: "testuser", // Use the configured username
|
||||
Port: port.Int(), // Use the mapped port
|
||||
Password: "testpass", // Use the configured password
|
||||
Script: []string{"whoami"},
|
||||
CommandTimeout: 60 * time.Second,
|
||||
Host: []string{host},
|
||||
Username: "testuser", // Use the configured username
|
||||
Port: port.Int(), // Use the mapped port
|
||||
Password: "testpass", // Use the configured password
|
||||
Script: []string{"whoami"},
|
||||
CommandTimeout: 60 * time.Second,
|
||||
UseInsecureCipher: true, // Allow insecure ciphers for compatibility
|
||||
},
|
||||
Writer: &buffer,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user