Created
March 28, 2018 15:19
-
-
Save TBK/74d3c956093e4fa62491a57bdcc78513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check() { | |
cd "$builddir" | |
# Setup user and cert | |
adduser -D sshuser | |
echo "sshuser:sshpassword" | chpasswd | |
mkdir -p ~sshuser/.ssh | |
chown sshuser:sshuser ~sshuser/.ssh | |
sh -c "cat $(pwd)/tests/testkey_rsa.pub >> ~sshuser/.ssh/authorized_keys" | |
chown sshuser:sshuser ~sshuser/.ssh/authorized_keys | |
chmod 600 ~sshuser/.ssh/authorized_keys | |
# Run dropbear | |
dropbear -r tests/testkey_rsa -P /tmp/php7-ssh2.pid | |
export "TEST_SSH2_HOSTNAME=localhost" | |
export "TEST_SSH2_USER=sshuser" | |
export "TEST_SSH2_PASS=sshpassword" | |
make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test | |
# Kill dropbear | |
pkill -F /tmp/php7-ssh2.pid | |
# Cleanup | |
rm -rf ~sshuser | |
deluser sshuser | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment