1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #!/bin/sh
-
- usage() {
- echo "Usage : $0 [OPTIONS]
- -h --help : display this help and exit
- -c --continue : continue after a failure
- -n --no-color : disable uses of tput to display colors
- -v --verbose : increase verbosity level"
- }
-
- verbose=0
- exit_on_fail=1
- color=1
-
- if OPTS=$(getopt -o vcnh --long verbose,continue,no-color,help: -n 'parse-options' -- "$@")
- then
- :
- else
- echo ""
- usage
- exit 1
- fi
-
- for o in $OPTS
- do
- case "$o"
- in
- -v | --verbose ) verbose=$(( verbose + 1 ));;
- -c | --continue ) exit_on_fail=0;;
- -n | --no-color ) color=0;;
- -h | --help ) usage; exit 0;;
- -- ) break;;
- *) echo "Unknown argument '$1'" >&2;
- usage
- exit 1;;
- esac
- done
-
- export color
- export verbose
- export exit_on_fail
- . ./check.sh
-
-
- # Initialize tests
- CHECK_START
-
- # Init testcase with title and description
- TC_INIT "Ping check" "Send ping to some hosts" # Needs ping
- TC_RUN check_ping gnu.org 2
- TC_RUN check_ping localhost
- TC_END
-
- TC_INIT "SSH" "Testing ssh server" # Needs netcat
- TC_RUN check_ssh_nc ssh.cluster007.ovh.net
- TC_RUN check_ssh_key ssh.cluster007.ovh.net 'AAAAB3NzaC1yc2EAAAADAQABAAACAQCvCBGdzkE/BJV+TcDGXJ+ypb5B035EjZhFOrsHi6RaY1wRuR2uhs/4QfDs4VcT/yWLD/W7ud5V+WNoWirpvq21MjYnu4Iykj7H1GRuAcUrqordUV8M8xrwzDbB1V9pbCTBQ37OZqnVVliF6va3GnNsbhqeF6BABEf3cdSk/ocQ8He0duU6w6cIXm8WsQU+KmKFdGhiTa4vxbc/78HYKStmo6wXXlVfjyVOqpIUk+RXpk5iDDYIb0mulGhP0Dx50ot8tVi21qdkE06+RXKbiUtiWoKyclJSD/dmp0Ku0MIVo2gDOj1pePuT7hGBYiXXHF0n8gKLZ1NGWO/xaOrz/GUx1wWPdQEAufsXwkBU3at3YPYbMEt4iesRMRXgx4jCBwdQgrcKOXKj1h5uSinwT5WodvsmUwqqeYhPMp2SeWHUKyDtNsrI/sd38uMfgK9AouIQcdlDzE9Toinp6++41jQYpuArGUzE88AG0A0j5BgRzz3RGXukxZJBtjYx4TJW/qUg95lHOPihyQBoMW/N5ZooHyr0ZuvXVK5JGyCIk6H04CsRDC9kCkAXD/mi1MjiKBdCShE4YwrNneixKGPC+LgkgyNwuQnrCxqlsaniMANuZ9vVx/vY935/oAi40DIuO+/WUyvs0i5l14EJUr/mOPA72CT/mRc5D4Q4GC1hjypHuw=='
- TC_END
-
- TC_INIT "HTTP/HTTPS" "Testing HTTP status & HTTPS cert" # Needs curl
- TC_RUN check_https_cert gnu.org
- TC_RUN check_http_200 http://www.gnu.org/home.html
- TC_RUN check_http_status http://www.gnu.org/sqdsqdk.foo 404
- TC_RUN check_http_status http://gnu.org/ 301
- TC_END
-
- TC_INIT "HTML" # Needs xsltproc
- TC_RUN check_html_title http://www.gnu.org/ "The GNU Operating System and the Free Software Movement"
- TC_END
-
- TC_INIT "Git" "Try to clone a git repo" # Needs git
- TC_RUN check_git_repo https://git.yannweb.net/yannweb/mhssh.git
- TC_END
-
- TC_INIT "Audio streaming" "Testing audio stream" # Needs mplayer
- TC_RUN check_audiostream http://zmpd.zered.net:8042/fip-metadata.mp3
- TC_RUN check_audiostream http://ice1.somafm.com/missioncontrol-128-mp3 256kb
- TC_END
-
- # Display results
- CHECK_REPORT
|