This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
test.sh
executable file
·34 lines (26 loc) · 1.64 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
set -euo pipefail
TEST_SSH_USER="root"
TEST_SSH_SERVER="192.168.1.10"
SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
test_commands=( "shellcheck ${SCRIPT_PATH}/ssh-*" )
test_commands+=( "${SCRIPT_PATH}/ssh-keyinfo ${SCRIPT_PATH}/examples/*/*" )
test_commands+=( "${SCRIPT_PATH}/ssh-certinfo ${SCRIPT_PATH}/examples/*/*" )
test_commands+=( "${SCRIPT_PATH}/ssh-certinfo -v ${SCRIPT_PATH}/examples/*/*" )
test_commands+=( "${SCRIPT_PATH}/ssh-certinfo -c ${SCRIPT_PATH}/examples/*/*" )
test_commands+=( "${SCRIPT_PATH}/ssh-certinfo -cv ${SCRIPT_PATH}/examples/*/*" )
test_commands+=( "${SCRIPT_PATH}/ssh-certinfo -c -w 20000 ${SCRIPT_PATH}/examples/*/*" )
test_commands+=( "${SCRIPT_PATH}/ssh-certinfo -cv -w 20000 ${SCRIPT_PATH}/examples/*/*" )
test_commands+=( "CHECK_REMOTE_FILE_EXISTS=NO sshpass -e ${SCRIPT_PATH}/ssh-diff /etc/hosts ${TEST_SSH_USER}@${TEST_SSH_SERVER}" )
test_commands+=( "sshpass -e ${SCRIPT_PATH}/ssh-facts ${TEST_SSH_USER}@${TEST_SSH_SERVER}" )
test_commands+=( "${SCRIPT_PATH}/ssh-hostkeys ${TEST_SSH_SERVER}" )
test_commands+=( "sshpass -e ${SCRIPT_PATH}/ssh-ping -4 -v -c 3 -D ${TEST_SSH_USER}@${TEST_SSH_SERVER}" )
test_commands+=( "sshpass -e ${SCRIPT_PATH}/ssh-ping -4 -v -c 3 -H ${TEST_SSH_USER}@${TEST_SSH_SERVER}" )
test_commands+=( "SSH_PING_NO_COLORS=true sshpass -e ${SCRIPT_PATH}/ssh-ping -4 -v -c 3 -H ${TEST_SSH_USER}@${TEST_SSH_SERVER}" )
test_commands+=( "${SCRIPT_PATH}/ssh-version ${TEST_SSH_SERVER}" )
for (( i = 0; i < ${#test_commands[@]} ; i++ )); do
printf "\n**** Running: ${test_commands[$i]} *****\n\n"
# Run each command in array
eval "${test_commands[$i]}"
done
printf "\n**** Finished *****\n\n"