Test bastion in integration

This commit is contained in:
Manfred Touron 2018-01-02 11:24:27 +01:00
parent 5efe250466
commit 023cdd1bb3
2 changed files with 27 additions and 3 deletions

View file

@ -5,10 +5,18 @@ cp /integration/client_test_rsa ~/.ssh/id_rsa
chmod -R 700 ~/.ssh
cat >~/.ssh/config <<EOF
Host sshportal
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
Port 2222
HostName sshportal
Host testserver
Port 2222
HostName testserver
Host *
StrictHostKeyChecking no
ControlMaster auto
SendEnv TEST_*
EOF
set -x
@ -53,4 +61,11 @@ ssh sshportal -l admin config backup --indent --ignore-events > backup-2
)
# bastion
# TODO
ssh sshportal -l admin host create --name=testserver toto@testserver:2222
out="$(ssh sshportal -l testserver echo hello | head -n 1)"
test "$out" = '{"User":"toto","Environ":null,"Command":["echo","hello"]}'
out="$(TEST_A=1 TEST_B=2 TEST_C=3 TEST_D=4 TEST_E=5 TEST_F=6 TEST_G=7 TEST_H=8 TEST_I=9 ssh sshportal -l testserver echo hello | head -n 1)"
test "$out" = '{"User":"toto","Environ":["TEST_A=1","TEST_B=2","TEST_C=3","TEST_D=4","TEST_E=5","TEST_F=6","TEST_G=7","TEST_H=8","TEST_I=9"],"Command":["echo","hello"]}'
# TODO: test more cases (forwards, scp, sftp, interactive, pty, stdin, exit code, ...)

View file

@ -6,6 +6,14 @@ services:
environment:
- SSHPORTAL_DEFAULT_ADMIN_INVITE_TOKEN=integration
command: server --debug
depends_on:
- testserver
ports:
- 2222
testserver:
image: moul/sshportal
command: _test_server
ports:
- 2222
@ -13,6 +21,7 @@ services:
build: .
depends_on:
- sshportal
- testserver
#volumes:
# - .:/integration
tty: true