Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unittest tests/lib/test_grpc.py failing #16017

Open
mwinter-osr opened this issue May 15, 2024 · 1 comment
Open

unittest tests/lib/test_grpc.py failing #16017

mwinter-osr opened this issue May 15, 2024 · 1 comment

Comments

@mwinter-osr
Copy link
Member

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
@choppsv1
Copy link
Contributor

#16024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants