Skip to content

Commit

Permalink
Resolved unit tests failures for test_bess.py and placement_constrain…
Browse files Browse the repository at this point in the history
…t.py (#49)

Signed-off-by: Marikkannu, Suresh <[email protected]>
Co-authored-by: gab-arrobo <[email protected]>
  • Loading branch information
sureshmarikkannu and gab-arrobo authored Mar 9, 2024
1 parent 9d7120e commit a64a011
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,21 @@ def test_nat_queue(self):
self.assertFalse(bess.check_constraints())

def test_nat_negative(self):
nat_config = [{'ext_addr': '192.168.1.1'}]
src0 = Source()
src1 = Source()
bess.add_worker(0, 0)
bess.add_worker(1, 1)
nat = NAT(ext_addrs=nat_config)

# This test verifies the scheduling constraint of a module when we
# schedule more workers than the maximum allowed workers for it.
# As part of the commit a742ee6e356d27175dd09af85e970a037aa14a59
# the max_allowed_workers_ was increased to 2 from 1 and it causes
# this test to fail. In order to resolve this issue using the
# StaticNAT() module to validate this constraint. Later need to
# understand the reason for increasing max_allowed_workers_ for
# NAT module

nat = StaticNAT()
src0 -> 0: nat: 1 -> Sink()
src1 -> 1: nat: 0 -> Sink()
src0.attach_task(wid=0)
Expand Down
6 changes: 3 additions & 3 deletions pybess/test_bess.txt → pybess/test_bess.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@

from . import bess
from .builtin_pb import bess_msg_pb2 as bess_msg
from .builtin_pb import service_pb2
from .builtin_pb import service_pb2_grpc


class DummyServiceImpl(service_pb2.BESSControlServicer):
class DummyServiceImpl(service_pb2_grpc.BESSControlServicer):

def __init__(self):
pass
Expand Down Expand Up @@ -72,7 +72,7 @@ class TestBESS(unittest.TestCase):
@classmethod
def setUpClass(cls):
server = grpc.server(futures.ThreadPoolExecutor(max_workers=2))
service_pb2.add_BESSControlServicer_to_server(
service_pb2_grpc.add_BESSControlServicer_to_server(
DummyServiceImpl(),
server)
server.add_insecure_port('[::]:%d' % cls.PORT)
Expand Down

0 comments on commit a64a011

Please sign in to comment.