Skip to content

Commit

Permalink
testing: add cpu_info to the router_benchmark output.
Browse files Browse the repository at this point in the history
  • Loading branch information
jiceatscion committed Dec 11, 2023
1 parent cd47346 commit bc58cf6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion acceptance/router_benchmark/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from collections import namedtuple
from plumbum import cli
from plumbum.cmd import docker, whoami
from plumbum.cmd import docker, whoami, cat
from plumbum import cmd

from acceptance.common import base
Expand Down Expand Up @@ -60,6 +60,12 @@ def mac_for_ip(ip: str) -> str:
return 'f0:0d:ca:fe:{:02x}:{:02x}'.format(int(ipBytes[2]), int(ipBytes[3]))


# Dump the cpu info into the log just to inform our thoughts on performance variability.
def log_cpu_info():
cpu_info = cat('/proc/cpuinfo')
logger.info(f"CPU INFO BEGINS\n{cpu_info}\nCPU_INFO ENDS")


class RouterBMTest(base.TestBase):
"""
Tests that the implementation of a router has sufficient performance in terms of packets
Expand Down Expand Up @@ -148,6 +154,9 @@ def create_interface(self, req: IntfReq, ns: str):
def setup_prepare(self):
super().setup_prepare()

# As the name inplies.
log_cpu_info()

# get the config where the router can find it.
shutil.copytree("acceptance/router_benchmark/conf/", self.artifacts / "conf")

Expand Down

0 comments on commit bc58cf6

Please sign in to comment.