mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-09-13 20:00:10 +08:00
refactor: refactor test environment setup and command markers
- Add environment markers to `TestCommandOutput` for localhost and 127.0.0.1 - Remove command markers from `TestFingerprint` Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
ce7d47c250
commit
366c76f84c
@ -365,6 +365,9 @@ func TestCommandOutput(t *testing.T) {
|
|||||||
whoami
|
whoami
|
||||||
uname
|
uname
|
||||||
localhost: ======END======
|
localhost: ======END======
|
||||||
|
localhost: ======ENV======
|
||||||
|
localhost:
|
||||||
|
localhost: ======END======
|
||||||
localhost: out: /home/drone-scp
|
localhost: out: /home/drone-scp
|
||||||
localhost: out: drone-scp
|
localhost: out: drone-scp
|
||||||
localhost: out: Linux
|
localhost: out: Linux
|
||||||
@ -373,6 +376,9 @@ func TestCommandOutput(t *testing.T) {
|
|||||||
whoami
|
whoami
|
||||||
uname
|
uname
|
||||||
127.0.0.1: ======END======
|
127.0.0.1: ======END======
|
||||||
|
127.0.0.1: ======ENV======
|
||||||
|
127.0.0.1:
|
||||||
|
127.0.0.1: ======END======
|
||||||
127.0.0.1: out: /home/drone-scp
|
127.0.0.1: out: /home/drone-scp
|
||||||
127.0.0.1: out: drone-scp
|
127.0.0.1: out: drone-scp
|
||||||
127.0.0.1: out: Linux
|
127.0.0.1: out: Linux
|
||||||
@ -444,9 +450,6 @@ func TestFingerprint(t *testing.T) {
|
|||||||
var (
|
var (
|
||||||
buffer bytes.Buffer
|
buffer bytes.Buffer
|
||||||
expected = `
|
expected = `
|
||||||
======CMD======
|
|
||||||
whoami
|
|
||||||
======END======
|
|
||||||
out: drone-scp
|
out: drone-scp
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user