mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-17 02:22:17 +00:00
tests: lib: fix grpc unit-test
Signed-off-by: Christian Hopps <chopps@labn.net>
This commit is contained in:
parent
db0a45d0d6
commit
c451c0296c
@ -1,8 +1,10 @@
|
|||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import pytest
|
|
||||||
import frrtest
|
import frrtest
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
class TestGRPC(object):
|
class TestGRPC(object):
|
||||||
program = "./test_grpc"
|
program = "./test_grpc"
|
||||||
@ -15,9 +17,13 @@ class TestGRPC(object):
|
|||||||
basedir = os.path.dirname(inspect.getsourcefile(type(self)))
|
basedir = os.path.dirname(inspect.getsourcefile(type(self)))
|
||||||
program = os.path.join(basedir, self.program)
|
program = os.path.join(basedir, self.program)
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
[frrtest.binpath(program)], stdin=subprocess.PIPE, stdout=subprocess.PIPE
|
[frrtest.binpath(program)],
|
||||||
|
stdin=subprocess.PIPE,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
)
|
)
|
||||||
output, _ = proc.communicate()
|
output, _ = proc.communicate()
|
||||||
self.exitcode = proc.wait()
|
self.exitcode = proc.wait()
|
||||||
if self.exitcode != 0:
|
if self.exitcode != 0:
|
||||||
|
print("OUTPUT:\n" + output.decode("ascii"))
|
||||||
raise frrtest.TestExitNonzero(self)
|
raise frrtest.TestExitNonzero(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user