Skip to content

Commit eb5a053

Browse files
committed
Added very simple test for embedded builds.
1 parent 28c14ef commit eb5a053

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ run:
4444
.PHONY: shell
4545
shell:
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
4853
tag:
4954
docker tag $(NAME):$(VERSION) $(NAME):latest

tests/logstash.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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

0 commit comments

Comments
 (0)