def build(self): import sys # Don't do something when running non-interactive. if not sys.stdout.isatty(): return from plumbum import FG from benchbuild.utils.downloader import update_hash from logging import info root = CFG["tmp_dir"].value() src_file = self.src_file + ".new" with local.cwd(self.builddir): emerge_in_chroot = uchroot()["/usr/bin/emerge"] emerge_boost = uchroot(uid=501, gid=10)["/usr/bin/emerge"] with local.env(CC="gcc", CXX="g++", ACCEPT_KEYWORDS="~amd64"): with local.env(USE="-filecaps"): run(emerge_in_chroot["likwid"]) with local.env(USE="static-libs"): run(emerge_in_chroot["dev-libs/libpfm"]) run(emerge_in_chroot["dev-libs/papi"]) run(emerge_in_chroot["sys-process/time"]) run(emerge_boost["dev-utils/boost-build"]) run(emerge_boost["dev-libs/boost"]) tgt_path = path.join(root, self.src_file) tgt_path_new = path.join(root, src_file) tar("cjf", tgt_path_new, ".") update_hash(src_file, root) mv(path.join(root, src_file), tgt_path)
def build(self): with local.env(CC="gcc", CXX="g++"): emerge_in_chroot = uchroot()["/usr/bin/emerge"] run(emerge_in_chroot["app-portage/portage-utils"]) run(emerge_in_chroot["app-portage/gentoolkit"]) qgrep_in_chroot = uchroot()["/usr/bin/qgrep"] ebuilds = set() for language in CFG["gentoo"]["autotest_lang"].value().split(','): output = qgrep_in_chroot("-l", \ get_string_for_language(language)) for line in output.split('\n'): if "ebuild" in line: parts = line.split('.ebuild')[0].split('/') ebuilds.add(parts[0] + '/' + parts[1]) use_flags = CFG["gentoo"]["autotest_use"].value().split(' ') for use in use_flags: if use == "": continue equery_in_chroot = uchroot()["/usr/bin/equery"] output = equery_in_chroot("-q", "hasuse", "-p", use) ebuilds_use = set() for line in output.split('\n'): ebuilds_use.add(re.sub(r"(.*)-[0-9]+.*$", r"\1", line)) ebuilds = ebuilds.intersection(ebuilds_use) file_location = CFG["gentoo"]["autotest_loc"].value() with open(file_location, "w") as output_file: for ebuild in sorted(ebuilds): output_file.write(str(ebuild) + "\n") output_file.flush()
def run_tests(self, experiment): """Runs runtime tests for eix""" from benchbuild.project import wrap wrap(path.join(self.builddir, "usr", "bin", "eix"), experiment, self.builddir) eix = uchroot()["/usr/bin/eix"] time = uchroot()["/usr/bin/time"] run(time["eix", "clang"])
def run_tests(self, experiment, run): """Runs runtime tests for eix""" wrap(path.join("usr", "bin", "eix"), experiment, self.builddir) eix = uchroot()["/usr/bin/eix"] run(eix["clang"])
def run_tests(self, experiment): from benchbuild.project import wrap wrap(path.join(self.builddir, "usr", "bin", "7z"), experiment, self.builddir) sevenz = uchroot()["/usr/bin/7z"] run(sevenz["b", "-mmt1"])
def build(self): with local.cwd(self.builddir): emerge_in_chroot = uchroot()["/usr/bin/emerge"] prog = self.DOMAIN + "/" + str(self.NAME)[len(self.DOMAIN)+1:] with local.env(CONFIG_PROTECT="-*"): emerge_in_chroot("--autounmask-only=y", "--autounmask-write=y", prog, retcode=None) run(emerge_in_chroot[prog])
def build(self): emerge_in_chroot = uchroot()["/usr/bin/emerge"] with local.env(USE="server"): run(emerge_in_chroot["dev-db/postgresql:9.4"]) pg_socketdir = "/run/postgresql" if not path.exists(self.outside(pg_socketdir)): run(mkdir["-p", self.outside(pg_socketdir)])
def build(self): emerge_in_chroot = uchroot()["/usr/bin/emerge"] prog = self.DOMAIN + "/" + str(self.NAME)[len(self.DOMAIN) + 1:] with local.env(CONFIG_PROTECT="-*"): emerge_in_chroot("--autounmask-only=y", "--autounmask-write=y", prog, retcode=None) uretry(emerge_in_chroot[prog])
def build(self): with local.cwd(self.builddir): emerge_in_chroot = uchroot()["/usr/bin/emerge"] with local.env(USE="server"): run(emerge_in_chroot["dev-db/postgresql:9.4"]) pg_socketdir = "/run/postgresql" if not path.exists(self.outside(pg_socketdir)): run(mkdir["-p", self.outside(pg_socketdir)])
def run_tests(self, experiment, run): wrap(path.join(self.builddir, "usr/bin/lmp_serial"), experiment, self.builddir) lammps = uchroot()["/usr/bin/lmp_serial"] lammps_dir = path.join(self.builddir, "lammps") with local.cwd("lammps"): tests = glob(path.join(lammps_dir, "in.*")) for test in tests: run((lammps < strip_path_prefix(test, self.builddir)))
def build(self): from plumbum import FG from benchbuild.utils.downloader import update_hash from logging import info uchroot = uchroot_no_llvm root = CFG["tmp_dir"].value() src_file = self.src_file + ".new" with local.cwd(self.builddir): sed_in_chroot = uchroot()["/bin/sed"] run(sed_in_chroot["-i", '/CC=/d', "/etc/portage/make.conf"]) run(sed_in_chroot["-i", '/CXX=/d', "/etc/portage/make.conf"]) emerge_in_chroot = uchroot()["/usr/bin/emerge"] #run(emerge_in_chroot["dev-python/pip"]) with local.env(CC="gcc", CXX="g++"): # run(emerge_in_chroot["dev-db/postgresql"]) # run(emerge_in_chroot["net-misc/curl"]) # We need the unstable portage version with local.env(ACCEPT_KEYWORDS="~*", LD_LIBRARY_PATH=""): run(emerge_in_chroot["--autounmask-only=y", "-uUDN", "--with-bdeps=y", "@world"]) run(emerge_in_chroot["-uUDN", "--with-bdeps=y", "@world"]) run(emerge_in_chroot["--autounmask-only=y", "=sys-libs/ncurses-6.0-r1:0/6"]) run(emerge_in_chroot["=sys-libs/ncurses-6.0-r1:0/6"]) # run(emerge_in_chroot["sys-apps/portage"]) #benchbuild_src = CFG["src_dir"].value() #version = CFG["version"].value() #with local.cwd(benchbuild_src): # setup_py = local["./setup.py"]("sdist", "-d", self.builddir) #pip_in_uchroot = uchroot()["/usr/bin/pip3"] #pip_in_uchroot("install", "--upgrade", # "benchbuild-{}.tar.gz".format(version)) tgt_path = path.join(root, self.src_file) tgt_path_new = path.join(root, src_file) tar("cjf", tgt_path_new, ".") update_hash(src_file, root) mv(path.join(root, src_file), tgt_path)
def wrap(name, runner, sprefix=None, **template_vars): """ Wrap the binary :name: with the function :runner:. This module generates a python tool that replaces :name: The function in runner only accepts the replaced binaries name as argument. We use the cloudpickle package to perform the serialization, make sure :runner: can be serialized with it and you're fine. Args: name: Binary we want to wrap runner: Function that should run instead of :name: Returns: A plumbum command, ready to launch. """ name_absolute = os.path.abspath(name) real_f = name_absolute + PROJECT_BIN_F_EXT if sprefix: run(uchroot()["/bin/mv", strip_path_prefix(name_absolute, sprefix), strip_path_prefix(real_f, sprefix)]) else: run(mv[name_absolute, real_f]) blob_f = name_absolute + PROJECT_BLOB_F_EXT with open(blob_f, 'wb') as blob: dill.dump(runner, blob, protocol=-1, recurse=True) bin_path = list_to_path(CFG["env"]["binary_path"].value()) bin_path = list_to_path([bin_path, os.environ["PATH"]]) bin_lib_path = list_to_path(CFG["env"]["binary_ld_library_path"].value()) bin_lib_path = list_to_path([bin_lib_path, os.environ["LD_LIBRARY_PATH"]]) template_vars['db_host'] = str(CFG["db"]["host"]) template_vars['db_name'] = str(CFG["db"]["name"]) template_vars['db_port'] = str(CFG["db"]["port"]) template_vars['db_pass'] = str(CFG["db"]["pass"]) template_vars['db_user'] = str(CFG["db"]["user"]) template_vars['path'] = bin_path template_vars['ld_lib_path'] = bin_lib_path template_vars['blobf'] = strip_path_prefix(blob_f, sprefix) template_vars['runf'] = strip_path_prefix(real_f, sprefix) if 'python' not in template_vars: template_vars['python'] = sys.executable with open(name_absolute, 'w') as wrapper: lines = template_str("templates/run_static.py.inc") lines = lines.format(**template_vars) wrapper.write(lines) run(chmod["+x", name_absolute]) return local[name_absolute]
def wrap(name, project, sprefix=None, python=sys.executable): """ Wrap the binary :name: with the runtime extension of the project. This module generates a python tool that replaces :name: The function in runner only accepts the replaced binaries name as argument. We use the cloudpickle package to perform the serialization, make sure :runner: can be serialized with it and you're fine. Args: name: Binary we want to wrap project: The project that contains the runtime_extension we want to run instead of the binary. Returns: A plumbum command, ready to launch. """ from jinja2 import Environment, PackageLoader env = Environment(trim_blocks=True, lstrip_blocks=True, loader=PackageLoader('benchbuild', 'utils/templates')) template = env.get_template('run_static.py.inc') name_absolute = os.path.abspath(name) real_f = name_absolute + PROJECT_BIN_F_EXT if sprefix: run(uchroot()["/bin/mv", strip_path_prefix(name_absolute, sprefix), strip_path_prefix(real_f, sprefix)]) else: run(mv[name_absolute, real_f]) project_file = persist(project, suffix=".project") bin_path = list_to_path(CFG["env"]["path"].value()) bin_path = list_to_path([bin_path, os.environ["PATH"]]) bin_lib_path = list_to_path(CFG["env"]["ld_library_path"].value()) bin_lib_path = list_to_path([bin_lib_path, os.environ["LD_LIBRARY_PATH"]]) with open(name_absolute, 'w') as wrapper: wrapper.write( template.render( runf=strip_path_prefix(real_f, sprefix), project_file=strip_path_prefix(project_file, sprefix), path=str(bin_path), ld_library_path=str(bin_lib_path), python=python, )) run(chmod["+x", name_absolute]) return local[name_absolute]
def run(self, context): """Setup a gentoo container suitable for PolyJIT.""" # Don't do something when running non-interactive. if not sys.stdout.isatty(): return with local.cwd(context.in_container): self.configure() sed_in_chroot = uchroot()["/bin/sed"] emerge_in_chroot = uchroot()["/usr/bin/emerge"] has_pkg = uchroot()["/usr/bin/qlist", "-I"] run(sed_in_chroot["-i", '/CC=/d', "/etc/portage/make.conf"]) run(sed_in_chroot["-i", '/CXX=/d', "/etc/portage/make.conf"]) packages = \ CFG["container"]["strategy"]["polyjit"]["packages"].value() with local.env(CC="gcc", CXX="g++", MAKEOPTS="-j{0}".format(CFG["jobs"].value())): if CFG["container"]["strategy"]["polyjit"]["sync"].value(): run(emerge_in_chroot["--sync"]) if CFG["container"]["strategy"]["polyjit"]["upgrade"].value(): run(emerge_in_chroot["--autounmask-only=y", "-uUDN", "--with-bdeps=y", "@world"]) run(emerge_in_chroot["-uUDN", "--with-bdeps=y", "@world"]) for pkg in packages: if (has_pkg[pkg["name"]] & TF): continue env = pkg["env"] with local.env(**env): run(emerge_in_chroot[pkg["name"]]) print("Packing new container image.") with local.cwd(context.builddir): pack_container(context.in_container, context.out_container)
def run_tests(self, runner): wrap(path.join(self.builddir, "bin", "gzip"), self, self.builddir) gzip = uchroot()["/bin/gzip"] # Compress runner(gzip["-f", "-k", "--best", "compression/text.html"]) runner(gzip["-f", "-k", "--best", "compression/chicken.jpg"]) runner(gzip["-f", "-k", "--best", "compression/control"]) runner(gzip["-f", "-k", "--best", "compression/input.source"]) runner(gzip["-f", "-k", "--best", "compression/liberty.jpg"]) # Decompress runner(gzip["-f", "-k", "--decompress", "compression/text.html.gz"]) runner(gzip["-f", "-k", "--decompress", "compression/chicken.jpg.gz"]) runner(gzip["-f", "-k", "--decompress", "compression/control.gz"]) runner(gzip["-f", "-k", "--decompress", "compression/input.source.gz"]) runner(gzip["-f", "-k", "--decompress", "compression/liberty.jpg.gz"])
def run_tests(self, experiment, run): wrap(path.join(self.builddir, "bin", "bzip2"), experiment, self.builddir) bzip2 = uchroot()["/bin/bzip2"] # Compress run(bzip2["-f", "-z", "-k", "--best", "compression/text.html"]) run(bzip2["-f", "-z", "-k", "--best", "compression/chicken.jpg"]) run(bzip2["-f", "-z", "-k", "--best", "compression/control"]) run(bzip2["-f", "-z", "-k", "--best", "compression/input.source"]) run(bzip2["-f", "-z", "-k", "--best", "compression/liberty.jpg"]) # Decompress run(bzip2["-f", "-k", "--decompress", "compression/text.html.bz2"]) run(bzip2["-f", "-k", "--decompress", "compression/chicken.jpg.bz2"]) run(bzip2["-f", "-k", "--decompress", "compression/control.bz2"]) run(bzip2["-f", "-k", "--decompress", "compression/input.source.bz2"]) run(bzip2["-f", "-k", "--decompress", "compression/liberty.jpg.bz2"])
def run_tests(self, runner): wrap(path.join(self.builddir, "usr/bin/x264"), self, self.builddir) x264 = uchroot()["/usr/bin/x264"] tests = [ "--crf 30 -b1 -m1 -r1 --me dia --no-cabac --direct temporal --ssim --no-weightb", "--crf 16 -b2 -m3 -r3 --me hex --no-8x8dct --direct spatial --no-dct-decimate -t0 --slice-max-mbs 50", "--crf 26 -b4 -m5 -r2 --me hex --cqm jvt --nr 100 --psnr --no-mixed-refs --b-adapt 2 --slice-max-size 1500", "--crf 18 -b3 -m9 -r5 --me umh -t1 -A all --b-pyramid normal --direct auto --no-fast-pskip --no-mbtree", "--crf 22 -b3 -m7 -r4 --me esa -t2 -A all --psy-rd 1.0:1.0 --slices 4", "--frames 50 --crf 24 -b3 -m10 -r3 --me tesa -t2", "--frames 50 -q0 -m9 -r2 --me hex -Aall", "--frames 50 -q0 -m2 -r1 --me hex --no-cabac" ] for ifile in self.inputfiles: for _, test in enumerate(tests): uretry(x264[ifile, self.inputfiles[ifile], "--threads", "1", "-o", "/dev/null", test.split(" ")])
def run_tests(self, experiment): from benchbuild.project import wrap wrap(path.join(self.builddir, "usr", "bin", "xz"), experiment, self.builddir) xz = uchroot()["/usr/bin/xz"] # Compress run(xz["--compress", "-f", "-k", "-e", "-9", "compression/text.html"]) run(xz["--compress", "-f", "-k", "-e", "-9", "compression/chicken.jpg"]) run(xz["--compress", "-f", "-k", "-e", "-9", "compression/control"]) run(xz["--compress", "-f", "-k", "-e", "-9", "compression/input.source"]) run(xz["--compress", "-f", "-k", "-e", "-9", "compression/liberty.jpg"]) # Decompress run(xz["--decompress", "-f", "-k", "compression/text.html.xz"]) run(xz["--decompress", "-f", "-k", "compression/chicken.jpg.xz"]) run(xz["--decompress", "-f", "-k", "compression/control.xz"]) run(xz["--decompress", "-f", "-k", "compression/input.source.xz"]) run(xz["--decompress", "-f", "-k", "compression/liberty.jpg.xz"])
def run_tests(self, experiment): from benchbuild.project import wrap wrap(path.join(self.builddir, "bin", "bzip2"), experiment, self.builddir) bzip2 = uchroot()["/bin/bzip2"] # Compress run(bzip2["-f", "-z", "-k", "--best", "compression/text.html"]) run(bzip2["-f", "-z", "-k", "--best", "compression/chicken.jpg"]) run(bzip2["-f", "-z", "-k", "--best", "compression/control"]) run(bzip2["-f", "-z", "-k", "--best", "compression/input.source"]) run(bzip2["-f", "-z", "-k", "--best", "compression/liberty.jpg"]) # Decompress run(bzip2["-f", "-k", "--decompress", "compression/text.html.bz2"]) run(bzip2["-f", "-k", "--decompress", "compression/chicken.jpg.bz2"]) run(bzip2["-f", "-k", "--decompress", "compression/control.bz2"]) run(bzip2["-f", "-k", "--decompress", "compression/input.source.bz2"]) run(bzip2["-f", "-k", "--decompress", "compression/liberty.jpg.bz2"])
def run_tests(self, runner): wrap(path.join(self.builddir, "usr", "bin", "xz"), self, self.builddir) xz = uchroot()["/usr/bin/xz"] # Compress runner(xz["--compress", "-f", "-k", "-e", "-9", "compression/text.html"]) runner(xz["--compress", "-f", "-k", "-e", "-9", "compression/chicken.jpg"]) runner(xz["--compress", "-f", "-k", "-e", "-9", "compression/control"]) runner(xz["--compress", "-f", "-k", "-e", "-9", "compression/input.source"]) runner(xz["--compress", "-f", "-k", "-e", "-9", "compression/liberty.jpg"]) # Decompress runner(xz["--decompress", "-f", "-k", "compression/text.html.xz"]) runner(xz["--decompress", "-f", "-k", "compression/chicken.jpg.xz"]) runner(xz["--decompress", "-f", "-k", "compression/control.xz"]) runner(xz["--decompress", "-f", "-k", "compression/input.source.xz"]) runner(xz["--decompress", "-f", "-k", "compression/liberty.jpg.xz"])
def run_tests(self, experiment, run): pg_data = "/test-data/" pg_path = "/usr/lib64/postgresql-9.4/bin/postgres" wrap(self.outside(pg_path), experiment, self.builddir) cuchroot = uchroot(uid=250, gid=250) dropdb = cuchroot["/usr/bin/dropdb"] createdb = cuchroot["/usr/bin/createdb"] pgbench = cuchroot["/usr/bin/pgbench"] initdb = cuchroot["/usr/bin/initdb"] pg_server = cuchroot[pg_path] with local.env(PGPORT="54329", PGDATA=pg_data): if not path.exists(self.outside(pg_data)): run(initdb) with pg_server.bgrun() as postgres: #We get the PID of the running 'pg_server, which is actually #the PID of the uchroot binary. This is not the PID we #want to send a SIGTERM to. #We need to enumerate all children of 'postgres' recursively #and select the one PID that is named 'postgres.bin' and has #not a process with the same name as parent. #This should be robust enough, as long as postgres doesn't #switch process names after forking. sleep(3) postgres_root = Process(pid=postgres.pid) real_postgres = [ c.pid for c in postgres_root.children(True) if c.name() == 'postgres.bin' and c.parent().name() != 'postgres.bin' ] try: run(createdb) run(pgbench["-i", "portage"]) run(pgbench["-c", 1, "-S", "-t", 1000000, "portage"]) run(dropdb["portage"]) finally: kill("-sSIGTERM", real_postgres[0])
def run_tests(self, experiment): pg_data = "/test-data/" pg_path = "/usr/lib64/postgresql-9.4/bin/postgres" wrap(self.outside(pg_path), experiment, self.builddir) cuchroot = uchroot(uid=250, gid=250) dropdb = cuchroot["/usr/bin/dropdb"] createdb = cuchroot["/usr/bin/createdb"] pgbench = cuchroot["/usr/bin/pgbench"] initdb = cuchroot["/usr/bin/initdb"] pg_server = cuchroot[pg_path] with local.env(PGPORT="54329", PGDATA=pg_data): if not path.exists(self.outside(pg_data)): run(initdb) with pg_server.bgrun() as postgres: #We get the PID of the running 'pg_server, which is actually #the PID of the uchroot binary. This is not the PID we #want to send a SIGTERM to. #We need to enumerate all children of 'postgres' recursively #and select the one PID that is named 'postgres.bin' and has #not a process with the same name as parent. #This should be robust enough, as long as postgres doesn't #switch process names after forking. sleep(3) postgres_root = Process(pid=postgres.pid) real_postgres = [c.pid for c in postgres_root.children(True) if c.name() == 'postgres.bin' and c.parent().name() != 'postgres.bin'] try: run(createdb) run(pgbench["-i", "portage"]) run(pgbench["-c", 1, "-S", "-t", 1000000, "portage"]) run(dropdb["portage"]) finally: kill("-sSIGTERM", real_postgres[0])
def run_tests(self, experiment): from benchbuild.project import wrap, strip_path_prefix wrap(path.join(self.builddir, "usr/bin/x264"), experiment, self.builddir) x264 = uchroot()["/usr/bin/x264"] tests = [ "--crf 30 -b1 -m1 -r1 --me dia --no-cabac --direct temporal --ssim --no-weightb", "--crf 16 -b2 -m3 -r3 --me hex --no-8x8dct --direct spatial --no-dct-decimate -t0 --slice-max-mbs 50", "--crf 26 -b4 -m5 -r2 --me hex --cqm jvt --nr 100 --psnr --no-mixed-refs --b-adapt 2 --slice-max-size 1500", "--crf 18 -b3 -m9 -r5 --me umh -t1 -A all --b-pyramid normal --direct auto --no-fast-pskip --no-mbtree", "--crf 22 -b3 -m7 -r4 --me esa -t2 -A all --psy-rd 1.0:1.0 --slices 4", "--frames 50 --crf 24 -b3 -m10 -r3 --me tesa -t2", "--frames 50 -q0 -m9 -r2 --me hex -Aall", "--frames 50 -q0 -m2 -r1 --me hex --no-cabac" ] for ifile in self.inputfiles: for _, test in enumerate(tests): run(x264[ifile, self.inputfiles[ifile], "--threads", "1", "-o", "/dev/null", test.split(" ")])
def build(self): import sys # Don't do something when running non-interactive. if not sys.stdout.isatty(): return from plumbum import FG from benchbuild.utils.downloader import update_hash from logging import info root = CFG["tmp_dir"].value() src_file = self.src_file + ".new" with local.cwd(self.builddir): bash_in_uchroot = uchroot()["/bin/bash"] print("Entering User-Chroot. Prepare your image and " "type 'exit' when you are done.") bash_in_uchroot & FG # pylint: disable=W0104 tgt_path = path.join(root, self.src_file) tgt_path_new = path.join(root, src_file) print("Packing new stage3 image. " "This will replace the original one at: ", tgt_path) tar("cjf", tgt_path_new, ".") update_hash(src_file, root) mv(path.join(root, src_file), tgt_path)
def build(self): emerge_in_chroot = uchroot()["/usr/bin/emerge"] run(emerge_in_chroot["media-video/x264-encoder"])
def build(self): with local.cwd(self.builddir): emerge_in_chroot = uchroot()["/usr/bin/emerge"] run(emerge_in_chroot["app-arch/p7zip"])
def run_tests(self, experiment, run): wrap(path.join(self.builddir, "usr", "bin", "7z"), experiment, self.builddir) sevenz = uchroot()["/usr/bin/7z"] run(sevenz["b", "-mmt1"])
def build(self): emerge_in_chroot = uchroot()["/usr/bin/emerge"] uretry(emerge_in_chroot["app-arch/gzip"])
def run_tests(self, experiment): from benchbuild.project import wrap crafty_path = "/usr/games/bin/crafty" wrap(path.join(self.builddir, crafty_path.lstrip("/")), experiment, self.builddir) crafty = uchroot()[crafty_path] with open(path.join(self.builddir, "test1.sh"), 'w') as test1: lines = ''' st=10 ponder=off display nomoves setboard rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq move book off setboard rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq move setboard 1k1r4/pp1b1R2/3q2pp/4p3/2B5/4Q3/PPP2B2/2K5 b move setboard 3r1k2/4npp1/1ppr3p/p6P/P2PPPP1/1NR5/5K2/2R5 w move setboard 2q1rr1k/3bbnnp/p2p1pp1/2pPp3/PpP1P1P1/1P2BNNP/2BQ1PRK/7R b move setboard rnbqkb1r/p3pppp/1p6/2ppP3/3N4/2P5/PPP1QPPP/R1B1KB1R w KQkq move setboard r1b2rk1/2q1b1pp/p2ppn2/1p6/3QP3/1BN1B3/PPP3PP/R4RK1 w move setboard 2r3k1/pppR1pp1/4p3/4P1P1/5P2/1P4K1/P1P5/8 w move setboard 1nk1r1r1/pp2n1pp/4p3/q2pPp1N/b1pP1P2/B1P2R2/2P1B1PP/R2Q2K1 w move setboard 4b3/p3kp2/6p1/3pP2p/2pP1P2/4K1P1/P3N2P/8 w move setboard 2kr1bnr/pbpq4/2n1pp2/3p3p/3P1P1B/2N2N1Q/PPP3PP/2KR1B1R w move setboard 3rr1k1/pp3pp1/1qn2np1/8/3p4/PP1R1P2/2P1NQPP/R1B3K1 b move setboard 2r1nrk1/p2q1ppp/bp1p4/n1pPp3/P1P1P3/2PBB1N1/4QPPP/R4RK1 w move setboard r3r1k1/ppqb1ppp/8/4p1NQ/8/2P5/PP3PPP/R3R1K1 b move setboard r2q1rk1/4bppp/p2p4/2pP4/3pP3/3Q4/PP1B1PPP/R3R1K1 w move setboard rnb2r1k/pp2p2p/2pp2p1/q2P1p2/8/1Pb2NP1/PB2PPBP/R2Q1RK1 w move setboard 2r3k1/1p2q1pp/2b1pr2/p1pp4/6Q1/1P1PP1R1/P1PN2PP/5RK1 w move setboard r1bqkb1r/4npp1/p1p4p/1p1pP1B1/8/1B6/PPPN1PPP/R2Q1RK1 w kq move setboard r2q1rk1/1ppnbppp/p2p1nb1/3Pp3/2P1P1P1/2N2N1P/PPB1QP2/R1B2RK1 b move setboard r1bq1rk1/pp2ppbp/2np2p1/2n5/P3PP2/N1P2N2/1PB3PP/R1B1QRK1 b move setboard 3rr3/2pq2pk/p2p1pnp/8/2QBPP2/1P6/P5PP/4RRK1 b move setboard r4k2/pb2bp1r/1p1qp2p/3pNp2/3P1P2/2N3P1/PPP1Q2P/2KRR3 w move setboard 3rn2k/ppb2rpp/2ppqp2/5N2/2P1P3/1P5Q/PB3PPP/3RR1K1 w move setboard 2r2rk1/1bqnbpp1/1p1ppn1p/pP6/N1P1P3/P2B1N1P/1B2QPP1/R2R2K1 b move setboard r1bqk2r/pp2bppp/2p5/3pP3/P2Q1P2/2N1B3/1PP3PP/R4RK1 b kq move setboard r2qnrnk/p2b2b1/1p1p2pp/2pPpp2/1PP1P3/PRNBB3/3QNPPP/5RK1 w move setboard /k/3p/p2P1p/P2P1P///K/ w move setboard /k/rnn////5RBB/K/ w move mt=0 quit EOF ''' test1.write(lines) with open(path.join(self.builddir, "test2.sh"), 'w') as test2: lines = ''' st=10 ponder=off mt=2 setboard 2r2rk1/1bqnbpp1/1p1ppn1p/pP6/N1P1P3/P2B1N1P/1B2QPP1/R2R2K1 b move mt=0 quit ''' test2.write(lines) with local.cwd(self.builddir): run((cat["test1.sh"] | crafty)) run((cat["test2.sh"] | crafty))
def build(self): with local.cwd(self.builddir): emerge_in_chroot = uchroot()["/usr/bin/emerge"] run(emerge_in_chroot["games-board/crafty"])
def build(self): """Compiles and installes eix within gentoo chroot""" emerge_in_chroot = uchroot()["/usr/bin/emerge"] run(emerge_in_chroot["eix"])
def build(self): with local.cwd(self.builddir): emerge_in_chroot = uchroot()["/usr/bin/emerge"] run(emerge_in_chroot["media-video/x264-encoder"])
def build(self): emerge_in_chroot = uchroot()["/usr/bin/emerge"] run(emerge_in_chroot["app-arch/p7zip"])
def build(self): emerge_in_chroot = uchroot()["/usr/bin/emerge"] with local.env(USE="-mpi -doc"): run(emerge_in_chroot["sci-physics/lammps"])
def run_tests(self, runner): crafty_path = "/usr/games/bin/crafty" wrap(crafty_path.lstrip("/"), self, self.builddir) crafty = uchroot()[crafty_path] with open("test1.sh", 'w') as test1: lines = ''' st=10 ponder=off display nomoves setboard rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq move book off setboard rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq move setboard 1k1r4/pp1b1R2/3q2pp/4p3/2B5/4Q3/PPP2B2/2K5 b move setboard 3r1k2/4npp1/1ppr3p/p6P/P2PPPP1/1NR5/5K2/2R5 w move setboard 2q1rr1k/3bbnnp/p2p1pp1/2pPp3/PpP1P1P1/1P2BNNP/2BQ1PRK/7R b move setboard rnbqkb1r/p3pppp/1p6/2ppP3/3N4/2P5/PPP1QPPP/R1B1KB1R w KQkq move setboard r1b2rk1/2q1b1pp/p2ppn2/1p6/3QP3/1BN1B3/PPP3PP/R4RK1 w move setboard 2r3k1/pppR1pp1/4p3/4P1P1/5P2/1P4K1/P1P5/8 w move setboard 1nk1r1r1/pp2n1pp/4p3/q2pPp1N/b1pP1P2/B1P2R2/2P1B1PP/R2Q2K1 w move setboard 4b3/p3kp2/6p1/3pP2p/2pP1P2/4K1P1/P3N2P/8 w move setboard 2kr1bnr/pbpq4/2n1pp2/3p3p/3P1P1B/2N2N1Q/PPP3PP/2KR1B1R w move setboard 3rr1k1/pp3pp1/1qn2np1/8/3p4/PP1R1P2/2P1NQPP/R1B3K1 b move setboard 2r1nrk1/p2q1ppp/bp1p4/n1pPp3/P1P1P3/2PBB1N1/4QPPP/R4RK1 w move setboard r3r1k1/ppqb1ppp/8/4p1NQ/8/2P5/PP3PPP/R3R1K1 b move setboard r2q1rk1/4bppp/p2p4/2pP4/3pP3/3Q4/PP1B1PPP/R3R1K1 w move setboard rnb2r1k/pp2p2p/2pp2p1/q2P1p2/8/1Pb2NP1/PB2PPBP/R2Q1RK1 w move setboard 2r3k1/1p2q1pp/2b1pr2/p1pp4/6Q1/1P1PP1R1/P1PN2PP/5RK1 w move setboard r1bqkb1r/4npp1/p1p4p/1p1pP1B1/8/1B6/PPPN1PPP/R2Q1RK1 w kq move setboard r2q1rk1/1ppnbppp/p2p1nb1/3Pp3/2P1P1P1/2N2N1P/PPB1QP2/R1B2RK1 b move setboard r1bq1rk1/pp2ppbp/2np2p1/2n5/P3PP2/N1P2N2/1PB3PP/R1B1QRK1 b move setboard 3rr3/2pq2pk/p2p1pnp/8/2QBPP2/1P6/P5PP/4RRK1 b move setboard r4k2/pb2bp1r/1p1qp2p/3pNp2/3P1P2/2N3P1/PPP1Q2P/2KRR3 w move setboard 3rn2k/ppb2rpp/2ppqp2/5N2/2P1P3/1P5Q/PB3PPP/3RR1K1 w move setboard 2r2rk1/1bqnbpp1/1p1ppn1p/pP6/N1P1P3/P2B1N1P/1B2QPP1/R2R2K1 b move setboard r1bqk2r/pp2bppp/2p5/3pP3/P2Q1P2/2N1B3/1PP3PP/R4RK1 b kq move setboard r2qnrnk/p2b2b1/1p1p2pp/2pPpp2/1PP1P3/PRNBB3/3QNPPP/5RK1 w move setboard /k/3p/p2P1p/P2P1P///K/ w move setboard /k/rnn////5RBB/K/ w move mt=0 quit EOF ''' test1.write(lines) with open("test2.sh", 'w') as test2: lines = ''' st=10 ponder=off mt=2 setboard 2r2rk1/1bqnbpp1/1p1ppn1p/pP6/N1P1P3/P2B1N1P/1B2QPP1/R2R2K1 b move mt=0 quit ''' test2.write(lines) runner((cat["test1.sh"] | crafty)) runner((cat["test2.sh"] | crafty))
def build(self): emerge_in_chroot = uchroot()["/usr/bin/emerge"] uretry(emerge_in_chroot["games-board/crafty"])
def build(self): """Compiles and installes eix within gentoo chroot""" with local.cwd(self.builddir): emerge_in_chroot = uchroot()["/usr/bin/emerge"] run(emerge_in_chroot["eix"])