xref: /OK3568_Linux_fs/yocto/poky/meta/lib/oeqa/selftest/cases/intercept.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunfrom oeqa.selftest.case import OESelftestTestCase
2*4882a593Smuzhiyunfrom oeqa.utils.commands import bitbake
3*4882a593Smuzhiyun
4*4882a593Smuzhiyunclass GitCheck(OESelftestTestCase):
5*4882a593Smuzhiyun    def test_git_intercept(self):
6*4882a593Smuzhiyun        """
7*4882a593Smuzhiyun        Git binaries with CVE-2022-24765 fixed will refuse to operate on a
8*4882a593Smuzhiyun        repository which is owned by a different user. This breaks our
9*4882a593Smuzhiyun        do_install task as that runs inside pseudo, so the git repository is
10*4882a593Smuzhiyun        owned by the build user but git is running as (fake)root.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun        We have an intercept which disables pseudo, so verify that it works.
13*4882a593Smuzhiyun        """
14*4882a593Smuzhiyun        bitbake("git-submodule-test -c test_git_as_user")
15*4882a593Smuzhiyun        bitbake("git-submodule-test -c test_git_as_root")
16