FRRouting / frr

The FRRouting Protocol Suite

Home Page:https://frrouting.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unittest tests/lib/test_grpc.py failing

mwinter-osr opened this issue · comments

Seen in current FRR master as of May 14, 2024
This but probably exists since the beginning, but is only seen with grpc enabled (--enable-grpc) when running the unittests (make check)

The Unittest tests/lib/test_grpc.py fails as it can't find the grpc.so and yang files. The test script expects them to be already installed. Running make check after a make install works, but the unittests are expected to be executed before the install. Building debian or rpm packages with grpc will fail because of this as they run it before the install

../../tests/lib/test_grpc.py::TestGRPC::test_exits_cleanly FAILED        [ 86%]

with the following error

=================================== FAILURES ===================================
_________________________ TestGRPC.test_exits_cleanly __________________________

self = <test_grpc.TestGRPC object at 0x7f7315c1c070>

    @pytest.mark.skipif(
        'S["GRPC_TRUE"]=""\n' not in open("../config.status").readlines(),
        reason="GRPC not enabled",
    )
    @pytest.mark.skipif(
        not os.path.isdir("/usr/share/yang"),
        reason="YANG models aren't installed in /usr/share/yang",
    )
    def test_exits_cleanly(self):
        basedir = os.path.dirname(inspect.getsourcefile(type(self)))
        program = os.path.join(basedir, self.program)
        proc = subprocess.Popen(
            [frrtest.binpath(program)],
            stdin=subprocess.PIPE,
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
        )
        output, _ = proc.communicate()
        self.exitcode = proc.wait()
        if self.exitcode != 0:
            print("OUTPUT:\n" + output.decode("ascii"))
>           raise frrtest.TestExitNonzero(self)
E           frrtest.TestExitNonzero: <test_grpc.TestGRPC object at 0x7f7315c1c070>

../../tests/lib/test_grpc.py:33: TestExitNonzero
----------------------------- Captured stdout call -----------------------------
OUTPUT:
Failed to load grpc module:loader error: dlopen(/home/ci/cibuild.3/debwork/frr-source/build/tests/lib/.libs/../../lib/grpc.so): /home/ci/cibuild.3/debwork/frr-source/build/tests/lib/.libs/../../lib/grpc.so: cannot open shared object file: No such file or directory
Failed to load grpc module:loader error: dlopen(grpc): grpc: cannot open shared object file: No such file or directory
2024/05/15 17:19:29 [HG1WF-2N96F] YANG model "frr-staticd@*" "*@*"not embedded, trying external file
2024/05/15 17:19:29 libyang: Data model "frr-staticd" not found in local searchdirs.
2024/05/15 17:19:29 libyang: Loading "frr-staticd" module failed.
2024/05/15 17:19:29 [XAR87-H157X][EC 100663321] yang_module_load: failed to load data model: frr-staticd