File tree Expand file tree Collapse file tree 5 files changed +78
-12
lines changed Expand file tree Collapse file tree 5 files changed +78
-12
lines changed Original file line number Diff line number Diff line change @@ -13,26 +13,22 @@ before_install:
13
13
- echo password=changed! >> $HOME/.splunkrc
14
14
# Set SPLUNK_HOME
15
15
- export SPLUNK_HOME="/opt/splunk"
16
- # Pull docker image
17
- - docker pull splunk/splunk-sdk-travis-ci:$SPLUNK_VERSION
18
16
# Add DOCKER to iptables, 1/10 times this is needed, force 0 exit status
19
17
- sudo iptables -N DOCKER || true
20
- # Start Docker container
21
- - docker run -p 127.0.0.1:8089:8089 -d splunk/splunk-sdk-travis-ci:$SPLUNK_VERSION
22
- # curl Splunk until it returns valid data indicating it has been setup, try 20 times maximum
23
- - for i in `seq 0 20`; do if curl --fail -k https://localhost:8089/services/server/info &> /dev/null; then break; fi; echo $i; sleep 1; done
24
-
18
+ # Start docker-compose in detached mode
19
+ - docker-compose up -d
20
+ # Health Check (3 minutes)
21
+ - for i in `seq 0 180`; do if docker exec -it splunk /sbin/checkstate.sh &> /dev/null; then break; fi; echo $i; sleep 1; done
25
22
26
23
language : node_js
27
24
node_js :
28
25
- " 10.0"
29
26
- " 4.2"
30
27
- " 0.12"
31
28
32
- # Splunk versions can be set here
33
29
env :
34
- - SPLUNK_VERSION=7.0-sdk
35
- - SPLUNK_VERSION=7.2-sdk
30
+ - SPLUNK_VERSION=7.3
31
+ - SPLUNK_VERSION=8.0
36
32
37
33
before_script :
38
34
node sdkdo hint
Original file line number Diff line number Diff line change
1
+ # text reset
2
+ NO_COLOR =\033[0m
3
+ # green
4
+ OK_COLOR =\033[32;01m
5
+ # red
6
+ ERROR_COLOR =\033[31;01m
7
+ # cyan
8
+ WARN_COLOR =\033[36;01m
9
+ # yellow
10
+ ATTN_COLOR =\033[33;01m
11
+
12
+ ROOT_DIR := $(shell git rev-parse --show-toplevel)
13
+
14
+ VERSION := ` git describe --tags --dirty 2> /dev/null `
15
+ COMMITHASH := ` git rev-parse --short HEAD 2> /dev/null `
16
+ DATE := ` date " +%FT%T%z" `
17
+
18
+ .PHONY : all
19
+ all : init test
20
+
21
+ init :
22
+ @echo " $( ATTN_COLOR) ==> init $( NO_COLOR) "
23
+
24
+ .PHONY : test
25
+ test :
26
+ @echo " $( ATTN_COLOR) ==> test $( NO_COLOR) "
27
+ @node sdkdo tests
28
+
29
+ .PHONY : test_specific
30
+ test_specific :
31
+ @echo " $( ATTN_COLOR) ==> test_specific $( NO_COLOR) "
32
+ @sh ./scripts/test_specific.sh
33
+
34
+ .PHONY : up
35
+ up :
36
+ @echo " $( ATTN_COLOR) ==> up $( NO_COLOR) "
37
+ @docker-compose up -d
38
+
39
+ .PHONY : wait_up
40
+ wait_up :
41
+ @echo " $( ATTN_COLOR) ==> wait_up $( NO_COLOR) "
42
+ @for i in ` seq 0 180` ; do if docker exec -it splunk /sbin/checkstate.sh & > /dev/null; then break ; fi ; printf " \rWaiting for Splunk for %s seconds..." $$ i; sleep 1; done
43
+
44
+ .PHONY : down
45
+ down :
46
+ @echo " $( ATTN_COLOR) ==> down $( NO_COLOR) "
47
+ @docker-compose stop
Original file line number Diff line number Diff line change
1
+ version : ' 3.6'
2
+
3
+ services :
4
+ splunk :
5
+ image : " splunk/splunk:${SPLUNK_VERSION}"
6
+ container_name : splunk
7
+ environment :
8
+ - SPLUNK_START_ARGS=--accept-license
9
+ - SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
10
+ - SPLUNK_PASSWORD=changed!
11
+ - SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.0.0/sdk-app-collection.tgz
12
+ ports :
13
+ - 8000:8000
14
+ - 8088:8088
15
+ - 8089:8089
16
+ healthcheck :
17
+ test : ['CMD', 'curl', '-f', 'http://localhost:8000']
18
+ interval : 5s
19
+ timeout : 5s
20
+ retries : 20
Original file line number Diff line number Diff line change
1
+ echo " To run a specific test:"
2
+ echo " node sdkdo tests [test1,test2]"
Original file line number Diff line number Diff line change @@ -154,7 +154,8 @@ module.exports = function (svc, loggedOutSvc) {
154
154
var versionParts = info . properties ( ) . version . split ( "." ) ;
155
155
156
156
var isDevBuild = versionParts . length === 1 ;
157
- var newerThan72 = ( parseInt ( versionParts [ 0 ] , 10 ) >= 7 && parseInt ( versionParts [ 1 ] , 10 ) >= 2 ) ;
157
+ var newerThan72 = ( parseInt ( versionParts [ 0 ] , 10 ) > 7 ||
158
+ ( parseInt ( versionParts [ 0 ] , 10 ) === 7 && parseInt ( versionParts [ 1 ] , 10 ) >= 2 ) ) ;
158
159
159
160
if ( isDevBuild || newerThan72 ) {
160
161
useOldPassword = true ;
@@ -243,4 +244,4 @@ module.exports = function (svc, loggedOutSvc) {
243
244
} ) ;
244
245
}
245
246
} ;
246
- } ;
247
+ } ;
You can’t perform that action at this time.
0 commit comments