26 lines
784 B
Python
26 lines
784 B
Python
import pexpect
|
|
|
|
c = pexpect.spawn('ssh -q -o StrictHostKeyChecking=no root@210.16.161.214', encoding='utf-8', timeout=60)
|
|
c.expect('password:')
|
|
c.sendline('XHR521yhf')
|
|
c.expect('[$#]')
|
|
|
|
# Check what ports postgres is listening on inside container
|
|
c.sendline('docker logs velobase-harness-postgres-1 2>&1 | grep -i "listening\\|ready\\|port" | tail -5')
|
|
c.expect('[$#]')
|
|
print('=== PG LOGS ===')
|
|
print(c.before.strip()[-500:])
|
|
|
|
# Check if postgres is accessible from host via localhost:5433
|
|
c.sendline('ss -tlnp | grep 5433')
|
|
c.expect('[$#]')
|
|
print('=== PORT 5433 ===')
|
|
print(c.before.strip()[-300:])
|
|
|
|
# Check docker compose port mapping
|
|
c.sendline('docker port velobase-harness-postgres-1')
|
|
c.expect('[$#]')
|
|
print('=== PORT MAP ===')
|
|
print(c.before.strip()[-300:])
|
|
|
|
c.sendline('exit') |