Пример #1
0
    def binaries_for_revision(
            revision: ShortCommitHash) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(Bzip2.NAME))

        binary_map.specify_binary('build/bzip2', BinaryType.EXECUTABLE)

        return binary_map[revision]
Пример #2
0
    def binaries_for_revision(
            revision: ShortCommitHash) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(File.NAME))

        binary_map.specify_binary("src/.libs/file", BinaryType.EXECUTABLE)

        return binary_map[revision]
Пример #3
0
    def binaries_for_revision(
            revision: ShortCommitHash) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(Glib.NAME))

        binary_map.specify_binary('build/glib/libglib-2.0.so',
                                  BinaryType.SHARED_LIBRARY)

        return binary_map[revision]
Пример #4
0
    def binaries_for_revision(
        revision: ShortCommitHash
    ) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(Irssi.NAME))

        binary_map.specify_binary('./src/fe-text/irssi', BinaryType.EXECUTABLE)

        return binary_map[revision]
Пример #5
0
    def binaries_for_revision(
        revision: ShortCommitHash
    ) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(Busybox.NAME))

        binary_map.specify_binary("PLEASE_REPLACE_ME", BinaryType.EXECUTABLE)

        return binary_map[revision]
Пример #6
0
    def binaries_for_revision(
            revision: ShortCommitHash) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(
            get_local_project_git_path(LibjpegTurbo.NAME))

        binary_map.specify_binary("libjpeg.so", BinaryType.SHARED_LIBRARY)

        return binary_map[revision]
Пример #7
0
    def binaries_for_revision(
            revision: ShortCommitHash) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(
            MongoDB.NAME))

        # TODO: please add correct binary names
        binary_map.specify_binary("MISSING", BinaryType.EXECUTABLE)

        return binary_map[revision]
Пример #8
0
    def binaries_for_revision(
        revision: ShortCommitHash  # pylint: disable=W0613
    ) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(Libvpx.NAME))

        binary_map.specify_binary("vpxdec", BinaryType.EXECUTABLE)
        binary_map.specify_binary("vpxenc", BinaryType.EXECUTABLE)

        return binary_map[revision]
Пример #9
0
    def binaries_for_revision(
        revision: ShortCommitHash
    ) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(Qemu.NAME))

        binary_map.specify_binary(
            "build/x86_64-softmmu/qemu-system-x86_64", BinaryType.EXECUTABLE
        )

        return binary_map[revision]
    def binaries_for_revision(
            revision: ShortCommitHash) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(
            get_local_project_git_path(
                TwoLibsOneProjectInteractionDiscreteLibsSingleProject.NAME))

        binary_map.specify_binary(
            local.path("revision") /
            "build/test_prog/elementalist/elementalist", BinaryType.EXECUTABLE)

        return binary_map[revision]
Пример #11
0
    def binaries_for_revision(
        revision: ShortCommitHash
    ) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(Redis.NAME))

        binary_map.specify_binary(
            'src/redis-server',
            BinaryType.EXECUTABLE,
            override_binary_name='redis_server'
        )

        return binary_map[revision]
Пример #12
0
    def binaries_for_revision(
            revision: ShortCommitHash) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(Brotli.NAME))

        binary_map.specify_binary(
            "out/brotli",
            BinaryType.EXECUTABLE,
            only_valid_in=RevisionRange(
                "03739d2b113afe60638069c4e1604dc2ac27380d", "HEAD"))
        binary_map.specify_binary(
            "out/bro",
            BinaryType.EXECUTABLE,
            only_valid_in=RevisionRange(
                "5814438791fb2d4394b46e5682a96b68cd092803",
                "03739d2b113afe60638069c4e1604dc2ac27380d"))
        binary_map.specify_binary(
            "bin/bro",
            BinaryType.EXECUTABLE,
            only_valid_in=RevisionRange(
                "f9ab24a7aaee93d5932ba212e5e3d32e4306f748",
                "5814438791fb2d4394b46e5682a96b68cd092803"))
        binary_map.specify_binary(
            "tools/bro",
            BinaryType.EXECUTABLE,
            only_valid_in=RevisionRange(
                "e1739826c04a9944672b99b98249dda021bdeb36",
                "378485b097fd7b80a5e404a3cb912f7b18f78cdb"))
        return binary_map[revision]
Пример #13
0
    def binaries_for_revision(
            revision: ShortCommitHash) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(Xz.NAME))

        binary_map.specify_binary('src/xz/xz',
                                  BinaryType.EXECUTABLE,
                                  only_valid_in=RevisionRange(
                                      "5d018dc035", "3f86532407"))

        binary_map.specify_binary('src/xz/.libs/xz',
                                  BinaryType.EXECUTABLE,
                                  override_entry_point='src/xz/xz',
                                  only_valid_in=RevisionRange(
                                      "880c330938", "master"))

        return binary_map[revision]
Пример #14
0
    def binaries_for_revision(
        revision: ShortCommitHash
    ) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(get_local_project_git_path(Libssh.NAME))

        binary_map.specify_binary(
            'build/src/libssh.so',
            BinaryType.SHARED_LIBRARY,
            only_valid_in=RevisionRange("c65f56aefa", "aa899f8ec0")
        )

        binary_map.specify_binary(
            'build/lib/libssh.so',
            BinaryType.SHARED_LIBRARY,
            only_valid_in=RevisionRange("aa899f8ec0", "master")
        )

        return binary_map[revision]
    def binaries_for_revision(
        revision: ShortCommitHash  # pylint: disable=W0613
    ) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(
            get_local_project_git_path(FeaturePerfCSCollection.NAME))

        binary_map.specify_binary("build/bin/SingleLocalSimple",
                                  BinaryType.EXECUTABLE)
        binary_map.specify_binary("build/bin/SingleLocalMultipleRegions",
                                  BinaryType.EXECUTABLE,
                                  only_valid_in=RevisionRange(
                                      "162db88346", "master"))
        binary_map.specify_binary(
            "build/bin/SimpleSleepLoop",
            BinaryType.EXECUTABLE,
            only_valid_in=RevisionRange(
                "c77bca4c6888970fb721069c82455137943ccf49", "master"))
        binary_map.specify_binary(
            "build/bin/SimpleBusyLoop",
            BinaryType.EXECUTABLE,
            only_valid_in=RevisionRange(
                "c77bca4c6888970fb721069c82455137943ccf49", "master"))

        return binary_map[revision]
