File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 4444.PHONY : shell
4545shell :
4646 docker run -t -i --rm $(NAME ) :$(VERSION ) /bin/bash
47+
48+ .PHONY : test
49+ test :
50+ /bin/bash tests/logstash.sh
51+
4752.PHONY : tag
4853tag :
4954 docker tag $(NAME ) :$(VERSION ) $(NAME ) :latest
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -eo pipefail
4+
5+ function print_pass()
6+ {
7+ echo " Pass: ${1} "
8+ }
9+
10+ function print_fail()
11+ {
12+ echo " Fail: ${1} "
13+ }
14+
15+ port_check=` netstat -an | grep ' :9292\|:9200' `
16+ port_status=$?
17+
18+ if [[ $port_status != 0 || $port_check = ' ' ]]; then
19+ print_fail port_check
20+ else
21+ print_pass port_check
22+ fi
23+
24+ process_check=` ps -ef | grep ' logstash' | grep -v grep`
25+ process_status=$?
26+
27+ if [[ $process_status != 0 || $process_check = ' ' ]]; then
28+ print_fail process_check
29+ else
30+ print_pass process_check
31+ fi
32+
33+ curl_check=` curl -s -S localhost:9200/_nodes? pretty=true`
34+ curl_status=$?
35+
36+ if [[ $curl_status != 0 || $curl_check = ' ' ]]; then
37+ print_fail curl_check
38+ else
39+ print_pass curl_check
40+ fi
You can’t perform that action at this time.
0 commit comments