diff --git a/examples/integration/_client.sh b/examples/integration/_client.sh index 98e7eef..1b383e2 100755 --- a/examples/integration/_client.sh +++ b/examples/integration/_client.sh @@ -5,10 +5,18 @@ cp /integration/client_test_rsa ~/.ssh/id_rsa chmod -R 700 ~/.ssh cat >~/.ssh/config < 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, ...) diff --git a/examples/integration/docker-compose.yml b/examples/integration/docker-compose.yml index a9b2349..b1aa614 100644 --- a/examples/integration/docker-compose.yml +++ b/examples/integration/docker-compose.yml @@ -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