Пример #16
0
class TestRevisionBinaryMap(unittest.TestCase):
    """Test if we can correctly setup and use the RevisionBinaryMap."""

    rv_map: RevisionBinaryMap

    def setUp(self) -> None:
        self.rv_map = RevisionBinaryMap(
            get_local_project_git_path("FeaturePerfCSCollection"))

    def test_specification_of_always_valid_binaries(self) -> None:
        """Check if we can add binaries to the map."""
        self.rv_map.specify_binary("build/bin/SingleLocalSimple",
                                   BinaryType.EXECUTABLE)

        self.assertIn("SingleLocalSimple", self.rv_map)

    def test_specification_validity_range_binaries(self) -> None:
        """Check if we can add binaries to the map that are only valid in a
        specific range."""
        self.rv_map.specify_binary("build/bin/SingleLocalMultipleRegions",
                                   BinaryType.EXECUTABLE,
                                   only_valid_in=RevisionRange(
                                       "162db88346", "master"))

        self.assertIn("SingleLocalMultipleRegions", self.rv_map)

    def test_specification_binaries_with_special_name(self) -> None:
        """Check if we can add binaries that have a special name."""
        self.rv_map.specify_binary("build/bin/SingleLocalSimple",
                                   BinaryType.EXECUTABLE,
                                   override_binary_name="Overridden")

        self.assertIn("Overridden", self.rv_map)

    def test_specification_binaries_with_special_entry_point(self) -> None:
        """Check if we can add binaries that have a special entry point."""
        self.rv_map.specify_binary(
            "build/bin/SingleLocalSimple",
            BinaryType.EXECUTABLE,
            override_entry_point="build/bin/OtherSLSEntry")

        test_query = self.rv_map[ShortCommitHash("745424e3ae")]

        self.assertEqual("build/bin/OtherSLSEntry",
                         str(test_query[0].entry_point))
        self.assertIsInstance(test_query[0].entry_point, Path)

    def test_wrong_contains_check(self) -> None:
        """Check if wrong values are correctly shows as not in the map."""
        self.rv_map.specify_binary("build/bin/SingleLocalSimple",
                                   BinaryType.EXECUTABLE)

        self.assertNotIn("WrongFilename", self.rv_map)

        obj_with_wrong_type = object()
        self.assertNotIn(obj_with_wrong_type, self.rv_map)

    def test_valid_binary_lookup(self) -> None:
        """Check if we can correctly determine the list of valid binaries for a
        specified revision."""
        self.rv_map.specify_binary("build/bin/SingleLocalSimple",
                                   BinaryType.EXECUTABLE)
        self.rv_map.specify_binary("build/bin/SingleLocalMultipleRegions",
                                   BinaryType.EXECUTABLE,
                                   only_valid_in=RevisionRange(
                                       "162db88346", "master"))

        test_query = self.rv_map[ShortCommitHash("162db88346")]
        self.assertSetEqual(
            {x.name
             for x in test_query},
            {"SingleLocalSimple", "SingleLocalMultipleRegions"})

        test_query = self.rv_map[ShortCommitHash("745424e3ae")]
        self.assertSetEqual({x.name
                             for x in test_query}, {"SingleLocalSimple"})
Пример #17
0
    def binaries_for_revision(
        revision: ShortCommitHash
    ) -> tp.List[ProjectBinaryWrapper]:
        binary_map = RevisionBinaryMap(
            get_local_project_git_path(Coreutils.NAME)
        )

        binary_map.specify_binary('src/uniq', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/dircolors', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/numfmt', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/b2sum', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/mv', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/fold', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/dir', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/mkfifo', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/vdir', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/sha512sum', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/unexpand', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/join', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/nproc', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/ptx', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/printf', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/ginstall', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/du', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/printenv', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/groups', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/sync', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/ln', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/shuf', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/false', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/mkdir', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/chmod', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/link', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/cat', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/pwd', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/chown', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/head', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/sleep', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/fmt', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/getlimits', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/test', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/paste', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/comm', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/mknod', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/kill', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/sha384sum', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/sort', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/sum', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/sha224sum', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/expand', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/basenc', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/truncate', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/dd', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/tail', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/df', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/tee', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/tsort', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/yes', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/sha1sum', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/rm', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/make-prime-list', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/logname', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/pathchk', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/whoami', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/wc', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/basename', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/nohup', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/chroot', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/users', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/csplit', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/hostid', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/readlink', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/timeout', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/base64', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/id', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/nl', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/stat', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/cp', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/shred', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/who', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/tr', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/echo', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/date', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/split', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/seq', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/md5sum', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/env', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/expr', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/true', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/chcon', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/chgrp', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/mktemp', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/unlink', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/uname', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/pinky', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/stty', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/rmdir', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/ls', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/runcon', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/nice', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/tty', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/factor', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/tac', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/realpath', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/pr', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/sha256sum', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/cksum', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/touch', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/cut', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/od', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/base32', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/uptime', BinaryType.EXECUTABLE)
        binary_map.specify_binary('src/dirname', BinaryType.EXECUTABLE)

        return binary_map[revision]