How to use locals method in Slash

Best Python code snippet using slash

testbuilds.py

Source:testbuilds.py Github

copy

Full Screen

...101def download(base_url, filename, into):102 if not os.path.isdir(into):103 os.makedirs(into)104 if not os.path.exists(os.path.join(into, filename)):105 sh____("cd {into} && wget {base_url}/{filename}".format(**locals()))106def text_file(filename, content):107 filedir = os.path.dirname(filename)108 if not os.path.isdir(filedir):109 os.makedirs(filedir)110 f = open(filename, "w")111 if content.startswith("\n"):112 x = re.match("(?s)\n( *)", content)113 indent = x.group(1)114 for line in content[1:].split("\n"):115 if line.startswith(indent):116 line = line[len(indent):]117 f.write(line+"\n")118 else:119 f.write(content)120 f.close()121def shell_file(filename, content):122 text_file(filename, content)123 os.chmod(filename, 0o770)124def copy_file(filename, target):125 targetdir = os.path.dirname(target)126 if not os.path.isdir(targetdir):127 os.makedirs(targetdir)128 shutil.copyfile(filename, target)129def copy_tool(filename, target):130 copy_file(filename, target)131 os.chmod(target, 0o750)132def get_caller_name():133 frame = inspect.currentframe().f_back.f_back134 return frame.f_code.co_name135def get_caller_caller_name():136 frame = inspect.currentframe().f_back.f_back.f_back137 return frame.f_code.co_name138def os_path(root, path):139 if not root:140 return path141 if not path:142 return path143 while path.startswith(os.path.sep):144 path = path[1:]145 return os.path.join(root, path)146def docname(path):147 return os.path.splitext(os.path.basename(path))[0]148class ZZiplibBuildTest(unittest.TestCase):149 def caller_testname(self):150 name = get_caller_caller_name()151 x1 = name.find("_")152 if x1 < 0: return name153 x2 = name.find("_", x1+1)154 if x2 < 0: return name155 return name[:x2]156 def testname(self, suffix = None):157 name = self.caller_testname()158 if suffix:159 return name + "_" + suffix160 return name161 def testdir(self, testname = None):162 testname = testname or self.caller_testname()163 newdir = "tmp/tmp."+testname164 if os.path.isdir(newdir):165 shutil.rmtree(newdir)166 os.makedirs(newdir)167 return newdir168 def rm_testdir(self, testname = None):169 testname = testname or self.caller_testname()170 newdir = "tmp/tmp."+testname171 if os.path.isdir(newdir):172 shutil.rmtree(newdir)173 return newdir174 def makedirs(self, path):175 if not os.path.isdir(path):176 os.makedirs(path)177 def user(self):178 import getpass179 getpass.getuser()180 def ip_container(self, name):181 values = output("docker inspect "+name)182 values = json.loads(values)183 if not values or "NetworkSettings" not in values[0]:184 logg.critical(" docker inspect %s => %s ", name, values)185 return values[0]["NetworkSettings"]["IPAddress"] 186 def local_system(self):187 distro, version = "", ""188 if os.path.exists("/etc/os-release"):189 # rhel:7.4 # VERSION="7.4 (Maipo)" ID="rhel" VERSION_ID="7.4"190 # centos:7.3 # VERSION="7 (Core)" ID="centos" VERSION_ID="7"191 # centos:7.4 # VERSION="7 (Core)" ID="centos" VERSION_ID="7"192 # centos:7.7.1908 # VERSION="7 (Core)" ID="centos" VERSION_ID="7"193 # opensuse:42.3 # VERSION="42.3" ID=opensuse VERSION_ID="42.3"194 # opensuse/leap:15.0 # VERSION="15.0" ID="opensuse-leap" VERSION_ID="15.0"195 # ubuntu:16.04 # VERSION="16.04.3 LTS (Xenial Xerus)" ID=ubuntu VERSION_ID="16.04"196 # ubuntu:18.04 # VERSION="18.04.1 LTS (Bionic Beaver)" ID=ubuntu VERSION_ID="18.04"197 for line in open("/etc/os-release"):198 key, value = "", ""199 m = re.match('^([_\\w]+)=([^"].*).*', line.strip())200 if m:201 key, value = m.group(1), m.group(2)202 m = re.match('^([_\\w]+)="([^"]*)".*', line.strip())203 if m:204 key, value = m.group(1), m.group(2)205 # logg.debug("%s => '%s' '%s'", line.strip(), key, value)206 if key in ["ID"]:207 distro = value.replace("-","/")208 if key in ["VERSION_ID"]:209 version = value210 if os.path.exists("/etc/redhat-release"):211 for line in open("/etc/redhat-release"):212 m = re.search("release (\\d+[.]\\d+).*", line)213 if m:214 distro = "rhel"215 version = m.group(1)216 if os.path.exists("/etc/centos-release"):217 # CentOS Linux release 7.5.1804 (Core)218 for line in open("/etc/centos-release"):219 m = re.search("release (\\d+[.]\\d+).*", line)220 if m:221 distro = "centos"222 version = m.group(1)223 logg.info(":: local_system %s:%s", distro, version)224 if distro and version:225 return "%s:%s" % (distro, version)226 return ""227 def with_local_ubuntu_mirror(self, ver = None):228 """ detects a local ubuntu mirror or starts a local229 docker container with a ubunut repo mirror. It230 will return the extra_hosts setting to start231 other docker containers"""232 rmi = "localhost:5000/mirror-packages"233 rep = "ubuntu-repo"234 ver = ver or UBUNTU.split(":")[1]235 universe = "ubuntu-repo/universe"236 ok = self.with_local(rmi, universe, ver, "archive.ubuntu.com", "security.ubuntu.com")237 if ok: return ok238 return self.with_local(rmi, rep, ver, "archive.ubuntu.com", "security.ubuntu.com")239 def with_local_centos_mirror(self, ver = None):240 """ detects a local centos mirror or starts a local241 docker container with a centos repo mirror. It242 will return the setting for extrahosts"""243 rmi = "localhost:5000/mirror-packages"244 rep = "centos-repo"245 ver = ver or CENTOS.split(":")[1]246 return self.with_local(rmi, rep, ver, "mirrorlist.centos.org")247 def with_local_opensuse_mirror(self, ver = None):248 """ detects a local opensuse mirror or starts a local249 docker container with a centos repo mirror. It250 will return the extra_hosts setting to start251 other docker containers"""252 rmi = "localhost:5000/mirror-packages"253 rep = "opensuse-repo"254 ver = ver or OPENSUSE.split(":")[1]255 return self.with_local(rmi, rep, ver, "download.opensuse.org")256 def with_local(self, rmi, rep, ver, *hosts):257 image = "{rmi}/{rep}:{ver}".format(**locals())258 container = "{rep}-{ver}".format(**locals()).replace("/","-")259 out, err, ok = output3("docker inspect {image}".format(**locals()))260 image_found = json.loads(out)261 if not image_found:262 return {}263 out, err, ok = output3("docker inspect {container}".format(**locals()))264 container_found = json.loads(out)265 if container_found:266 container_status = container_found[0]["State"]["Status"]267 logg.info("::: %s -> %s", container, container_status)268 latest_image_id = image_found[0]["Id"]269 container_image_id = container_found[0]["Image"]270 if latest_image_id != container_image_id or container_status not in ["running"]:271 cmd = "docker rm --force {container}"272 sx____(cmd.format(**locals()))273 container_found = []274 if not container_found:275 cmd = "docker run --rm=true --detach --name {container} {image}"276 sh____(cmd.format(**locals()))277 ip_a = self.ip_container(container)278 logg.info("::: %s => %s", container, ip_a)279 return dict(zip(hosts, [ ip_a ] * len(hosts)))280 def with_local_mirror(self, image):281 """ attach local centos-repo / opensuse-repo to docker-start enviroment.282 Effectivly when it is required to 'docker start centos:x.y' then do283 'docker start centos-repo:x.y' before and extend the original to 284 'docker start --add-host mirror...:centos-repo centos:x.y'. """285 hosts = {}286 if image.startswith("centos:"):287 version = image[len("centos:"):]288 hosts = self.with_local_centos_mirror(version)289 if image.startswith("opensuse/leap:"):290 version = image[len("opensuse/leap:"):]291 hosts = self.with_local_opensuse_mirror(version)292 if image.startswith("opensuse:"):293 version = image[len("opensuse:"):]294 hosts = self.with_local_opensuse_mirror(version)295 if image.startswith("ubuntu:"):296 version = image[len("ubuntu:"):]297 hosts = self.with_local_ubuntu_mirror(version)298 return hosts299 def add_hosts(self, hosts):300 return " ".join(["--add-host %s:%s" % (host, ip_a) for host, ip_a in hosts.items() ])301 # for host, ip_a in mapping.items():302 # yield "--add-host {host}:{ip_a}"303 def local_image(self, image):304 """ attach local centos-repo / opensuse-repo to docker-start enviroment.305 Effectivly when it is required to 'docker start centos:x.y' then do306 'docker start centos-repo:x.y' before and extend the original to 307 'docker start --add-host mirror...:centos-repo centos:x.y'. """308 if os.environ.get("NONLOCAL",""):309 return image310 hosts = self.with_local_mirror(image)311 if hosts:312 add_hosts = self.add_hosts(hosts)313 logg.debug("%s %s", add_hosts, image)314 return "{add_hosts} {image}".format(**locals())315 return image316 def local_addhosts(self, dockerfile):317 image = ""318 for line in open(dockerfile):319 m = re.match('[Ff][Rr][Oo][Mm] *"([^"]*)"', line)320 if m: 321 image = m.group(1)322 break323 m = re.match("[Ff][Rr][Oo][Mm] *(\w[^ ]*)", line)324 if m: 325 image = m.group(1).strip()326 break327 logg.debug("--\n-- '%s' FROM '%s'", dockerfile, image)328 if image:329 hosts = self.with_local_mirror(image)330 return self.add_hosts(hosts)331 return ""332 def drop_container(self, name):333 cmd = "docker rm --force {name}"334 sx____(cmd.format(**locals()))335 def drop_centos(self):336 self.drop_container("centos")337 def drop_ubuntu(self):338 self.drop_container("ubuntu")339 def drop_opensuse(self):340 self.drop_container("opensuse")341 def make_opensuse(self):342 self.make_container("opensuse", OPENSUSE)343 def make_ubuntu(self):344 self.make_container("ubuntu", UBUNTU)345 def make_centos(self):346 self.make_container("centos", CENTOS)347 def make_container(self, name, image):348 self.drop_container(name)349 local_image = self.local_image(image)350 cmd = "docker run --detach --name {name} {local_image} sleep 1000"351 sh____(cmd.format(**locals()))352 print(" # " + local_image)353 print(" docker exec -it "+name+" bash")354 #355 # # # # # # # # # # # # # # # # # # # # # # # # # # # # #356 #357 def test_100(self):358 logg.info("\n CENTOS = '%s'", CENTOS)359 self.with_local_centos_mirror()360 def test_201_centos7_automake_dockerfile(self):361 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")362 testname=self.testname()363 testdir = self.testdir()364 dockerfile="testbuilds/centos7-am-build.dockerfile"365 addhosts = self.local_addhosts(dockerfile)366 savename = docname(dockerfile)367 saveto = SAVETO368 images = IMAGES369 build = "build --build-arg=no_check=true"370 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"371 sh____(cmd.format(**locals()))372 cmd = "docker rm --force {testname}"373 sx____(cmd.format(**locals()))374 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"375 sh____(cmd.format(**locals()))376 #:# container = self.ip_container(testname)377 cmd = "docker exec {testname} ls -l /usr/local/bin"378 sh____(cmd.format(**locals()))379 cmd = "docker exec {testname} find /usr/local/include -type f"380 sh____(cmd.format(**locals()))381 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"382 sh____(cmd.format(**locals()))383 #384 cmd = "docker exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"385 sh____(cmd.format(**locals()))386 cmd = "docker exec {testname} rpm -q --whatprovides /usr/lib64/pkgconfig/zlib.pc"387 sh____(cmd.format(**locals()))388 cmd = "docker exec {testname} pkg-config --libs zlib"389 zlib = output(cmd.format(**locals()))390 self.assertEqual(zlib.strip(), "-lz")391 #392 cmd = "docker rm --force {testname}"393 sx____(cmd.format(**locals()))394 cmd = "docker rmi {saveto}/{savename}:latest"395 sx____(cmd.format(**locals()))396 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"397 sh____(cmd.format(**locals()))398 cmd = "docker rmi {images}:{testname}"399 sx____(cmd.format(**locals()))400 self.rm_testdir()401 def test_202_centos8_automake_dockerfile(self):402 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")403 testname=self.testname()404 testdir = self.testdir()405 dockerfile="testbuilds/centos8-am-build.dockerfile"406 addhosts = self.local_addhosts(dockerfile)407 savename = docname(dockerfile)408 saveto = SAVETO409 images = IMAGES410 build = "build --build-arg=no_check=true"411 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"412 sh____(cmd.format(**locals()))413 cmd = "docker rm --force {testname}"414 sx____(cmd.format(**locals()))415 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"416 sh____(cmd.format(**locals()))417 #:# container = self.ip_container(testname)418 cmd = "docker exec {testname} ls -l /usr/local/bin"419 sh____(cmd.format(**locals()))420 cmd = "docker exec {testname} find /usr/local/include -type f"421 sh____(cmd.format(**locals()))422 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"423 sh____(cmd.format(**locals()))424 #425 cmd = "docker exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"426 sh____(cmd.format(**locals()))427 cmd = "docker exec {testname} rpm -q --whatprovides /usr/lib64/pkgconfig/zlib.pc"428 sh____(cmd.format(**locals()))429 cmd = "docker exec {testname} pkg-config --libs zlib"430 zlib = output(cmd.format(**locals()))431 self.assertEqual(zlib.strip(), "-lz")432 #433 cmd = "docker rm --force {testname}"434 sx____(cmd.format(**locals()))435 cmd = "docker rmi {saveto}/{savename}:latest"436 sx____(cmd.format(**locals()))437 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"438 sh____(cmd.format(**locals()))439 cmd = "docker rmi {images}:{testname}"440 sx____(cmd.format(**locals()))441 self.rm_testdir()442 def test_211_centos7_build_dockerfile(self):443 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")444 testname=self.testname()445 testdir = self.testdir()446 dockerfile="testbuilds/centos7-build.dockerfile"447 addhosts = self.local_addhosts(dockerfile)448 savename = docname(dockerfile)449 saveto = SAVETO450 images = IMAGES451 build = "build --build-arg=no_check=true"452 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"453 sh____(cmd.format(**locals()))454 cmd = "docker rm --force {testname}"455 sx____(cmd.format(**locals()))456 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"457 sh____(cmd.format(**locals()))458 #:# container = self.ip_container(testname)459 cmd = "docker exec {testname} ls -l /usr/local/bin"460 sh____(cmd.format(**locals()))461 cmd = "docker exec {testname} find /usr/local/include -type f"462 sh____(cmd.format(**locals()))463 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"464 sh____(cmd.format(**locals()))465 #466 cmd = "docker exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"467 sh____(cmd.format(**locals()))468 cmd = "docker exec {testname} rpm -q --whatprovides /usr/lib64/pkgconfig/zlib.pc"469 sh____(cmd.format(**locals()))470 cmd = "docker exec {testname} pkg-config --libs zlib"471 zlib = output(cmd.format(**locals()))472 self.assertEqual(zlib.strip(), "-lz")473 #474 cmd = "docker rm --force {testname}"475 sx____(cmd.format(**locals()))476 cmd = "docker rmi {saveto}/{savename}:latest"477 sx____(cmd.format(**locals()))478 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"479 sh____(cmd.format(**locals()))480 cmd = "docker rmi {images}:{testname}"481 sx____(cmd.format(**locals()))482 self.rm_testdir()483 def test_212_centos8_build_dockerfile(self):484 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")485 testname=self.testname()486 testdir = self.testdir()487 dockerfile="testbuilds/centos8-build.dockerfile"488 addhosts = self.local_addhosts(dockerfile)489 savename = docname(dockerfile)490 saveto = SAVETO491 images = IMAGES492 build = "build --build-arg=no_check=true"493 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"494 sh____(cmd.format(**locals()))495 cmd = "docker rm --force {testname}"496 sx____(cmd.format(**locals()))497 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"498 sh____(cmd.format(**locals()))499 #:# container = self.ip_container(testname)500 cmd = "docker exec {testname} ls -l /usr/local/bin"501 sh____(cmd.format(**locals()))502 cmd = "docker exec {testname} find /usr/local/include -type f"503 sh____(cmd.format(**locals()))504 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"505 sh____(cmd.format(**locals()))506 #507 cmd = "docker exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"508 sh____(cmd.format(**locals()))509 cmd = "docker exec {testname} rpm -q --whatprovides /usr/lib64/pkgconfig/zlib.pc"510 sh____(cmd.format(**locals()))511 cmd = "docker exec {testname} pkg-config --libs zlib"512 zlib = output(cmd.format(**locals()))513 self.assertEqual(zlib.strip(), "-lz")514 #515 cmd = "docker rm --force {testname}"516 sx____(cmd.format(**locals()))517 cmd = "docker rmi {saveto}/{savename}:latest"518 sx____(cmd.format(**locals()))519 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"520 sh____(cmd.format(**locals()))521 cmd = "docker rmi {images}:{testname}"522 sx____(cmd.format(**locals()))523 self.rm_testdir()524 def test_221_ubuntu16_build_dockerfile(self):525 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")526 testname=self.testname()527 testdir = self.testdir()528 dockerfile="testbuilds/ubuntu16-build.dockerfile"529 addhosts = self.local_addhosts(dockerfile)530 savename = docname(dockerfile)531 saveto = SAVETO532 images = IMAGES533 build = "build --build-arg=no_check=true"534 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"535 sh____(cmd.format(**locals()))536 cmd = "docker rm --force {testname}"537 sx____(cmd.format(**locals()))538 cmd = "docker run -d --name {testname} {images}:{testname} sleep 600"539 sh____(cmd.format(**locals()))540 #:# container = self.ip_container(testname)541 cmd = "docker exec {testname} ls -l /usr/local/bin"542 sh____(cmd.format(**locals()))543 cmd = "docker exec {testname} find /usr/local/include -type f"544 sh____(cmd.format(**locals()))545 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib/libzz*'"546 sh____(cmd.format(**locals()))547 #548 cmd = "docker exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"549 sh____(cmd.format(**locals()))550 cmd = "docker exec {testname} dpkg -S /usr/lib/x86_64-linux-gnu/pkgconfig/zlib.pc"551 sh____(cmd.format(**locals()))552 cmd = "docker exec {testname} pkg-config --libs zlib"553 zlib = output(cmd.format(**locals()))554 self.assertEqual(zlib.strip(), "-lz")555 #556 cmd = "docker rm --force {testname}"557 sx____(cmd.format(**locals()))558 cmd = "docker rmi {saveto}/{savename}:latest"559 sx____(cmd.format(**locals()))560 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"561 sh____(cmd.format(**locals()))562 cmd = "docker rmi {images}:{testname}"563 sx____(cmd.format(**locals()))564 self.rm_testdir()565 def test_222_ubuntu18_build_dockerfile(self):566 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")567 testname=self.testname()568 testdir = self.testdir()569 dockerfile="testbuilds/ubuntu18-build.dockerfile"570 addhosts = self.local_addhosts(dockerfile)571 savename = docname(dockerfile)572 saveto = SAVETO573 images = IMAGES574 build = "build --build-arg=no_check=true"575 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"576 sh____(cmd.format(**locals()))577 cmd = "docker rm --force {testname}"578 sx____(cmd.format(**locals()))579 cmd = "docker run -d --name {testname} {images}:{testname} sleep 600"580 sh____(cmd.format(**locals()))581 #:# container = self.ip_container(testname)582 cmd = "docker exec {testname} ls -l /usr/local/bin"583 sh____(cmd.format(**locals()))584 cmd = "docker exec {testname} find /usr/local/include -type f"585 sh____(cmd.format(**locals()))586 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib/libzz*'"587 sh____(cmd.format(**locals()))588 #589 cmd = "docker exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"590 sh____(cmd.format(**locals()))591 cmd = "docker exec {testname} dpkg -S /usr/lib/x86_64-linux-gnu/pkgconfig/zlib.pc"592 sh____(cmd.format(**locals()))593 cmd = "docker exec {testname} pkg-config --libs zlib"594 zlib = output(cmd.format(**locals()))595 self.assertEqual(zlib.strip(), "-lz")596 #597 cmd = "docker rm --force {testname}"598 sx____(cmd.format(**locals()))599 cmd = "docker rmi {saveto}/{savename}:latest"600 sx____(cmd.format(**locals()))601 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"602 sh____(cmd.format(**locals()))603 cmd = "docker rmi {images}:{testname}"604 sx____(cmd.format(**locals()))605 self.rm_testdir()606 def test_225_ubuntu16_32bit_dockerfile(self):607 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")608 testname=self.testname()609 testdir = self.testdir()610 dockerfile="testbuilds/ubuntu16-32bit.dockerfile"611 addhosts = self.local_addhosts(dockerfile)612 savename = docname(dockerfile)613 saveto = SAVETO614 images = IMAGES615 build = "build --build-arg=no_check=true"616 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"617 sh____(cmd.format(**locals()))618 cmd = "docker rm --force {testname}"619 sx____(cmd.format(**locals()))620 cmd = "docker run -d --name {testname} {images}:{testname} sleep 600"621 sh____(cmd.format(**locals()))622 #:# container = self.ip_container(testname)623 cmd = "docker exec {testname} ls -l /usr/local/bin"624 sh____(cmd.format(**locals()))625 cmd = "docker exec {testname} find /usr/local/include -type f"626 sh____(cmd.format(**locals()))627 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib/libzz*'"628 sh____(cmd.format(**locals()))629 #630 cmd = "docker exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"631 sh____(cmd.format(**locals()))632 cmd = "docker exec {testname} dpkg -S /usr/lib/i386-linux-gnu/pkgconfig/zlib.pc"633 sh____(cmd.format(**locals()))634 cmd = "docker exec {testname} pkg-config --libs zlib"635 zlib = output(cmd.format(**locals()))636 self.assertEqual(zlib.strip(), "-lz")637 #638 cmd = "docker rm --force {testname}"639 sx____(cmd.format(**locals()))640 cmd = "docker rmi {saveto}/{savename}:latest"641 sx____(cmd.format(**locals()))642 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"643 sh____(cmd.format(**locals()))644 cmd = "docker rmi {images}:{testname}"645 sx____(cmd.format(**locals()))646 self.rm_testdir()647 def test_231_opensuse15_build_dockerfile(self):648 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")649 testname=self.testname()650 testdir = self.testdir()651 dockerfile="testbuilds/opensuse15-build.dockerfile"652 addhosts = self.local_addhosts(dockerfile)653 savename = docname(dockerfile)654 saveto = SAVETO655 images = IMAGES656 build = "build --build-arg=no_check=true"657 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"658 sh____(cmd.format(**locals()))659 cmd = "docker rm --force {testname}"660 sx____(cmd.format(**locals()))661 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"662 sh____(cmd.format(**locals()))663 #:# container = self.ip_container(testname)664 cmd = "docker exec {testname} ls -l /usr/local/bin"665 sh____(cmd.format(**locals()))666 cmd = "docker exec {testname} find /usr/local/include -type f"667 sh____(cmd.format(**locals()))668 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"669 sh____(cmd.format(**locals()))670 #671 cmd = "docker exec {testname} bash -c 'test ! -d /usr/local/include/SDL_rwops_zzip'"672 sh____(cmd.format(**locals()))673 cmd = "docker exec {testname} rpm -q --whatprovides /usr/lib64/pkgconfig/zlib.pc"674 sh____(cmd.format(**locals()))675 cmd = "docker exec {testname} pkg-config --libs zlib"676 zlib = output(cmd.format(**locals()))677 self.assertEqual(zlib.strip(), "-lz")678 #679 cmd = "docker rm --force {testname}"680 sx____(cmd.format(**locals()))681 cmd = "docker rmi {saveto}/{savename}:latest"682 sx____(cmd.format(**locals()))683 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"684 sh____(cmd.format(**locals()))685 cmd = "docker rmi {images}:{testname}"686 sx____(cmd.format(**locals()))687 self.rm_testdir()688 @unittest.expectedFailure689 def test_251_windows_static_x64_dockerfile(self):690 logg.warning(" windows-static-x64 compiles fine but segfaults on linking an .exe")691 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")692 testname=self.testname()693 testdir = self.testdir()694 dockerfile="testbuilds/windows-static-x64.dockerfile"695 addhosts = self.local_addhosts(dockerfile)696 savename = docname(dockerfile)697 saveto = SAVETO698 images = IMAGES699 build = "build --build-arg=no_check=true"700 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"701 sh____(cmd.format(**locals()))702 cmd = "docker rm --force {testname}"703 sx____(cmd.format(**locals()))704 cmd = "docker run -d --name {testname} {images}:{testname} sleep 600"705 sh____(cmd.format(**locals()))706 #:# container = self.ip_container(testname)707 #708 cmd = "docker exec {testname} ls -l /usr/local/bin"709 sh____(cmd.format(**locals()))710 #711 cmd = "docker rm --force {testname}"712 sx____(cmd.format(**locals()))713 cmd = "docker rmi {saveto}/{savename}:latest"714 sx____(cmd.format(**locals()))715 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"716 sh____(cmd.format(**locals()))717 cmd = "docker rmi {images}:{testname}"718 sx____(cmd.format(**locals()))719 self.rm_testdir()720 @unittest.expectedFailure721 def test_252_windows_shared_x64_dockerfile(self):722 logg.warning(" windows-shared-x64 compiles fine but segfaults on linking an .exe")723 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")724 testname=self.testname()725 testdir = self.testdir()726 dockerfile="testbuilds/windows-shared-x64.dockerfile"727 addhosts = self.local_addhosts(dockerfile)728 savename = docname(dockerfile)729 saveto = SAVETO730 images = IMAGES731 build = "build --build-arg=no_check=true"732 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"733 sh____(cmd.format(**locals()))734 cmd = "docker rm --force {testname}"735 sx____(cmd.format(**locals()))736 cmd = "docker run -d --name {testname} {images}:{testname} sleep 600"737 sh____(cmd.format(**locals()))738 #:# container = self.ip_container(testname)739 #740 cmd = "docker exec {testname} ls -l /usr/local/bin"741 sh____(cmd.format(**locals()))742 #743 cmd = "docker rm --force {testname}"744 sx____(cmd.format(**locals()))745 cmd = "docker rmi {saveto}/{savename}:latest"746 sx____(cmd.format(**locals()))747 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"748 sh____(cmd.format(**locals()))749 cmd = "docker rmi {images}:{testname}"750 sx____(cmd.format(**locals()))751 self.rm_testdir()752 def test_301_centos7_automake_sdl2_dockerfile(self):753 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")754 testname=self.testname()755 testdir = self.testdir()756 dockerfile="testbuilds/centos7-am-sdl2.dockerfile"757 addhosts = self.local_addhosts(dockerfile)758 savename = docname(dockerfile)759 saveto = SAVETO760 images = IMAGES761 build = "build --build-arg=no_check=true"762 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"763 sh____(cmd.format(**locals()))764 cmd = "docker rm --force {testname}"765 sx____(cmd.format(**locals()))766 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"767 sh____(cmd.format(**locals()))768 #:# container = self.ip_container(testname)769 cmd = "docker exec {testname} ls -l /usr/local/bin"770 sh____(cmd.format(**locals()))771 cmd = "docker exec {testname} find /usr/local/include -type f"772 sh____(cmd.format(**locals()))773 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"774 sh____(cmd.format(**locals()))775 #776 cmd = "docker exec {testname} bash -c 'test -d /usr/local/include/SDL_rwops_zzip'"777 sh____(cmd.format(**locals()))778 #779 cmd = "docker rm --force {testname}"780 sx____(cmd.format(**locals()))781 cmd = "docker rmi {saveto}/{savename}:latest"782 sx____(cmd.format(**locals()))783 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"784 sh____(cmd.format(**locals()))785 cmd = "docker rmi {images}:{testname}"786 sx____(cmd.format(**locals()))787 self.rm_testdir()788 def test_302_centos8_automake_sdl2_dockerfile(self):789 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")790 testname=self.testname()791 testdir = self.testdir()792 dockerfile="testbuilds/centos8-am-sdl2.dockerfile"793 addhosts = self.local_addhosts(dockerfile)794 savename = docname(dockerfile)795 saveto = SAVETO796 images = IMAGES797 build = "build --build-arg=no_check=true"798 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"799 sh____(cmd.format(**locals()))800 cmd = "docker rm --force {testname}"801 sx____(cmd.format(**locals()))802 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"803 sh____(cmd.format(**locals()))804 #:# container = self.ip_container(testname)805 cmd = "docker exec {testname} ls -l /usr/local/bin"806 sh____(cmd.format(**locals()))807 cmd = "docker exec {testname} find /usr/local/include -type f"808 sh____(cmd.format(**locals()))809 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"810 sh____(cmd.format(**locals()))811 #812 cmd = "docker exec {testname} bash -c 'test -d /usr/local/include/SDL_rwops_zzip'"813 sh____(cmd.format(**locals()))814 #815 cmd = "docker rm --force {testname}"816 sx____(cmd.format(**locals()))817 cmd = "docker rmi {saveto}/{savename}:latest"818 sx____(cmd.format(**locals()))819 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"820 sh____(cmd.format(**locals()))821 cmd = "docker rmi {images}:{testname}"822 sx____(cmd.format(**locals()))823 self.rm_testdir()824 def test_311_centos7_sdl2_dockerfile(self):825 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")826 testname=self.testname()827 testdir = self.testdir()828 dockerfile="testbuilds/centos7-sdl2.dockerfile"829 addhosts = self.local_addhosts(dockerfile)830 savename = docname(dockerfile)831 saveto = SAVETO832 images = IMAGES833 build = "build --build-arg=no_check=true"834 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"835 sh____(cmd.format(**locals()))836 cmd = "docker rm --force {testname}"837 sx____(cmd.format(**locals()))838 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"839 sh____(cmd.format(**locals()))840 #:# container = self.ip_container(testname)841 cmd = "docker exec {testname} ls -l /usr/local/bin"842 sh____(cmd.format(**locals()))843 cmd = "docker exec {testname} find /usr/local/include -type f"844 sh____(cmd.format(**locals()))845 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"846 sh____(cmd.format(**locals()))847 #848 cmd = "docker exec {testname} bash -c 'test -d /usr/local/include/SDL_rwops_zzip'"849 sh____(cmd.format(**locals()))850 #851 cmd = "docker rm --force {testname}"852 sx____(cmd.format(**locals()))853 cmd = "docker rmi {saveto}/{savename}:latest"854 sx____(cmd.format(**locals()))855 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"856 sh____(cmd.format(**locals()))857 cmd = "docker rmi {images}:{testname}"858 sx____(cmd.format(**locals()))859 self.rm_testdir()860 def test_312_centos8_sdl2_dockerfile(self):861 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")862 testname=self.testname()863 testdir = self.testdir()864 dockerfile="testbuilds/centos8-sdl2.dockerfile"865 addhosts = self.local_addhosts(dockerfile)866 savename = docname(dockerfile)867 saveto = SAVETO868 images = IMAGES869 build = "build --build-arg=no_check=true"870 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"871 sh____(cmd.format(**locals()))872 cmd = "docker rm --force {testname}"873 sx____(cmd.format(**locals()))874 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"875 sh____(cmd.format(**locals()))876 #:# container = self.ip_container(testname)877 cmd = "docker exec {testname} ls -l /usr/local/bin"878 sh____(cmd.format(**locals()))879 cmd = "docker exec {testname} find /usr/local/include -type f"880 sh____(cmd.format(**locals()))881 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"882 sh____(cmd.format(**locals()))883 #884 cmd = "docker exec {testname} bash -c 'test -d /usr/local/include/SDL_rwops_zzip'"885 sh____(cmd.format(**locals()))886 #887 cmd = "docker rm --force {testname}"888 sx____(cmd.format(**locals()))889 cmd = "docker rmi {saveto}/{savename}:latest"890 sx____(cmd.format(**locals()))891 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"892 sh____(cmd.format(**locals()))893 cmd = "docker rmi {images}:{testname}"894 sx____(cmd.format(**locals()))895 self.rm_testdir()896 def test_321_ubuntu18_sdl2_dockerfile(self):897 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")898 testname=self.testname()899 testdir = self.testdir()900 dockerfile="testbuilds/ubuntu16-sdl2.dockerfile"901 addhosts = self.local_addhosts(dockerfile)902 savename = docname(dockerfile)903 saveto = SAVETO904 images = IMAGES905 build = "build --build-arg=no_check=true"906 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"907 sh____(cmd.format(**locals()))908 cmd = "docker rm --force {testname}"909 sx____(cmd.format(**locals()))910 cmd = "docker run -d --name {testname} {images}:{testname} sleep 600"911 sh____(cmd.format(**locals()))912 #:# container = self.ip_container(testname)913 cmd = "docker exec {testname} ls -l /usr/local/bin"914 sh____(cmd.format(**locals()))915 cmd = "docker exec {testname} find /usr/local/include -type f"916 sh____(cmd.format(**locals()))917 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib/libzz*'"918 sh____(cmd.format(**locals()))919 #920 cmd = "docker exec {testname} bash -c 'test -d /usr/local/include/SDL_rwops_zzip'"921 sh____(cmd.format(**locals()))922 #923 cmd = "docker rm --force {testname}"924 sx____(cmd.format(**locals()))925 cmd = "docker rmi {saveto}/{savename}:latest"926 sx____(cmd.format(**locals()))927 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"928 sh____(cmd.format(**locals()))929 cmd = "docker rmi {images}:{testname}"930 sx____(cmd.format(**locals()))931 self.rm_testdir()932 def test_331_opensuse15_sdl2_dockerfile(self):933 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")934 testname=self.testname()935 testdir = self.testdir()936 dockerfile="testbuilds/opensuse15-sdl2.dockerfile"937 addhosts = self.local_addhosts(dockerfile)938 savename = docname(dockerfile)939 saveto = SAVETO940 images = IMAGES941 build = "build --build-arg=no_check=true"942 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"943 sh____(cmd.format(**locals()))944 cmd = "docker rm --force {testname}"945 sx____(cmd.format(**locals()))946 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"947 sh____(cmd.format(**locals()))948 #:# container = self.ip_container(testname)949 cmd = "docker exec {testname} ls -l /usr/local/bin"950 sh____(cmd.format(**locals()))951 cmd = "docker exec {testname} find /usr/local/include -type f"952 sh____(cmd.format(**locals()))953 cmd = "docker exec {testname} bash -c 'ls -l /usr/local/lib64/libzz*'"954 sh____(cmd.format(**locals()))955 #956 cmd = "docker exec {testname} bash -c 'test -d /usr/local/include/SDL_rwops_zzip'"957 sh____(cmd.format(**locals()))958 #959 cmd = "docker rm --force {testname}"960 sx____(cmd.format(**locals()))961 cmd = "docker rmi {saveto}/{savename}:latest"962 sx____(cmd.format(**locals()))963 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"964 sh____(cmd.format(**locals()))965 cmd = "docker rmi {images}:{testname}"966 sx____(cmd.format(**locals()))967 self.rm_testdir()968 def test_411_centos7_sdl2_destdir_dockerfile(self):969 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")970 testname=self.testname()971 testdir = self.testdir()972 dockerfile="testbuilds/centos7-destdir-sdl2.dockerfile"973 addhosts = self.local_addhosts(dockerfile)974 savename = docname(dockerfile)975 saveto = SAVETO976 images = IMAGES977 build = "build --build-arg=no_check=true"978 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"979 sh____(cmd.format(**locals()))980 cmd = "docker rm --force {testname}"981 sx____(cmd.format(**locals()))982 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"983 sh____(cmd.format(**locals()))984 #:# container = self.ip_container(testname)985 cmd = "docker exec {testname} ls -l /new/usr/local/bin"986 sh____(cmd.format(**locals()))987 cmd = "docker exec {testname} find /new/usr/local/include -type f"988 sh____(cmd.format(**locals()))989 cmd = "docker exec {testname} bash -c 'ls -l /new/usr/local/lib64/libzz*'"990 sh____(cmd.format(**locals()))991 #992 cmd = "docker exec {testname} bash -c 'test -d /new/usr/local/include/SDL_rwops_zzip'"993 sh____(cmd.format(**locals()))994 #995 cmd = "docker rm --force {testname}"996 sx____(cmd.format(**locals()))997 cmd = "docker rmi {saveto}/{savename}:latest"998 sx____(cmd.format(**locals()))999 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"1000 sh____(cmd.format(**locals()))1001 cmd = "docker rmi {images}:{testname}"1002 sx____(cmd.format(**locals()))1003 self.rm_testdir()1004 def test_412_centos8_sdl2_destdir_dockerfile(self):1005 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")1006 testname=self.testname()1007 testdir = self.testdir()1008 dockerfile="testbuilds/centos8-destdir-sdl2.dockerfile"1009 addhosts = self.local_addhosts(dockerfile)1010 savename = docname(dockerfile)1011 saveto = SAVETO1012 images = IMAGES1013 build = "build --build-arg=no_check=true"1014 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"1015 sh____(cmd.format(**locals()))1016 cmd = "docker rm --force {testname}"1017 sx____(cmd.format(**locals()))1018 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"1019 sh____(cmd.format(**locals()))1020 #:# container = self.ip_container(testname)1021 cmd = "docker exec {testname} ls -l /new/usr/local/bin"1022 sh____(cmd.format(**locals()))1023 cmd = "docker exec {testname} find /new/usr/local/include -type f"1024 sh____(cmd.format(**locals()))1025 cmd = "docker exec {testname} bash -c 'ls -l /new/usr/local/lib64/libzz*'"1026 sh____(cmd.format(**locals()))1027 #1028 cmd = "docker exec {testname} bash -c 'test -d /new/usr/local/include/SDL_rwops_zzip'"1029 sh____(cmd.format(**locals()))1030 #1031 cmd = "docker rm --force {testname}"1032 sx____(cmd.format(**locals()))1033 cmd = "docker rmi {saveto}/{savename}:latest"1034 sx____(cmd.format(**locals()))1035 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"1036 sh____(cmd.format(**locals()))1037 cmd = "docker rmi {images}:{testname}"1038 sx____(cmd.format(**locals()))1039 self.rm_testdir()1040 def test_421_ubuntu16_azure_dockerfile(self):1041 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")1042 testname=self.testname()1043 testdir = self.testdir()1044 dockerfile="testbuilds/ubuntu16-azure.dockerfile"1045 addhosts = self.local_addhosts(dockerfile)1046 savename = docname(dockerfile)1047 saveto = SAVETO1048 images = IMAGES1049 build = "build --build-arg=no_install=true"1050 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"1051 sh____(cmd.format(**locals()))1052 cmd = "docker rm --force {testname}"1053 sx____(cmd.format(**locals()))1054 cmd = "docker run -d --name {testname} {images}:{testname} sleep 600"1055 sh____(cmd.format(**locals()))1056 #:# container = self.ip_container(testname)1057 #1058 cmd = "docker exec {testname} find src -name *.xml"1059 sh____(cmd.format(**locals()))1060 #1061 cmd = "docker rm --force {testname}"1062 sx____(cmd.format(**locals()))1063 cmd = "docker rmi {saveto}/{savename}:latest"1064 sx____(cmd.format(**locals()))1065 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"1066 sh____(cmd.format(**locals()))1067 cmd = "docker rmi {images}:{testname}"1068 sx____(cmd.format(**locals()))1069 self.rm_testdir()1070 def test_701_centos7_am_docs_dockerfile(self):1071 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")1072 testname=self.testname()1073 testdir = self.testdir()1074 dockerfile="testbuilds/centos7-am-docs.dockerfile"1075 addhosts = self.local_addhosts(dockerfile)1076 savename = docname(dockerfile)1077 saveto = SAVETO1078 images = IMAGES1079 build = "build --build-arg=no_build=true"1080 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"1081 sh____(cmd.format(**locals()))1082 cmd = "docker rm --force {testname}"1083 sx____(cmd.format(**locals()))1084 cmd = "docker run -d --name {testname} {images}:{testname} sleep 60"1085 sh____(cmd.format(**locals()))1086 #:# container = self.ip_container(testname)1087 cmd = "docker exec {testname} ls -l /usr/local/bin"1088 sh____(cmd.format(**locals()))1089 cmd = "docker exec {testname} find /usr/local/include -type f"1090 sh____(cmd.format(**locals()))1091 #1092 cmd = "docker exec {testname} bash -c 'test ! -d /usr/local/include/zzip/types.h'"1093 sh____(cmd.format(**locals()))1094 cmd = "docker exec {testname} bash -c 'test -d /usr/local/share/doc/zziplib'"1095 sh____(cmd.format(**locals())) 1096 cmd = "docker exec {testname} bash -c 'test -f /usr/local/share/man/man3/zzip_opendir.3'"1097 sh____(cmd.format(**locals()))1098 #1099 cmd = "docker rm --force {testname}"1100 sx____(cmd.format(**locals()))1101 cmd = "docker rmi {saveto}/{savename}:latest"1102 sx____(cmd.format(**locals()))1103 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"1104 sh____(cmd.format(**locals()))1105 cmd = "docker rmi {images}:{testname}"1106 sx____(cmd.format(**locals()))1107 self.rm_testdir()1108 def test_711_centos7_docs_dockerfile(self):1109 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")1110 testname=self.testname()1111 testdir = self.testdir()1112 dockerfile="testbuilds/centos7-docs.dockerfile"1113 addhosts = self.local_addhosts(dockerfile)1114 savename = docname(dockerfile)1115 saveto = SAVETO1116 images = IMAGES1117 build = "build" # "build --build-arg=no_build=true"1118 cmd = "docker {build} . -f {dockerfile} {addhosts} --tag {images}:{testname}"1119 sh____(cmd.format(**locals()))1120 cmd = "docker rm --force {testname}"1121 sx____(cmd.format(**locals()))1122 cmd = "docker run -d --name {testname} {images}:{testname} sleep 600"1123 sh____(cmd.format(**locals()))1124 #:# container = self.ip_container(testname)1125 cmd = "docker exec {testname} ls -l /usr/local/bin"1126 sh____(cmd.format(**locals()))1127 cmd = "docker exec {testname} find /usr/local/include -type f"1128 sh____(cmd.format(**locals()))1129 #1130 cmd = "docker exec {testname} bash -c 'test ! -d /usr/local/include/zzip/types.h'"1131 sh____(cmd.format(**locals()))1132 cmd = "docker exec {testname} bash -c 'test -d /usr/local/share/doc/zziplib'"1133 sh____(cmd.format(**locals())) 1134 cmd = "docker exec {testname} bash -c 'test -f /usr/local/share/man/man3/zzip_opendir.3'"1135 sh____(cmd.format(**locals()))1136 #1137 cmd = "docker rm --force {testname}"1138 sx____(cmd.format(**locals()))1139 cmd = "docker rmi {saveto}/{savename}:latest"1140 sx____(cmd.format(**locals()))1141 cmd = "docker tag {images}:{testname} {saveto}/{savename}:latest"1142 sh____(cmd.format(**locals()))1143 cmd = "docker rmi {images}:{testname}"1144 sx____(cmd.format(**locals()))1145 self.rm_testdir()1146 def test_9211_centos7_automake_dockerfile(self):1147 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")1148 testname1=self.testname() + "_1"1149 testname2=self.testname() + "_2"1150 testdir = self.testdir()1151 dockerfile1="testbuilds/centos7-am-build.dockerfile"1152 dockerfile2="testbuilds/centos7-build.dockerfile"1153 addhosts = self.local_addhosts(dockerfile1)1154 savename1 = docname(dockerfile1)1155 savename2 = docname(dockerfile2)1156 saveto = SAVETO1157 images = IMAGES1158 cmd = "docker rm --force {testname1}"1159 sx____(cmd.format(**locals()))1160 cmd = "docker rm --force {testname2}"1161 sx____(cmd.format(**locals()))1162 cmd = "docker run -d --name {testname1} {addhosts} {saveto}/{savename1} sleep 600"1163 sh____(cmd.format(**locals()))1164 cmd = "docker run -d --name {testname2} {addhosts} {saveto}/{savename2} sleep 600"1165 #1166 sh____(cmd.format(**locals()))1167 cmd = "docker exec {testname2} bash -c 'cd /usr/local && tar czvf /local.tgz .'"1168 sh____(cmd.format(**locals()))1169 cmd = "docker cp {testname2}:/local.tgz tmp.local.tgz"1170 sh____(cmd.format(**locals()))1171 cmd = "docker cp tmp.local.tgz {testname1}:/local.tgz"1172 sh____(cmd.format(**locals()))1173 cmd = "rm tmp.local.tgz"1174 sh____(cmd.format(**locals()))1175 cmd = "docker exec {testname1} mkdir -p /new/local"1176 sh____(cmd.format(**locals()))1177 cmd = "docker exec {testname1} bash -c 'cd /new/local && tar xzvf /local.tgz'"1178 sh____(cmd.format(**locals()))1179 #1180 item="{}"1181 end="\\;"1182 A='"s:zzip-zlib-config:zlib:"'1183 B='"s:=/usr/local/:=\\${prefix}/:"'1184 C1='"/^exec_prefix=/d"'1185 C2='"/^datarootdir=/d"'1186 C3='"/^datadir=/d"'1187 C4='"/^sysconfdir=/d"'1188 C5='"/^bindir=/d"'1189 G='"/ generated by configure /d"'1190 cmd = "docker exec {testname1} bash -c 'find /usr/local -name *.pc -exec sed -i -e {A} -e {B} -e {C1} -e {C2} -e {C3} -e {C4} -e {C5} -e {G} {item} {end}'"1191 sh____(cmd.format(**locals()))1192 cmd = "docker exec {testname1} bash -c 'find /usr/local -name zzip-zlib-config.pc -exec rm -v {item} {end}'"1193 sh____(cmd.format(**locals()))1194 cmd = "docker exec {testname1} bash -c 'find /usr/local -name *.la -exec rm -v {item} {end}'"1195 sh____(cmd.format(**locals()))1196 cmd = "docker exec {testname1} bash -c 'find /new/local -name *-0.so -exec rm -v {item} {end}'"1197 sh____(cmd.format(**locals()))1198 cmd = "docker exec {testname1} diff -uw /usr/local/include/zzip/_config.h /new/local/include/zzip/_config.h"1199 sx____(cmd.format(**locals()))1200 cmd = "docker exec {testname1} diff -urw --no-dereference /usr/local /new/local --exclude _config.h"1201 sx____(cmd.format(**locals()))1202 out = output(cmd.format(**locals()))1203 self.assertFalse(greps(out, "---"))1204 self.assertFalse(greps(out, "Only"))1205 #1206 cmd = "docker rm --force {testname1}"1207 sx____(cmd.format(**locals()))1208 cmd = "docker rm --force {testname2}"1209 sx____(cmd.format(**locals()))1210 self.rm_testdir()1211 def test_9212_centos7_automake_dockerfile(self):1212 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")1213 testname1=self.testname() + "_1"1214 testname2=self.testname() + "_2"1215 testdir = self.testdir()1216 dockerfile1="testbuilds/centos8-am-build.dockerfile"1217 dockerfile2="testbuilds/centos8-build.dockerfile"1218 addhosts = self.local_addhosts(dockerfile1)1219 savename1 = docname(dockerfile1)1220 savename2 = docname(dockerfile2)1221 saveto = SAVETO1222 images = IMAGES1223 cmd = "docker rm --force {testname1}"1224 sx____(cmd.format(**locals()))1225 cmd = "docker rm --force {testname2}"1226 sx____(cmd.format(**locals()))1227 cmd = "docker run -d --name {testname1} {addhosts} {saveto}/{savename1} sleep 600"1228 sh____(cmd.format(**locals()))1229 cmd = "docker run -d --name {testname2} {addhosts} {saveto}/{savename2} sleep 600"1230 #1231 sh____(cmd.format(**locals()))1232 cmd = "docker exec {testname2} bash -c 'cd /usr/local && tar czvf /local.tgz .'"1233 sh____(cmd.format(**locals()))1234 cmd = "docker cp {testname2}:/local.tgz tmp.local.tgz"1235 sh____(cmd.format(**locals()))1236 cmd = "docker cp tmp.local.tgz {testname1}:/local.tgz"1237 sh____(cmd.format(**locals()))1238 cmd = "rm tmp.local.tgz"1239 sh____(cmd.format(**locals()))1240 cmd = "docker exec {testname1} mkdir -p /new/local"1241 sh____(cmd.format(**locals()))1242 cmd = "docker exec {testname1} bash -c 'cd /new/local && tar xzvf /local.tgz'"1243 sh____(cmd.format(**locals()))1244 #1245 item="{}"1246 end="\\;"1247 A='"s:zzip-zlib-config:zlib:"'1248 B='"s:=/usr/local/:=\\${prefix}/:"'1249 C1='"/^exec_prefix=/d"'1250 C2='"/^datarootdir=/d"'1251 C3='"/^datadir=/d"'1252 C4='"/^sysconfdir=/d"'1253 C5='"/^bindir=/d"'1254 G='"/ generated by configure /d"'1255 cmd = "docker exec {testname1} bash -c 'find /usr/local -name *.pc -exec sed -i -e {A} -e {B} -e {C1} -e {C2} -e {C3} -e {C4} -e {C5} -e {G} {item} {end}'"1256 sh____(cmd.format(**locals()))1257 cmd = "docker exec {testname1} bash -c 'find /usr/local -name zzip-zlib-config.pc -exec rm -v {item} {end}'"1258 sh____(cmd.format(**locals()))1259 cmd = "docker exec {testname1} bash -c 'find /usr/local -name *.la -exec rm -v {item} {end}'"1260 sh____(cmd.format(**locals()))1261 cmd = "docker exec {testname1} bash -c 'find /new/local -name *-0.so -exec rm -v {item} {end}'"1262 sh____(cmd.format(**locals()))1263 cmd = "docker exec {testname1} diff -uw /usr/local/include/zzip/_config.h /new/local/include/zzip/_config.h"1264 sx____(cmd.format(**locals()))1265 cmd = "docker exec {testname1} diff -urw --no-dereference /usr/local /new/local --exclude _config.h"1266 sx____(cmd.format(**locals()))1267 out = output(cmd.format(**locals()))1268 self.assertFalse(greps(out, "---"))1269 self.assertFalse(greps(out, "Only"))1270 #1271 cmd = "docker rm --force {testname1}"1272 sx____(cmd.format(**locals()))1273 cmd = "docker rm --force {testname2}"1274 sx____(cmd.format(**locals()))1275 self.rm_testdir()1276 def test_9311_centos7_automake_sdl2_dockerfile(self):1277 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")1278 testname1=self.testname() + "_1"1279 testname2=self.testname() + "_2"1280 testdir = self.testdir()1281 dockerfile1="testbuilds/centos7-am-sdl2.dockerfile"1282 dockerfile2="testbuilds/centos7-sdl2.dockerfile"1283 addhosts = self.local_addhosts(dockerfile1)1284 savename1 = docname(dockerfile1)1285 savename2 = docname(dockerfile2)1286 saveto = SAVETO1287 images = IMAGES1288 cmd = "docker rm --force {testname1}"1289 sx____(cmd.format(**locals()))1290 cmd = "docker rm --force {testname2}"1291 sx____(cmd.format(**locals()))1292 cmd = "docker run -d --name {testname1} {addhosts} {saveto}/{savename1} sleep 600"1293 sh____(cmd.format(**locals()))1294 cmd = "docker run -d --name {testname2} {addhosts} {saveto}/{savename2} sleep 600"1295 #1296 sh____(cmd.format(**locals()))1297 cmd = "docker exec {testname2} bash -c 'cd /usr/local && tar czvf /local.tgz .'"1298 sh____(cmd.format(**locals()))1299 cmd = "docker cp {testname2}:/local.tgz tmp.local.tgz"1300 sh____(cmd.format(**locals()))1301 cmd = "docker cp tmp.local.tgz {testname1}:/local.tgz"1302 sh____(cmd.format(**locals()))1303 cmd = "rm tmp.local.tgz"1304 sh____(cmd.format(**locals()))1305 cmd = "docker exec {testname1} mkdir -p /new/local"1306 sh____(cmd.format(**locals()))1307 cmd = "docker exec {testname1} bash -c 'cd /new/local && tar xzvf /local.tgz'"1308 sh____(cmd.format(**locals()))1309 #1310 item="{}"1311 end="\\;"1312 A='"s:zzip-zlib-config:zlib:"'1313 B='"s:=/usr/local/:=\\${prefix}/:"'1314 C1='"/^exec_prefix=/d"'1315 C2='"/^datarootdir=/d"'1316 C3='"/^datadir=/d"'1317 C4='"/^sysconfdir=/d"'1318 C5='"/^bindir=/d"'1319 G='"/ generated by configure /d"'1320 cmd = "docker exec {testname1} bash -c 'find /usr/local -name *.pc -exec sed -i -e {A} -e {B} -e {C1} -e {C2} -e {C3} -e {C4} -e {C5} -e {G} {item} {end}'"1321 sh____(cmd.format(**locals()))1322 cmd = "docker exec {testname1} bash -c 'find /usr/local -name zzip-zlib-config.pc -exec rm -v {item} {end}'"1323 sh____(cmd.format(**locals()))1324 cmd = "docker exec {testname1} bash -c 'find /usr/local -name *.la -exec rm -v {item} {end}'"1325 sh____(cmd.format(**locals()))1326 cmd = "docker exec {testname1} bash -c 'find /new/local -name *-0.so -exec rm -v {item} {end}'"1327 sh____(cmd.format(**locals()))1328 cmd = "docker exec {testname1} diff -uw /usr/local/include/zzip/_config.h /new/local/include/zzip/_config.h"1329 sx____(cmd.format(**locals()))1330 cmd = "docker exec {testname1} diff -urw --no-dereference /usr/local /new/local --exclude _config.h"1331 sx____(cmd.format(**locals()))1332 out = output(cmd.format(**locals()))1333 self.assertFalse(greps(out, "---"))1334 self.assertFalse(greps(out, "Only"))1335 #1336 cmd = "docker rm --force {testname1}"1337 sx____(cmd.format(**locals()))1338 cmd = "docker rm --force {testname2}"1339 sx____(cmd.format(**locals()))1340 self.rm_testdir()1341 def test_9312_centos7_automake_sdl2_dockerfile(self):1342 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")1343 testname1=self.testname() + "_1"1344 testname2=self.testname() + "_2"1345 testdir = self.testdir()1346 dockerfile1="testbuilds/centos8-am-sdl2.dockerfile"1347 dockerfile2="testbuilds/centos8-sdl2.dockerfile"1348 addhosts = self.local_addhosts(dockerfile1)1349 savename1 = docname(dockerfile1)1350 savename2 = docname(dockerfile2)1351 saveto = SAVETO1352 images = IMAGES1353 cmd = "docker rm --force {testname1}"1354 sx____(cmd.format(**locals()))1355 cmd = "docker rm --force {testname2}"1356 sx____(cmd.format(**locals()))1357 cmd = "docker run -d --name {testname1} {addhosts} {saveto}/{savename1} sleep 600"1358 sh____(cmd.format(**locals()))1359 cmd = "docker run -d --name {testname2} {addhosts} {saveto}/{savename2} sleep 600"1360 #1361 sh____(cmd.format(**locals()))1362 cmd = "docker exec {testname2} bash -c 'cd /usr/local && tar czvf /local.tgz .'"1363 sh____(cmd.format(**locals()))1364 cmd = "docker cp {testname2}:/local.tgz tmp.local.tgz"1365 sh____(cmd.format(**locals()))1366 cmd = "docker cp tmp.local.tgz {testname1}:/local.tgz"1367 sh____(cmd.format(**locals()))1368 cmd = "rm tmp.local.tgz"1369 sh____(cmd.format(**locals()))1370 cmd = "docker exec {testname1} mkdir -p /new/local"1371 sh____(cmd.format(**locals()))1372 cmd = "docker exec {testname1} bash -c 'cd /new/local && tar xzvf /local.tgz'"1373 sh____(cmd.format(**locals()))1374 #1375 item="{}"1376 end="\\;"1377 A='"s:zzip-zlib-config:zlib:"'1378 B='"s:=/usr/local/:=\\${prefix}/:"'1379 C1='"/^exec_prefix=/d"'1380 C2='"/^datarootdir=/d"'1381 C3='"/^datadir=/d"'1382 C4='"/^sysconfdir=/d"'1383 C5='"/^bindir=/d"'1384 G='"/ generated by configure /d"'1385 cmd = "docker exec {testname1} bash -c 'find /usr/local -name *.pc -exec sed -i -e {A} -e {B} -e {C1} -e {C2} -e {C3} -e {C4} -e {C5} -e {G} {item} {end}'"1386 sh____(cmd.format(**locals()))1387 cmd = "docker exec {testname1} bash -c 'find /usr/local -name zzip-zlib-config.pc -exec rm -v {item} {end}'"1388 sh____(cmd.format(**locals()))1389 cmd = "docker exec {testname1} bash -c 'find /usr/local -name *.la -exec rm -v {item} {end}'"1390 sh____(cmd.format(**locals()))1391 cmd = "docker exec {testname1} bash -c 'find /new/local -name *-0.so -exec rm -v {item} {end}'"1392 sh____(cmd.format(**locals()))1393 cmd = "docker exec {testname1} diff -uw /usr/local/include/zzip/_config.h /new/local/include/zzip/_config.h"1394 sx____(cmd.format(**locals()))1395 cmd = "docker exec {testname1} diff -urw --no-dereference /usr/local /new/local --exclude _config.h"1396 sx____(cmd.format(**locals()))1397 out = output(cmd.format(**locals()))1398 self.assertFalse(greps(out, "---"))1399 self.assertFalse(greps(out, "Only"))1400 #1401 cmd = "docker rm --force {testname1}"1402 sx____(cmd.format(**locals()))1403 cmd = "docker rm --force {testname2}"1404 sx____(cmd.format(**locals()))1405 self.rm_testdir()1406 def test_9411_centos7_automake_sdl2_dockerfile(self):1407 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")1408 testname1=self.testname() + "_1"1409 testname2=self.testname() + "_2"1410 testdir = self.testdir()1411 dockerfile1="testbuilds/centos7-sdl2.dockerfile"1412 dockerfile2="testbuilds/centos7-destdir-sdl2.dockerfile"1413 addhosts = self.local_addhosts(dockerfile1)1414 savename1 = docname(dockerfile1)1415 savename2 = docname(dockerfile2)1416 saveto = SAVETO1417 images = IMAGES1418 cmd = "docker rm --force {testname1}"1419 sx____(cmd.format(**locals()))1420 cmd = "docker rm --force {testname2}"1421 sx____(cmd.format(**locals()))1422 cmd = "docker run -d --name {testname1} {addhosts} {saveto}/{savename1} sleep 600"1423 sh____(cmd.format(**locals()))1424 cmd = "docker run -d --name {testname2} {addhosts} {saveto}/{savename2} sleep 600"1425 #1426 sh____(cmd.format(**locals()))1427 cmd = "docker exec {testname2} bash -c 'cd /new/usr/local && tar czvf /local.tgz .'"1428 sh____(cmd.format(**locals()))1429 cmd = "docker cp {testname2}:/local.tgz tmp.local.tgz"1430 sh____(cmd.format(**locals()))1431 cmd = "docker cp tmp.local.tgz {testname1}:/local.tgz"1432 sh____(cmd.format(**locals()))1433 cmd = "rm tmp.local.tgz"1434 sh____(cmd.format(**locals()))1435 cmd = "docker exec {testname1} mkdir -p /new/local"1436 sh____(cmd.format(**locals()))1437 cmd = "docker exec {testname1} bash -c 'cd /new/local && tar xzvf /local.tgz'"1438 sh____(cmd.format(**locals()))1439 #1440 DIRS="etc lib libexec sbin games src share/info share/applications share/man/mann"1441 for i in xrange(1,10):1442 DIRS+=" share/man/man%i share/man/man%ix" % (i,i)1443 cmd = "docker exec {testname1} bash -c 'cd /new/local && (for u in {DIRS}; do mkdir -pv $u; done)'"1444 sh____(cmd.format(**locals()))1445 item="{}"1446 end="\\;"1447 cmd = "docker exec {testname1} diff -urw --no-dereference /usr/local /new/local"1448 sx____(cmd.format(**locals()))1449 out = output(cmd.format(**locals()))1450 self.assertFalse(greps(out, "---"))1451 self.assertFalse(greps(out, "Only"))1452 #1453 cmd = "docker rm --force {testname1}"1454 sx____(cmd.format(**locals()))1455 cmd = "docker rm --force {testname2}"1456 sx____(cmd.format(**locals()))1457 self.rm_testdir()1458 def test_9412_centos7_automake_sdl2_dockerfile(self):1459 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")1460 testname1=self.testname() + "_1"1461 testname2=self.testname() + "_2"1462 testdir = self.testdir()1463 dockerfile1="testbuilds/centos8-sdl2.dockerfile"1464 dockerfile2="testbuilds/centos8-destdir-sdl2.dockerfile"1465 addhosts = self.local_addhosts(dockerfile1)1466 savename1 = docname(dockerfile1)1467 savename2 = docname(dockerfile2)1468 saveto = SAVETO1469 images = IMAGES1470 cmd = "docker rm --force {testname1}"1471 sx____(cmd.format(**locals()))1472 cmd = "docker rm --force {testname2}"1473 sx____(cmd.format(**locals()))1474 cmd = "docker run -d --name {testname1} {addhosts} {saveto}/{savename1} sleep 600"1475 sh____(cmd.format(**locals()))1476 cmd = "docker run -d --name {testname2} {addhosts} {saveto}/{savename2} sleep 600"1477 #1478 sh____(cmd.format(**locals()))1479 cmd = "docker exec {testname2} bash -c 'cd /new/usr/local && tar czvf /local.tgz .'"1480 sh____(cmd.format(**locals()))1481 cmd = "docker cp {testname2}:/local.tgz tmp.local.tgz"1482 sh____(cmd.format(**locals()))1483 cmd = "docker cp tmp.local.tgz {testname1}:/local.tgz"1484 sh____(cmd.format(**locals()))1485 cmd = "rm tmp.local.tgz"1486 sh____(cmd.format(**locals()))1487 cmd = "docker exec {testname1} mkdir -p /new/local"1488 sh____(cmd.format(**locals()))1489 cmd = "docker exec {testname1} bash -c 'cd /new/local && tar xzvf /local.tgz'"1490 sh____(cmd.format(**locals()))1491 #1492 DIRS="etc lib libexec sbin games src share/info share/applications share/man/mann"1493 for i in xrange(1,10):1494 DIRS+=" share/man/man%i share/man/man%ix" % (i,i)1495 cmd = "docker exec {testname1} bash -c 'cd /new/local && (for u in {DIRS}; do mkdir -pv $u; done)'"1496 sh____(cmd.format(**locals()))1497 item="{}"1498 end="\\;"1499 cmd = "docker exec {testname1} diff -urw --no-dereference /usr/local /new/local"1500 sx____(cmd.format(**locals()))1501 out = output(cmd.format(**locals()))1502 self.assertFalse(greps(out, "---"))1503 self.assertFalse(greps(out, "Only"))1504 #1505 cmd = "docker rm --force {testname1}"1506 sx____(cmd.format(**locals()))1507 cmd = "docker rm --force {testname2}"1508 sx____(cmd.format(**locals()))1509 self.rm_testdir()1510 def test_9711_centos7_docs_dockerfile(self):1511 if not os.path.exists(DOCKER_SOCKET): self.skipTest("docker-based test")1512 testname1=self.testname() + "_1"1513 testname2=self.testname() + "_2"1514 testdir = self.testdir()1515 dockerfile1="testbuilds/centos7-am-docs.dockerfile"1516 dockerfile2="testbuilds/centos7-docs.dockerfile"1517 addhosts = self.local_addhosts(dockerfile1)1518 savename1 = docname(dockerfile1)1519 savename2 = docname(dockerfile2)1520 saveto = SAVETO1521 images = IMAGES1522 cmd = "docker rm --force {testname1}"1523 sx____(cmd.format(**locals()))1524 cmd = "docker rm --force {testname2}"1525 sx____(cmd.format(**locals()))1526 cmd = "docker run -d --name {testname1} {addhosts} {saveto}/{savename1} sleep 600"1527 sh____(cmd.format(**locals()))1528 cmd = "docker run -d --name {testname2} {addhosts} {saveto}/{savename2} sleep 600"1529 #1530 sh____(cmd.format(**locals()))1531 cmd = "docker exec {testname2} bash -c 'cd /usr/local && tar czvf /local.tgz .'"1532 sh____(cmd.format(**locals()))1533 cmd = "docker cp {testname2}:/local.tgz tmp.local.tgz"1534 sh____(cmd.format(**locals()))1535 cmd = "docker cp tmp.local.tgz {testname1}:/local.tgz"1536 sh____(cmd.format(**locals()))1537 cmd = "rm tmp.local.tgz"1538 sh____(cmd.format(**locals()))1539 cmd = "docker exec {testname1} mkdir -p /new/local"1540 sh____(cmd.format(**locals()))1541 cmd = "docker exec {testname1} bash -c 'cd /new/local && tar xzvf /local.tgz'"1542 sh____(cmd.format(**locals()))1543 #1544 cmd = "docker exec {testname1} bash -c 'cd /usr/local/share/doc/zziplib && mv man/html .'"1545 sh____(cmd.format(**locals()))1546 cmd = "docker exec {testname1} bash -c 'cd /usr/local/share/doc/zziplib && rm -rf man'"1547 sh____(cmd.format(**locals()))1548 cmd = "docker exec {testname1} bash -c 'cd /usr/local/share/doc/zziplib && mv html man'"1549 sh____(cmd.format(**locals()))1550 item="{}"1551 end="\\;"1552 cmd = "docker exec {testname1} diff -urw --no-dereference --brief /usr/local /new/local"1553 sx____(cmd.format(**locals()))1554 out = output(cmd.format(**locals()))1555 self.assertFalse(greps(out, "---"))1556 self.assertFalse(greps(out, "Only"))1557 #1558 cmd = "docker exec {testname1} diff -urw --no-dereference /usr/local /new/local"1559 sx____(cmd.format(**locals()))1560 #1561 cmd = "docker rm --force {testname1}"1562 sx____(cmd.format(**locals()))1563 cmd = "docker rm --force {testname2}"1564 sx____(cmd.format(**locals()))1565 self.rm_testdir()1566if __name__ == "__main__":1567 from optparse import OptionParser1568 _o = OptionParser("%prog [options] test*",1569 epilog=__doc__.strip().split("\n")[0])1570 _o.add_option("-v","--verbose", action="count", default=0,1571 help="increase logging level [%default]")1572 _o.add_option("-p","--python", metavar="EXE", default=_python,1573 help="use another python execution engine [%default]")1574 _o.add_option("-l","--logfile", metavar="FILE", default="",1575 help="additionally save the output log to a file [%default]")1576 _o.add_option("--xmlresults", metavar="FILE", default=None,1577 help="capture results as a junit xml file [%default]")1578 opt, args = _o.parse_args()...

