Skip to content

Commit 5b32318

Browse files
committed
added test for image size increase
1 parent 0bf6275 commit 5b32318

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

Makefile

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -334,28 +334,28 @@ test_splunk_python3_all: test_splunk_centos7_python3 test_splunk_redhat8_python3
334334
test_uf_python3_all: test_uf_centos7_python3 test_uf_redhat8_python3 test_uf_debian9_python3 test_uf_debian10_python3
335335

336336
test_splunk_centos7_python3:
337-
$(call test_python3_installation, splunk-py23-centos-7)
337+
$(call test_python3_installation,splunk-py23-centos-7)
338338

339339
test_splunk_redhat8_python3:
340-
$(call test_python3_installation, splunk-py23-redhat-8)
340+
$(call test_python3_installation,splunk-py23-redhat-8)
341341

342342
test_splunk_debian9_python3:
343-
$(call test_python3_installation, splunk-py23-debian-9)
343+
$(call test_python3_installation,splunk-py23-debian-9)
344344

345345
test_splunk_debian10_python3:
346-
$(call test_python3_installation, splunk-py23-debian-10)
346+
$(call test_python3_installation,splunk-py23-debian-10)
347347

348348
test_uf_centos7_python3:
349-
$(call test_python3_installation, uf-py23-centos-7)
349+
$(call test_python3_installation,uf-py23-centos-7)
350350

351351
test_uf_redhat8_python3:
352-
$(call test_python3_installation, uf-py23-redhat-8)
352+
$(call test_python3_installation,uf-py23-redhat-8)
353353

354354
test_uf_debian9_python3:
355-
$(call test_python3_installation, uf-py23-debian-9)
355+
$(call test_python3_installation,uf-py23-debian-9)
356356

357357
test_uf_debian10_python3:
358-
$(call test_python3_installation, uf-py23-debian-10)
358+
$(call test_python3_installation,uf-py23-debian-10)
359359

360360
define test_python3_installation
361361
docker run -d --rm --name $1 -it $1 bash
@@ -370,28 +370,28 @@ test_splunk_python2_all: test_splunk_centos7_python2 test_splunk_redhat8_python2
370370
test_uf_python2_all: test_uf_centos7_python2 test_uf_redhat8_python2 test_uf_debian9_python2 test_uf_debian10_python2
371371

372372
test_splunk_centos7_python2:
373-
$(call test_python2_installation, splunk-py23-centos-7)
373+
$(call test_python2_installation,splunk-py23-centos-7)
374374

375375
test_splunk_redhat8_python2:
376-
$(call test_python2_installation, splunk-py23-redhat-8)
376+
$(call test_python2_installation,splunk-py23-redhat-8)
377377

378378
test_splunk_debian9_python2:
379-
$(call test_python2_installation, splunk-py23-debian-9)
379+
$(call test_python2_installation,splunk-py23-debian-9)
380380

381381
test_splunk_debian10_python2:
382-
$(call test_python2_installation, splunk-py23-debian-10)
382+
$(call test_python2_installation,splunk-py23-debian-10)
383383

384384
test_uf_centos7_python2:
385-
$(call test_python2_installation, uf-py23-centos-7)
385+
$(call test_python2_installation,uf-py23-centos-7)
386386

387387
test_uf_redhat8_python2:
388-
$(call test_python2_installation, uf-py23-redhat-8)
388+
$(call test_python2_installation,uf-py23-redhat-8)
389389

390390
test_uf_debian9_python2:
391-
$(call test_python2_installation, uf-py23-debian-9)
391+
$(call test_python2_installation,uf-py23-debian-9)
392392

393393
test_uf_debian10_python2:
394-
$(call test_python2_installation, uf-py23-debian-10)
394+
$(call test_python2_installation,uf-py23-debian-10)
395395

396396
#python2 version print to stderr, hence the 2>&1
397397
define test_python2_installation
@@ -400,6 +400,17 @@ docker exec -it $1 bash -c 'if [[ $$(python -V 2>&1) =~ "Python 2" ]] ; then ech
400400
docker kill $1
401401
endef
402402

403+
test_debian9_image_size:
404+
$(call test_image_size,splunk-debian-9)
405+
406+
define test_image_size
407+
docker pull splunk/splunk:edge
408+
CUR_SIZE=$$(docker image inspect $1:latest --format='{{.Size}}') ; \
409+
EDGE_SIZE=$$(docker image inspect splunk/splunk:edge --format='{{.Size}}') ; \
410+
echo "current $1 image size = "$$CUR_SIZE ; \
411+
echo "edge image size = "$$EDGE_SIZE ; \
412+
if [[ $$CUR_SIZE > $$EDGE_SIZE*1.01 ]] ; then echo "current image size is 10% more than edge image" ; exit 1 ; fi
413+
endef
403414

404415
setup_clair_scanner:
405416
mkdir clair-scanner-logs

0 commit comments

Comments
 (0)