mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 12:18:12 +00:00

Test uses staticd which required some C++ header protections. Additionally, the test also runs in the ubuntu20 docker container as grpc is supported there by the packaging system. Signed-off-by: Christian Hopps <chopps@labn.net>
24 lines
707 B
Python
24 lines
707 B
Python
import inspect
|
|
import os
|
|
import subprocess
|
|
import pytest
|
|
import frrtest
|
|
|
|
class TestGRPC(object):
|
|
program = "./test_grpc"
|
|
|
|
@pytest.mark.skipif(
|
|
'S["GRPC_TRUE"]=""\n' not in open("../config.status").readlines(),
|
|
reason="GRPC not enabled",
|
|
)
|
|
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
|
|
)
|
|
output, _ = proc.communicate()
|
|
self.exitcode = proc.wait()
|
|
if self.exitcode != 0:
|
|
raise frrtest.TestExitNonzero(self)
|