Full Screen

Full Screen

TrackingSourceConfig_Tier0_cff.py

Source:TrackingSourceConfig_Tier0_cff.py Github

copy

Full Screen

...9### following suggestion 2. in10### https://hypernews.cern.ch/HyperNews/CMS/get/sw-develtools/1908/1.html11for tracks in selectedTracks :12 label = 'TrackerCollisionSelectedTrackMonCommon' + str(tracks)13 locals()[label] = TrackerCollisionTrackMonCommon.clone()14 locals()[label].TrackProducer = cms.InputTag(tracks)15 locals()[label].allTrackProducer = cms.InputTag(allTrackProducer[tracks])16 locals()[label].FolderName = cms.string(mainfolderName[tracks])17 locals()[label].PVFolderName = cms.string(vertexfolderName[tracks])18 locals()[label].TrackPtMin = trackPtMin[tracks]19 locals()[label].TrackPtBin = trackPtN[tracks]20 locals()[label].TrackPtMax = trackPtMax[tracks]21 locals()[label].TrackPBin = trackPtN[tracks]22 locals()[label].TrackPMin = trackPtMin[tracks]23 locals()[label].TrackPMax = trackPtMax[tracks]24 locals()[label].doDCAPlots = doPlotsPCA[tracks]25 locals()[label].doDCAwrtPVPlots = doPlotsPCA[tracks]26 locals()[label].doDCAwrt000Plots = doPlotsPCA[tracks]27 locals()[label].doSIPPlots = doPlotsPCA[tracks]28 locals()[label].numCut = numCutString[tracks]29 locals()[label].denCut = denCutString[tracks]30 locals()[label].doGoodTracksPlots = doGoodTracksPlots [tracks]31 locals()[label].doTrackerSpecific = doTrackerSpecific [tracks]32 locals()[label].doHitPropertiesPlots = doHitPropertiesPlots [tracks]33 locals()[label].doGeneralPropertiesPlots = doGeneralPropertiesPlots [tracks]34 locals()[label].doBeamSpotPlots = doBeamSpotPlots [tracks]35 locals()[label].doSeedParameterHistos = doSeedParameterHistos [tracks]36 locals()[label].doRecHitVsPhiVsEtaPerTrack = doRecHitVsPhiVsEtaPerTrack [tracks]37 locals()[label].doRecHitVsPtVsEtaPerTrack = doRecHitVsPtVsEtaPerTrack [tracks]38 locals()[label].doGoodTrackRecHitVsPhiVsEtaPerTrack = doGoodTrackRecHitVsPhiVsEtaPerTrack [tracks]39 locals()[label].doLayersVsPhiVsEtaPerTrack = doLayersVsPhiVsEtaPerTrack [tracks]40 locals()[label].doGoodTrackLayersVsPhiVsEtaPerTrack = doGoodTrackLayersVsPhiVsEtaPerTrack [tracks]41 locals()[label].doPUmonitoring = doPUmonitoring [tracks]42 locals()[label].doPlotsVsBXlumi = doPlotsVsBXlumi [tracks]43 locals()[label].doPlotsVsGoodPVtx = doPlotsVsGoodPVtx [tracks]44 locals()[label].doEffFromHitPatternVsPU = doEffFromHitPatternVsPU [tracks]45 locals()[label].doEffFromHitPatternVsLUMI = doEffFromHitPatternVsLumi [tracks]46 if tracks == 'generalTracks':47 locals()[label].doEffFromHitPatternVsBX = False48 else:49 locals()[label].doEffFromHitPatternVsBX = doEffFromHitPatternVsBX[tracks]50# locals()[label].doStopSource = doStopSource [tracks] 51 locals()[label].setLabel(label)52 53 # ZeroBias54 label = 'TrackerCollisionSelectedTrackMonMB' + str(tracks) 55 locals()[label] = TrackerCollisionTrackMonMB.clone()56 locals()[label].TrackProducer = cms.InputTag(tracks)57 locals()[label].FolderName = cms.string(mainfolderName[tracks])58 locals()[label].PVFolderName = cms.string(vertexfolderName[tracks])59 locals()[label].TrackPtMin = trackPtMin[tracks]60 locals()[label].TrackPtBin = trackPtN[tracks]61 locals()[label].TrackPtMax = trackPtMax[tracks]62 locals()[label].TrackPBin = trackPtN[tracks]63 locals()[label].TrackPMin = trackPtMin[tracks]64 locals()[label].TrackPMax = trackPtMax[tracks]65 locals()[label].doDCAPlots = doPlotsPCA[tracks]66 locals()[label].doDCAwrtPVPlots = doPlotsPCA[tracks]67 locals()[label].doDCAwrt000Plots = doPlotsPCA[tracks]68 locals()[label].doSIPPlots = doPlotsPCA[tracks]69 locals()[label].numCut = numCutString[tracks]70 locals()[label].denCut = denCutString[tracks]71 locals()[label].doGoodTracksPlots = doGoodTracksPlots [tracks]72 locals()[label].doTrackerSpecific = doTrackerSpecific [tracks]73 locals()[label].doHitPropertiesPlots = doHitPropertiesPlots [tracks]74 locals()[label].doGeneralPropertiesPlots = doGeneralPropertiesPlots [tracks]75 locals()[label].doBeamSpotPlots = doBeamSpotPlots [tracks]76 locals()[label].doSeedParameterHistos = doSeedParameterHistos [tracks]77 locals()[label].doRecHitVsPhiVsEtaPerTrack = doRecHitVsPhiVsEtaPerTrack [tracks]78 locals()[label].doRecHitVsPtVsEtaPerTrack = doRecHitVsPtVsEtaPerTrack [tracks]79 locals()[label].doGoodTrackRecHitVsPhiVsEtaPerTrack = doGoodTrackRecHitVsPhiVsEtaPerTrack [tracks]80 locals()[label].doLayersVsPhiVsEtaPerTrack = doLayersVsPhiVsEtaPerTrack [tracks]81 locals()[label].doGoodTrackLayersVsPhiVsEtaPerTrack = doGoodTrackLayersVsPhiVsEtaPerTrack [tracks]82 locals()[label].doPUmonitoring = doPUmonitoring [tracks]83 locals()[label].doPlotsVsBXlumi = doPlotsVsBXlumi [tracks]84 locals()[label].doPlotsVsGoodPVtx = doPlotsVsGoodPVtx [tracks]85 locals()[label].doPlotsVsLUMI = cms.bool(True)86 locals()[label].doPlotsVsBX = cms.bool(True)87 locals()[label].doEffFromHitPatternVsPU = doEffFromHitPatternVsPU [tracks]88 locals()[label].doEffFromHitPatternVsBX = doEffFromHitPatternVsBX [tracks]89 locals()[label].doEffFromHitPatternVsLUMI = cms.bool(True)90 locals()[label].doStopSource = doStopSource [tracks] 91 locals()[label].setLabel(label)92 # ZeroBias, no hip, no OOT pu (1st collision after abort gap) ###93 label = 'TrackerCollisionSelectedTrackMonZBnoHIPnoOOT' + str(tracks) 94 locals()[label] = TrackerCollisionTrackMonZBnoHIPnoOOT.clone()95 locals()[label].TrackProducer = cms.InputTag(tracks)96 locals()[label].FolderName = cms.string(mainfolderName[tracks]+"/noHIP_noOOT_INpu")97 locals()[label].PVFolderName = cms.string(vertexfolderName[tracks]+"/noHIP_noOOT_INpu")98 locals()[label].TrackPtMin = trackPtMin[tracks]99 locals()[label].TrackPtBin = trackPtN[tracks]100 locals()[label].TrackPtMax = trackPtMax[tracks]101 locals()[label].TrackPBin = trackPtN[tracks]102 locals()[label].TrackPMin = trackPtMin[tracks]103 locals()[label].TrackPMax = trackPtMax[tracks]104 locals()[label].doDCAPlots = doPlotsPCA[tracks]105 locals()[label].doDCAwrtPVPlots = doPlotsPCA[tracks]106 locals()[label].doDCAwrt000Plots = doPlotsPCA[tracks]107 locals()[label].doSIPPlots = doPlotsPCA[tracks]108 locals()[label].numCut = numCutString[tracks]109 locals()[label].denCut = denCutString[tracks]110 locals()[label].doGoodTracksPlots = doGoodTracksPlots [tracks]111 locals()[label].doTrackerSpecific = doTrackerSpecific [tracks]112 locals()[label].doHitPropertiesPlots = doHitPropertiesPlots [tracks]113 locals()[label].doGeneralPropertiesPlots = doGeneralPropertiesPlots [tracks]114 locals()[label].doBeamSpotPlots = doBeamSpotPlots [tracks]115 locals()[label].doSeedParameterHistos = doSeedParameterHistos [tracks]116 locals()[label].doRecHitVsPhiVsEtaPerTrack = doRecHitVsPhiVsEtaPerTrack [tracks]117 locals()[label].doRecHitVsPtVsEtaPerTrack = doRecHitVsPtVsEtaPerTrack [tracks]118 locals()[label].doGoodTrackRecHitVsPhiVsEtaPerTrack = doGoodTrackRecHitVsPhiVsEtaPerTrack [tracks]119 locals()[label].doLayersVsPhiVsEtaPerTrack = doLayersVsPhiVsEtaPerTrack [tracks]120 locals()[label].doGoodTrackLayersVsPhiVsEtaPerTrack = doGoodTrackLayersVsPhiVsEtaPerTrack [tracks]121 locals()[label].doPUmonitoring = doPUmonitoring [tracks]122 locals()[label].doPlotsVsBXlumi = doPlotsVsBXlumi [tracks]123 locals()[label].doPlotsVsGoodPVtx = doPlotsVsGoodPVtx [tracks]124 locals()[label].doPlotsVsLUMI = cms.bool(True)125 locals()[label].doPlotsVsBX = cms.bool(True)126 locals()[label].doEffFromHitPatternVsPU = doEffFromHitPatternVsPU [tracks]127 locals()[label].doEffFromHitPatternVsBX = doEffFromHitPatternVsBX [tracks]128 locals()[label].doEffFromHitPatternVsLUMI = False129 locals()[label].doStopSource = doStopSource [tracks] 130 locals()[label].setLabel(label)131 # ZeroBias, hip, no OOT pu (1st collision in train) ###132 label = 'TrackerCollisionSelectedTrackMonZBHIPnoOOT' + str(tracks) 133 locals()[label] = TrackerCollisionTrackMonZBHIPnoOOT.clone()134 locals()[label].TrackProducer = cms.InputTag(tracks)135 locals()[label].FolderName = cms.string(mainfolderName[tracks]+"/HIP_noOOT_INpu")136 locals()[label].PVFolderName = cms.string(vertexfolderName[tracks]+"/HIP_noOOT_INpu")137 locals()[label].TrackPtMin = trackPtMin[tracks]138 locals()[label].TrackPtBin = trackPtN[tracks]139 locals()[label].TrackPtMax = trackPtMax[tracks]140 locals()[label].TrackPBin = trackPtN[tracks]141 locals()[label].TrackPMin = trackPtMin[tracks]142 locals()[label].TrackPMax = trackPtMax[tracks]143 locals()[label].doDCAPlots = doPlotsPCA[tracks]144 locals()[label].doDCAwrtPVPlots = doPlotsPCA[tracks]145 locals()[label].doDCAwrt000Plots = doPlotsPCA[tracks]146 locals()[label].doSIPPlots = doPlotsPCA[tracks]147 locals()[label].numCut = numCutString[tracks]148 locals()[label].denCut = denCutString[tracks]149 locals()[label].doGoodTracksPlots = doGoodTracksPlots [tracks]150 locals()[label].doTrackerSpecific = doTrackerSpecific [tracks]151 locals()[label].doHitPropertiesPlots = doHitPropertiesPlots [tracks]152 locals()[label].doGeneralPropertiesPlots = doGeneralPropertiesPlots [tracks]153 locals()[label].doBeamSpotPlots = doBeamSpotPlots [tracks]154 locals()[label].doSeedParameterHistos = doSeedParameterHistos [tracks]155 locals()[label].doRecHitVsPhiVsEtaPerTrack = doRecHitVsPhiVsEtaPerTrack [tracks]156 locals()[label].doRecHitVsPtVsEtaPerTrack = doRecHitVsPtVsEtaPerTrack [tracks]157 locals()[label].doGoodTrackRecHitVsPhiVsEtaPerTrack = doGoodTrackRecHitVsPhiVsEtaPerTrack [tracks]158 locals()[label].doLayersVsPhiVsEtaPerTrack = doLayersVsPhiVsEtaPerTrack [tracks]159 locals()[label].doGoodTrackLayersVsPhiVsEtaPerTrack = doGoodTrackLayersVsPhiVsEtaPerTrack [tracks]160 locals()[label].doPUmonitoring = doPUmonitoring [tracks]161 locals()[label].doPlotsVsBXlumi = doPlotsVsBXlumi [tracks]162 locals()[label].doPlotsVsGoodPVtx = doPlotsVsGoodPVtx [tracks]163 locals()[label].doPlotsVsLUMI = cms.bool(True)164 locals()[label].doPlotsVsBX = cms.bool(True)165 locals()[label].doEffFromHitPatternVsPU = doEffFromHitPatternVsPU [tracks]166 locals()[label].doEffFromHitPatternVsBX = doEffFromHitPatternVsBX [tracks]167 locals()[label].doEffFromHitPatternVsLUMI = False168 locals()[label].doStopSource = doStopSource [tracks] 169 locals()[label].setLabel(label)170 # ZeroBias, hip, OOT pu (1st collision after train) ###171 label = 'TrackerCollisionSelectedTrackMonZBHIPOOT' + str(tracks) 172 locals()[label] = TrackerCollisionTrackMonZBHIPOOT.clone()173 locals()[label].TrackProducer = cms.InputTag(tracks)174 locals()[label].FolderName = cms.string(mainfolderName[tracks]+"/HIP_OOT_noINpu")175 locals()[label].PVFolderName = cms.string(vertexfolderName[tracks]+"/HIP_OOT_noINpu")176 locals()[label].TrackPtMin = trackPtMin[tracks]177 locals()[label].TrackPtBin = trackPtN[tracks]178 locals()[label].TrackPtMax = trackPtMax[tracks]179 locals()[label].TrackPBin = trackPtN[tracks]180 locals()[label].TrackPMin = trackPtMin[tracks]181 locals()[label].TrackPMax = trackPtMax[tracks]182 locals()[label].doDCAPlots = doPlotsPCA[tracks]183 locals()[label].doDCAwrtPVPlots = doPlotsPCA[tracks]184 locals()[label].doDCAwrt000Plots = doPlotsPCA[tracks]185 locals()[label].doSIPPlots = doPlotsPCA[tracks]186 locals()[label].numCut = numCutString[tracks]187 locals()[label].denCut = denCutString[tracks]188 locals()[label].doGoodTracksPlots = doGoodTracksPlots [tracks]189 locals()[label].doTrackerSpecific = doTrackerSpecific [tracks]190 locals()[label].doHitPropertiesPlots = doHitPropertiesPlots [tracks]191 locals()[label].doGeneralPropertiesPlots = doGeneralPropertiesPlots [tracks]192 locals()[label].doBeamSpotPlots = doBeamSpotPlots [tracks]193 locals()[label].doSeedParameterHistos = doSeedParameterHistos [tracks]194 locals()[label].doRecHitVsPhiVsEtaPerTrack = doRecHitVsPhiVsEtaPerTrack [tracks]195 locals()[label].doRecHitVsPtVsEtaPerTrack = doRecHitVsPtVsEtaPerTrack [tracks]196 locals()[label].doGoodTrackRecHitVsPhiVsEtaPerTrack = doGoodTrackRecHitVsPhiVsEtaPerTrack [tracks]197 locals()[label].doLayersVsPhiVsEtaPerTrack = doLayersVsPhiVsEtaPerTrack [tracks]198 locals()[label].doGoodTrackLayersVsPhiVsEtaPerTrack = doGoodTrackLayersVsPhiVsEtaPerTrack [tracks]199 locals()[label].doPUmonitoring = doPUmonitoring [tracks]200 locals()[label].doPlotsVsBXlumi = doPlotsVsBXlumi [tracks]201 locals()[label].doPlotsVsGoodPVtx = doPlotsVsGoodPVtx [tracks]202 locals()[label].doPlotsVsLUMI = cms.bool(True)203 locals()[label].doPlotsVsBX = cms.bool(True)204 locals()[label].doEffFromHitPatternVsPU = doEffFromHitPatternVsPU [tracks]205 locals()[label].doEffFromHitPatternVsBX = doEffFromHitPatternVsBX [tracks]206 locals()[label].doEffFromHitPatternVsLUMI = False207 locals()[label].doStopSource = doStopSource [tracks] 208 locals()[label].setLabel(label)209#-------------------------------------------------210# Tracking Monitor 211#-------------------------------------------------212import DQM.TrackingMonitor.TrackingMonitorSeed_cfi213from DQM.TrackingMonitorSource.IterTrackingModules4seedMonitoring_cfi import *214# Create first modules for all possible iterations, select later which215# ones to actually use based on era216for step in seedInputTag.iterkeys():217 label = 'TrackSeedMon'+str(step)218 locals()[label] = DQM.TrackingMonitor.TrackingMonitorSeed_cfi.TrackMonSeed.clone(219 doTrackCandHistos = cms.bool(True)220 )221 locals()[label].TrackProducer = cms.InputTag("generalTracks")222 locals()[label].FolderName = cms.string("Tracking/TrackParameters/generalTracks")223 locals()[label].SeedProducer = seedInputTag[step]224 locals()[label].TCProducer = trackCandInputTag[step]225 locals()[label].AlgoName = cms.string( str(step) )226 locals()[label].TkSeedSizeBin = trackSeedSizeBin[step]227 locals()[label].TkSeedSizeMin = trackSeedSizeMin[step]228 locals()[label].TkSeedSizeMax = trackSeedSizeMax[step]229 locals()[label].ClusterLabels = clusterLabel[step]230 if clusterLabel[step] == cms.vstring('Pix') :231 locals()[label].NClusPxBin = clusterBin[step]232 locals()[label].NClusPxMax = clusterMax[step]233 elif clusterLabel[step] == cms.vstring('Strip') or clusterLabel[step] == cms.vstring('Tot') :234 locals()[label].NClusStrBin = clusterBin[step]235 locals()[label].NClusStrMax = clusterMax[step]236# DQM Services237dqmInfoTracking = cms.EDAnalyzer("DQMEventInfo",238 subSystemFolder = cms.untracked.string('Tracking')239)240# LogMessageMonitor ####241### load which are the module to monitor242from DQM.TrackingMonitorSource.EDModules2monitor_cfi import *243### load the different flavour of settings of the LogMessageMonitor module244from DQM.TrackingMonitorSource.LogMessageMonitor_cff import *245for module in selectedModules :246 label = str(module)+'LogMessageMonCommon'247 locals()[label] = LogMessageMonCommon.clone()248 locals()[label].pluginsMonName = pluginsMonName[module]249 locals()[label].modules = modulesLabel[module]250 locals()[label].categories = categories[module]251 locals()[label].setLabel(label)252 label = str(module)+'LogMessageMonMB'253 locals()[label] = LogMessageMonMB.clone()254 locals()[label].pluginsMonName = pluginsMonName[module]255 locals()[label].modules = modulesLabel[module]256 locals()[label].categories = categories[module]257 locals()[label].setLabel(label)258# dEdx monitor ####259### load which dedx260from DQM.TrackingMonitorSource.dedxHarmonic2monitor_cfi import *261### load the different flavour of settings of the dEdxAnalyzer module262from DQM.TrackingMonitorSource.dEdxAnalyzer_cff import *263# temporary patch in order to have BXlumi 264from RecoLuminosity.LumiProducer.lumiProducer_cff import *265# import v0 monitoring266from DQM.TrackingMonitor.V0Monitor_cff import *267# temporary test in order to temporary produce the "goodPrimaryVertexCollection"268# define with a new name if changes are necessary, otherwise simply include269# it from CommonTools/ParticleFlow/python/goodOfflinePrimaryVertices_cfi.py270# uncomment when necessary271from PhysicsTools.SelectorUtils.pvSelector_cfi import pvSelector272from CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi import goodOfflinePrimaryVertices273trackingDQMgoodOfflinePrimaryVertices = goodOfflinePrimaryVertices.clone()274trackingDQMgoodOfflinePrimaryVertices.filterParams = pvSelector.clone( minNdof = cms.double(4.0), maxZ = cms.double(24.0) )275trackingDQMgoodOfflinePrimaryVertices.src=cms.InputTag('offlinePrimaryVertices')276trackingDQMgoodOfflinePrimaryVertices.filter = cms.bool(False)277# Sequence278TrackingDQMSourceTier0 = cms.Sequence()279# dEdx monitoring280TrackingDQMSourceTier0 += dedxHarmonicSequence * dEdxMonCommon * dEdxHitMonCommon 281# # temporary patch in order to have BXlumi282# * lumiProducer283# track collections284for tracks in selectedTracks :285 if tracks != 'generalTracks':286 TrackingDQMSourceTier0 += cms.ignore(sequenceName[tracks])287 label = 'TrackerCollisionSelectedTrackMonCommon' + str(tracks)288 TrackingDQMSourceTier0 += cms.ignore(locals()[label])289# seeding monitoring290for _eraName, _postfix, _era in _cfg.allEras():291 mvaSel = _utils.getMVASelectors(_postfix)292 _seq = cms.Sequence()293 for step in locals()["selectedIterTrackingStep"+_postfix]:294 if step in mvaSel:295 locals()["TrackSeedMon"+step].doMVAPlots = True296 locals()["TrackSeedMon"+step].TrackProducerForMVA = mvaSel[step][0]297 locals()["TrackSeedMon"+step].MVAProducers = mvaSel[step][1]298 _seq += locals()["TrackSeedMon"+step]299 if _eraName == "":300 locals()["TrackSeedMonSequence"] = _seq301 else:302 _era.toReplaceWith(TrackSeedMonSequence, _seq)303TrackingDQMSourceTier0 += TrackSeedMonSequence304# MessageLog305for module in selectedModules :306 label = str(module)+'LogMessageMonCommon'307 TrackingDQMSourceTier0 += locals()[label]308TrackingDQMSourceTier0 += voMonitoringSequence309TrackingDQMSourceTier0 += voWcutMonitoringSequence310TrackingDQMSourceTier0 += dqmInfoTracking311TrackingDQMSourceTier0Common = cms.Sequence()312# dEdx monitoring313TrackingDQMSourceTier0Common += (dedxHarmonicSequence * dEdxMonCommon * dEdxHitMonCommon) 314## monitor track collections315for tracks in selectedTracks :316 if tracks != 'generalTracks':317 TrackingDQMSourceTier0Common+=cms.ignore(sequenceName[tracks])318 label = 'TrackerCollisionSelectedTrackMonCommon' + str(tracks)319 TrackingDQMSourceTier0Common += cms.ignore(locals()[label])320# seeding monitoring321TrackingDQMSourceTier0Common += TrackSeedMonSequence322# MessageLog323for module in selectedModules :324 label = str(module)+'LogMessageMonCommon'325 TrackingDQMSourceTier0Common += locals()[label]326TrackingDQMSourceTier0Common += voMonitoringCommonSequence327TrackingDQMSourceTier0Common += voWcutMonitoringCommonSequence328TrackingDQMSourceTier0Common += dqmInfoTracking329TrackingDQMSourceTier0MinBias = cms.Sequence()330# dEdx monitoring331TrackingDQMSourceTier0MinBias += dedxHarmonicSequence * dEdxMonCommon * dEdxHitMonCommon 332# * lumiProducer333# * trackingDQMgoodOfflinePrimaryVertices334# monitor track collections335for tracks in selectedTracks :336 if tracks != 'generalTracks':337 TrackingDQMSourceTier0MinBias += cms.ignore(sequenceName[tracks])338 for topology in [ 'MB', 'ZBnoHIPnoOOT', 'ZBHIPnoOOT', 'ZBHIPOOT']:339 label = 'TrackerCollisionSelectedTrackMon' + str(topology) + str(tracks)340 TrackingDQMSourceTier0MinBias += cms.ignore(locals()[label])341# seeding monitoring342TrackingDQMSourceTier0MinBias += TrackSeedMonSequence343# MessageLog344for module in selectedModules :345 label = str(module)+'LogMessageMonMB'346 TrackingDQMSourceTier0MinBias += locals()[label]347# V0 monitoring348TrackingDQMSourceTier0MinBias += voMonitoringMBSequence349TrackingDQMSourceTier0MinBias += voMonitoringZBnoHIPnoOOTSequence350TrackingDQMSourceTier0MinBias += voMonitoringZBHIPnoOOTSequence351TrackingDQMSourceTier0MinBias += voMonitoringZBHIPOOTSequence352TrackingDQMSourceTier0MinBias += voWcutMonitoringMBSequence353TrackingDQMSourceTier0MinBias += voWcutMonitoringZBnoHIPnoOOTSequence354TrackingDQMSourceTier0MinBias += voWcutMonitoringZBHIPnoOOTSequence355TrackingDQMSourceTier0MinBias += voWcutMonitoringZBHIPOOTSequence...

Full Screen

Full Screen

pydevd_save_locals.py

Source:pydevd_save_locals.py Github

copy

Full Screen

...8except:9 frame_type = type(sys._getframe())10def is_save_locals_available():11 return save_locals_impl is not None12def save_locals(frame):13 """14 Copy values from locals_dict into the fast stack slots in the given frame.15 Note: the 'save_locals' branch had a different approach wrapping the frame (much more code, but it gives ideas16 on how to save things partially, not the 'whole' locals).17 """18 if not isinstance(frame, frame_type):19 # Fix exception when changing Django variable (receiving DjangoTemplateFrame)20 return21 if save_locals_impl is not None:22 try:23 save_locals_impl(frame)24 except:25 pass26def make_save_locals_impl():27 """28 Factory for the 'save_locals_impl' method. This may seem like a complicated pattern but it is essential that the method is created at29 module load time. Inner imports after module load time would cause an occasional debugger deadlock due to the importer lock and debugger30 lock being taken in different order in different threads.31 """32 try:33 if '__pypy__' in sys.builtin_module_names:34 import __pypy__ # @UnresolvedImport35 save_locals = __pypy__.locals_to_fast36 except:37 pass38 else:39 if '__pypy__' in sys.builtin_module_names:40 def save_locals_pypy_impl(frame):41 save_locals(frame)42 return save_locals_pypy_impl43 try:44 import ctypes45 locals_to_fast = ctypes.pythonapi.PyFrame_LocalsToFast46 except:47 pass48 else:49 def save_locals_ctypes_impl(frame):50 locals_to_fast(ctypes.py_object(frame), ctypes.c_int(0))51 return save_locals_ctypes_impl52 return None...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Slash automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful