-
Notifications
You must be signed in to change notification settings - Fork 53
/
testbuilds.py
executable file
·2784 lines (2765 loc) · 127 KB
/
testbuilds.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#! /usr/bin/env python3
""" Testcases for zziplib build system """
__copyright__ = "(C) Guido Draheim, all rights reserved"""
__version__ = "0.13.78"
from typing import Union, Optional, Tuple, List, Iterator
import subprocess
import os.path
import time
import datetime
import unittest
import shutil
import inspect
import types
import logging
import re
from collections import namedtuple
from fnmatch import fnmatchcase as fnmatch
from glob import glob
import json
import sys
if sys.version[0] == '3':
basestring = str
xrange = range
DONE = (logging.ERROR + logging.WARNING) // 2
NOTE = (logging.INFO + logging.WARNING) // 2
logging.addLevelName(DONE, "DONE")
logging.addLevelName(NOTE, "NOTE")
logg = logging.getLogger("TESTING")
_python = "/usr/bin/python"
SAVETO = "localhost:5000/zziplib"
IMAGES = "localhost:5000/zziplib/image"
CENTOS9 = "almalinux:9.4"
CENTOS7 = "centos:7.9.2009"
UBUNTU1 = "ubuntu:18.04"
UBUNTU2 = "ubuntu:20.04"
UBUNTU3 = "ubuntu:22.04"
UBUNTU4 = "ubuntu:24.04"
OPENSUSE5 = "opensuse/leap:15.6"
SOFTWARE = "../Software"
DOCKER_SOCKET = "/var/run/docker.sock"
DOCKER = "docker"
KEEP = False
FORCE = False
NOCACHE = False
MAINDIR = os.path.dirname(sys.argv[0]) or "."
MIRROR = os.path.join(MAINDIR, "docker_mirror.py")
NONLOCAL = 0
LOCAL = 0
def decodes(text: Union[bytes, str]) -> str:
if text is None: return None
if isinstance(text, bytes):
encoded = sys.getdefaultencoding()
if encoded in ["ascii"]:
encoded = "utf-8"
try:
return text.decode(encoded)
except:
return text.decode("latin-1")
return text
def sh____(cmd: Union[str, List[str]], shell: bool = True) -> int:
if isinstance(cmd, basestring):
logg.info(": %s", cmd)
else:
logg.info(": %s", " ".join(["'%s'" % item for item in cmd]))
return subprocess.check_call(cmd, shell=shell)
def sx____(cmd: Union[str, List[str]], shell: bool = True) -> int:
if isinstance(cmd, basestring):
logg.info(": %s", cmd)
else:
logg.info(": %s", " ".join(["'%s'" % item for item in cmd]))
return subprocess.call(cmd, shell=shell)
def output(cmd: Union[str, List[str]], shell: bool = True) -> str:
if isinstance(cmd, basestring):
logg.info(": %s", cmd)
else:
logg.info(": %s", " ".join(["'%s'" % item for item in cmd]))
run = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE)
out, err = run.communicate()
return decodes(out)
def output2(cmd: Union[str, List[str]], shell: bool = True) -> Tuple[str, int]:
if isinstance(cmd, basestring):
logg.info(": %s", cmd)
else:
logg.info(": %s", " ".join(["'%s'" % item for item in cmd]))
run = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE)
out, err = run.communicate()
return decodes(out), run.returncode
def output3(cmd: Union[str, List[str]], shell: bool = True) -> Tuple[str, str, int]:
if isinstance(cmd, basestring):
logg.info(": %s", cmd)
else:
logg.info(": %s", " ".join(["'%s'" % item for item in cmd]))
run = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = run.communicate()
return decodes(out), decodes(err), run.returncode
BackgroundProcess = namedtuple("BackgroundProcess", ["pid", "run", "log"])
def background(cmd: List[str], shell: bool = True) -> BackgroundProcess:
log = open(os.devnull, "wb")
run = subprocess.Popen(cmd, shell=shell, stdout=log, stderr=log)
pid = run.pid
logg.info("PID %s = %s", pid, cmd)
return BackgroundProcess(pid, run, log)
def _lines(lines: Union[str, List[str]]) -> List[str]:
if isinstance(lines, basestring):
xlines = lines.split("\n")
if len(xlines) and xlines[-1] == "":
xlines = xlines[:-1]
return xlines
return lines
def lines(text: Union[str, List[str]]) -> List[str]:
lines = []
for line in _lines(text):
lines.append(line.rstrip())
return lines
def grep(pattern: str, lines: Union[str, List[str]]) -> Iterator[str]:
for line in _lines(lines):
if re.search(pattern, line.rstrip()):
yield line.rstrip()
def greps(lines: Union[str, List[str]], pattern: str) -> List[str]:
return list(grep(pattern, lines))
def download(base_url: str, filename: str, into: str) -> None:
if not os.path.isdir(into):
os.makedirs(into)
if not os.path.exists(os.path.join(into, filename)):
sh____("cd {into} && wget {base_url}/{filename}".format(**locals()))
def text_file(filename: str, content: str) -> None:
filedir = os.path.dirname(filename)
if not os.path.isdir(filedir):
os.makedirs(filedir)
f = open(filename, "w")
if content.startswith("\n"):
x = re.match("(?s)\n( *)", content)
assert x is not None
indent = x.group(1)
for line in content[1:].split("\n"):
if line.startswith(indent):
line = line[len(indent):]
f.write(line + "\n")
else:
f.write(content)
f.close()
def shell_file(filename: str, content: str) -> None:
text_file(filename, content)
os.chmod(filename, 0o770)
def copy_file(filename: str, target: str) -> None:
targetdir = os.path.dirname(target)
if not os.path.isdir(targetdir):
os.makedirs(targetdir)
shutil.copyfile(filename, target)
def copy_tool(filename: str, target: str) -> None:
copy_file(filename, target)
os.chmod(target, 0o750)
def get_caller_name() -> str:
frame = inspect.currentframe().f_back.f_back # type: ignore[union-attr]
return frame.f_code.co_name # type: ignore[union-attr]
def get_caller_caller_name() -> str:
frame = inspect.currentframe().f_back.f_back.f_back # type: ignore[union-attr]
return frame.f_code.co_name # type: ignore[union-attr]
def os_path(root: Optional[str], path: str) -> str:
if not root:
return path
if not path:
return path
while path.startswith(os.path.sep):
path = path[1:]
return os.path.join(root, path)
def docname(path: str) -> str:
return os.path.splitext(os.path.basename(path))[0]
def link_software(software: str, parts: str) -> None:
software = software or "Software"
shelf = SOFTWARE
for part in parts.split(","):
item = os.path.join(shelf, part)
if os.path.isdir(item):
for dirpath, dirnames, filenames in os.walk(item):
basepath = dirpath.replace(shelf + "/", "")
for filename in filenames:
intofile = os.path.join(software, basepath, filename)
fromfile = os.path.join(dirpath, filename)
intodir = os.path.dirname(intofile)
if not os.path.isdir(intodir):
os.makedirs(intodir)
if not os.path.isfile(intofile):
os.link(fromfile, intofile)
def unlink_software(software: str, parts: str) -> None:
software = software or "Software"
shelf = SOFTWARE
for part in parts.split(","):
item = os.path.join(shelf, part)
if os.path.isdir(item):
for dirpath, dirnames, filenames in os.walk(item):
basepath = dirpath.replace(shelf + "/", "")
for filename in filenames:
intofile = os.path.join(software, basepath, filename)
if os.path.isfile(intofile):
os.unlink(intofile)
class ZZiplibBuildTest(unittest.TestCase):
def caller_testname(self) -> str:
name = get_caller_caller_name()
x1 = name.find("_")
if x1 < 0: return name
x2 = name.find("_", x1 + 1)
if x2 < 0: return name
return name[:x2]
def testname(self, suffix: Optional[str] = None) -> str:
name = self.caller_testname()
if suffix:
return name + "_" + suffix
return name
def testdir(self, testname: Optional[str] = None) -> str:
testname = testname or self.caller_testname()
newdir = "tmp/tmp." + testname
if os.path.isdir(newdir):
shutil.rmtree(newdir)
os.makedirs(newdir)
return newdir
def rm_old(self, testname: Optional[str] = None) -> None:
testname = testname or self.caller_testname()
for subdir in ("docs/man3", "docs/html"):
if os.path.isdir(subdir):
logg.info("rm -rf %s", subdir)
shutil.rmtree(subdir)
for filename in ("tmp.local.tgz", "docs/htmpages.tar", "docs/manpages.tar", "docs/zziplib.xml", "docs/zzipmmapped.xml", "docs/zzipfseeko.xml"):
if os.path.isfile(filename):
logg.info("rm %s", filename)
os.remove(filename)
def rm_testdir(self, testname: Optional[str] = None) -> str:
testname = testname or self.caller_testname()
newdir = "tmp/tmp." + testname
if os.path.isdir(newdir):
shutil.rmtree(newdir)
return newdir
def makedirs(self, path: str) -> None:
if not os.path.isdir(path):
os.makedirs(path)
def user(self) -> str:
import getpass
return getpass.getuser()
def ip_container(self, name: str) -> str:
docker = DOCKER
cmd = "{docker} inspect {name}"
values = output(cmd.format(**locals()))
values = json.loads(values)
if not values or "NetworkSettings" not in values[0]:
logg.critical(" %s inspect %s => %s ", docker, name, values)
return values[0]["NetworkSettings"]["IPAddress"] # type: ignore[index]
def local_image(self, image: str) -> str:
""" attach local centos-repo / opensuse-repo to docker-start enviroment.
Effectivly when it is required to 'docker start centos:x.y' then do
'docker start centos-repo:x.y' before and extend the original to
'docker start --add-host mirror...:centos-repo centos:x.y'. """
if os.environ.get("NONLOCAL", ""):
return image
add_hosts = self.start_mirror(image)
if add_hosts:
return "{add_hosts} {image}".format(**locals())
return image
def local_addhosts(self, dockerfile: str, extras: Optional[str] = None) -> str:
image = ""
for line in open(dockerfile):
m = re.match('[Ff][Rr][Oo][Mm] *"([^"]*)"', line)
if m:
image = m.group(1)
break
m = re.match("[Ff][Rr][Oo][Mm] *(\w[^ ]*)", line)
if m:
image = m.group(1).strip()
break
logg.debug("--\n-- '%s' FROM '%s'", dockerfile, image)
if image:
return self.start_mirror(image, extras)
return ""
def start_mirror(self, image: str, extras: Optional[str] = None) -> str:
extras = extras or ""
docker = DOCKER
mirror = MIRROR
if NONLOCAL:
return ""
if LOCAL:
mirror += " --local"
cmd = "{mirror} start {image} --add-hosts {extras}"
out, rc = output2(cmd.format(**locals()))
if LOCAL and rc:
raise SystemError("--local docker-mirror-packages-repo not found")
return decodes(out).strip()
def nocache(self) -> str:
if FORCE or NOCACHE:
return " --no-cache"
return ""
def pull_baseimage(self, dockerfile: str, extras: Optional[str] = None) -> str:
image = ""
for line in open(dockerfile):
m = re.match('[Ff][Rr][Oo][Mm] *"([^"]*)"', line)
if m:
image = m.group(1)
break
m = re.match("[Ff][Rr][Oo][Mm] *(\w[^ ]*)", line)
if m:
image = m.group(1).strip()
break
logg.debug("--\n-- '%s' FROM '%s'", dockerfile, image)
if image:
return self.pull_image(image, extras)
return ""
def pull_image(self, image: str, extras: Optional[str] = None) -> str:
extras = extras or ""
docker = DOCKER
cmd = "{docker} pull {image}"
out, rc = output2(cmd.format(**locals()))
if rc:
logg.error("could not pull {image}".format(**locals()))
return decodes(out).strip()
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
def test_101_docker_mirror_ubuntu1(self) -> None:
logg.info("\n UBUNTU1 = '%s'", UBUNTU1)
self.start_mirror(UBUNTU1, "--update")
def test_102_docker_mirror_ubuntu2(self) -> None:
logg.info("\n UBUNTU2 = '%s'", UBUNTU2)
self.start_mirror(UBUNTU2, "--update")
def test_103_docker_mirror_ubuntu3(self) -> None:
logg.info("\n UBUNTU3 = '%s'", UBUNTU3)
if LOCAL:
self.start_mirror(UBUNTU3)
else:
self.start_mirror(UBUNTU3, "--universe")
def test_104_docker_mirror_ubuntu3(self) -> None:
logg.info("\n UBUNTU4 = '%s'", UBUNTU4)
self.start_mirror(UBUNTU4, "--universe")
def test_105_docker_mirror_opensuse5(self) -> None:
logg.info("\n OPENSUSE5 = '%s'", OPENSUSE5)
self.start_mirror(OPENSUSE5)
def test_107_docker_mirror_centos7(self) -> None:
logg.info("\n CENTOS7 = '%s'", CENTOS7)
self.start_mirror(CENTOS7, "--epel")
def test_109_docker_mirror_centos9(self) -> None:
logg.info("\n CENTOS9 = '%s'", CENTOS9)
self.start_mirror(CENTOS9)
def test_207_centos7_automake_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/centos7-am-build.dockerfile"
addhosts = self.local_addhosts(dockerfile, "--epel")
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 60"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} rpm -q --whatprovides /usr/lib64/pkgconfig/zlib.pc"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} pkg-config --libs zlib"
zlib = output(cmd.format(**locals()))
self.assertEqual(zlib.strip(), "-lz")
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_209_almalinux9_automake_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/almalinux9-am-build.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 60"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} rpm -q --whatprovides /usr/lib64/pkgconfig/zlib.pc"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} pkg-config --libs zlib"
zlib = output(cmd.format(**locals()))
self.assertEqual(zlib.strip(), "-lz")
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_217_centos7_cmake_build_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/centos7-cm-build.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 60"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} rpm -q --whatprovides /usr/lib64/pkgconfig/zlib.pc"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} pkg-config --libs zlib"
zlib = output(cmd.format(**locals()))
self.assertEqual(zlib.strip(), "-lz")
#
cmd = "{docker} exec {testname} cp -r /src/bins /external"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} sed -i -e '/find_pack/s/^# *//' -e /CodeCoverage/d -e /unzzip/d /external/CMakeLists.txt"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} mkdir -v /external/build"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && cmake3 ..'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && make VERBOSE=1'"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_219_almalinux9_cmake_build_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/almalinux9-cm-build.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 60"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} rpm -q --whatprovides /usr/lib64/pkgconfig/zlib.pc"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} pkg-config --libs zlib"
zlib = output(cmd.format(**locals()))
self.assertEqual(zlib.strip(), "-lz")
#
cmd = "{docker} exec {testname} cp -r /src/bins /external"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} sed -i -e '/find_pack/s/^# *//' -e /CodeCoverage/d -e /unzzip/d /external/CMakeLists.txt"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} mkdir -v /external/build"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && cmake3 ..'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && make VERBOSE=1'"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_222_ubuntu18_cmake_build_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/ubuntu18-cm-build.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 600"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} dpkg -S /usr/lib/x86_64-linux-gnu/pkgconfig/zlib.pc"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} pkg-config --libs zlib"
zlib = output(cmd.format(**locals()))
self.assertEqual(zlib.strip(), "-lz")
#
cmd = "{docker} exec {testname} cp -r /src/bins /external"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} sed -i -e '/find_pack/s/^# *//' -e /CodeCoverage/d -e /unzzip/d /external/CMakeLists.txt"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} mkdir -v /external/build"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && cmake ..'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && make VERBOSE=1'"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_223_ubuntu20_cmake_build_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/ubuntu20-cm-build.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 600"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} dpkg -S /usr/lib/x86_64-linux-gnu/pkgconfig/zlib.pc"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} pkg-config --libs zlib"
zlib = output(cmd.format(**locals()))
self.assertEqual(zlib.strip(), "-lz")
#
cmd = "{docker} exec {testname} cp -r /src/bins /external"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} sed -i -e '/find_pack/s/^# *//' -e /CodeCoverage/d -e /unzzip/d /external/CMakeLists.txt"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} mkdir -v /external/build"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && cmake ..'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && make VERBOSE=1'"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_224_ubuntu22_cmake_build_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/ubuntu22-cm-build.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 600"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} dpkg -S /usr/lib/x86_64-linux-gnu/pkgconfig/zlib.pc"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} pkg-config --libs zlib"
zlib = output(cmd.format(**locals()))
self.assertEqual(zlib.strip(), "-lz")
#
cmd = "{docker} exec {testname} cp -r /src/bins /external"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} sed -i -e '/find_pack/s/^# *//' -e /CodeCoverage/d -e /unzzip/d /external/CMakeLists.txt"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} mkdir -v /external/build"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && cmake ..'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && make VERBOSE=1'"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_225_ubuntu24_cmake_build_dockerfile(self) -> None:
# no universe yet (in February 2024)
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/ubuntu24-cm-build.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 600"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} dpkg -S /usr/lib/x86_64-linux-gnu/pkgconfig/zlib.pc"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} pkg-config --libs zlib"
zlib = output(cmd.format(**locals()))
self.assertEqual(zlib.strip(), "-lz")
#
cmd = "{docker} exec {testname} cp -r /src/bins /external"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} sed -i -e '/find_pack/s/^# *//' -e /CodeCoverage/d -e /unzzip/d /external/CMakeLists.txt"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} mkdir -v /external/build"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && cmake ..'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && make VERBOSE=1'"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_245_opensuse15_cmake_build_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/opensuse15-cm-build.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 60"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} rpm -q --whatprovides /usr/lib64/pkgconfig/zlib.pc"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} pkg-config --libs zlib"
zlib = output(cmd.format(**locals()))
self.assertEqual(zlib.strip(), "-lz")
#
cmd = "{docker} exec {testname} cp -r /src/bins /external"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} sed -i -e '/find_pack/s/^# *//' -e /CodeCoverage/d -e /unzzip/d /external/CMakeLists.txt"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} mkdir -v /external/build"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && cmake ..'"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'cd /external/build && make VERBOSE=1'"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_250_windows_static_x64_dockerfile(self) -> None:
logg.warning(" windows-static-x64 compiles fine but segfaults on linking an .exe")
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/windows-static-x64.dockerfile"
baseimage = self.pull_baseimage(dockerfile)
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --progress=plain --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 600"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
#
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_260_windows_shared_x64_dockerfile(self) -> None:
logg.warning(" windows-shared-x64 compiles fine but segfaults on linking an .exe")
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/windows-shared-x64.dockerfile"
baseimage = self.pull_baseimage(dockerfile)
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --progress=plain --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 600"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
#
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_307_centos7_automake_sdl2_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/centos7-am-sdl2.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 60"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_309_almalinux9_automake_sdl2_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/almalinux9-am-sdl2.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)
saveto = SAVETO
images = IMAGES
build = "build --build-arg=no_check=true" + self.nocache()
cmd = "{docker} {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"
sh____(cmd.format(**locals()))
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} run -d --name {testname} {images}:{testname} sleep 60"
sh____(cmd.format(**locals()))
#:# container = self.ip_container(testname)
cmd = "{docker} exec {testname} ls -l /usr/local/bin"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} find /usr/local/include -type f"
sh____(cmd.format(**locals()))
cmd = "{docker} exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"
sh____(cmd.format(**locals()))
#
cmd = "{docker} exec {testname} bash -c 'test -d /usr/local/include/SDL_rwops_zzip'"
sh____(cmd.format(**locals()))
#
if not KEEP:
cmd = "{docker} rm --force {testname}"
sx____(cmd.format(**locals()))
cmd = "{docker} rmi {saveto}/{savename}:latest"
sx____(cmd.format(**locals()))
cmd = "{docker} tag {images}:{testname} {saveto}/{savename}:latest"
sh____(cmd.format(**locals()))
cmd = "{docker} rmi {images}:{testname}"
sx____(cmd.format(**locals()))
self.rm_testdir()
def test_317_centos7_cmake_sdl2_dockerfile(self) -> None:
if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")
self.rm_old()
self.rm_testdir()
testname = self.testname()
testdir = self.testdir()
docker = DOCKER
dockerfile = "testbuilds/centos7-cm-sdl2.dockerfile"
addhosts = self.local_addhosts(dockerfile)
savename = docname(dockerfile)