Skip to content

Commit e3e399b

Browse files
committed
python default version check
1 parent 5188aad commit e3e399b

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
- run:
3737
name: Test Python3 installation
3838
command: make test_python3_all
39+
- run:
40+
name: Test Python2 as the default
41+
command: make test_python2_all
3942
- run:
4043
name: Running debian9 CI Tests
4144
command: make run_tests_debian9

Makefile

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,44 @@ docker run -d --rm --name $1 -it $1 bash
307307
docker exec -it $1 bash -c 'if [[ $$(python3 -V) =~ "Python 3" ]] ; then echo "$$(python3 -V) installed" ; else echo "No Python3 installation found" ; docker kill $1 ; exit 1 ; fi'
308308
docker kill $1
309309
endef
310-
310+
311+
test_python2_all: test_splunk_python2_all test_uf_python2_all
312+
313+
test_splunk_python2_all: test_splunk_centos7_python2 test_splunk_redhat8_python2 test_splunk_debian9_python2 test_splunk_debian10_python2
314+
315+
test_uf_python2_all: test_uf_centos7_python2 test_uf_redhat8_python2 test_uf_debian9_python2 test_uf_debian10_python2
316+
317+
test_splunk_centos7_python2:
318+
$(call test_python2_installation, splunk-centos-7)
319+
320+
test_splunk_redhat8_python2:
321+
$(call test_python2_installation, splunk-redhat-8)
322+
323+
test_splunk_debian9_python2:
324+
$(call test_python2_installation, splunk-debian-9)
325+
326+
test_splunk_debian10_python2:
327+
$(call test_python2_installation, splunk-debian-10)
328+
329+
test_uf_centos7_python2:
330+
$(call test_python2_installation, uf-centos-7)
331+
332+
test_uf_redhat8_python2:
333+
$(call test_python2_installation, uf-redhat-8)
334+
335+
test_uf_debian9_python2:
336+
$(call test_python2_installation, uf-debian-9)
337+
338+
test_uf_debian10_python2:
339+
$(call test_python2_installation, uf-debian-10)
340+
341+
#python2 version print to stderr, hence the 2>&1
342+
define test_python2_installation
343+
docker run -d --rm --name $1 -it $1 bash
344+
docker exec -it $1 bash -c 'if [[ $$(python -V 2>&1) =~ "Python 2" ]] ; then echo "$$(python -V 2>&1) is the default python" ; else echo "Python is not default to python2" ; docker kill $1 ; exit 1 ; fi'
345+
docker kill $1
346+
endef
347+
311348

312349
setup_clair_scanner:
313350
mkdir clair-scanner-logs

0 commit comments

Comments
 (0)