Skip to content

Commit

Permalink
iutctl: remove undecoded socat logs
Browse files Browse the repository at this point in the history
Log files created on mynewt/zephyr os start are silenced
and replaced with decoded logs implemented in pr auto-pts#1277
  • Loading branch information
piotrnarajowski committed Dec 10, 2024
1 parent 09ada73 commit c4362c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions autopts/ptsprojects/mynewt/iutctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def start(self, test_case):
log("%s.%s", self.__class__, self.start.__name__)

self.test_case = test_case
self.iut_log_file = open(os.path.join(test_case.log_dir, "autopts-iutctl-mynewt.log"), "a")

self.flush_serial()

Expand All @@ -99,8 +98,8 @@ def start(self, test_case):
# socat dies after socket is closed, so no need to kill it
self.socat_process = subprocess.Popen(shlex.split(socat_cmd),
shell=False,
stdout=self.iut_log_file,
stderr=self.iut_log_file)
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)

self.btp_socket.accept()

Expand Down
7 changes: 4 additions & 3 deletions autopts/ptsprojects/zephyr/iutctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def start(self, test_case):

self.is_running = True
self.test_case = test_case
self.iut_log_file = open(os.path.join(test_case.log_dir, "autopts-iutctl-zephyr.log"), "a")

# We will reset HW after BTP socket is open. If the board was
# reset before this happened, it is possible to receive none,
Expand Down Expand Up @@ -136,9 +135,10 @@ def start(self, test_case):
# socat dies after socket is closed, so no need to kill it
self.socat_process = subprocess.Popen(shlex.split(socat_cmd),
shell=False,
stdout=self.iut_log_file,
stderr=self.iut_log_file)
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
elif self.hci is not None:
self.iut_log_file = open(os.path.join(test_case.log_dir, "autopts-iutctl-zephyr.log"), "a")
socat_cmd = ("socat -x -v %%s,rawer,b115200 UNIX-CONNECT:%s &" %
self.btp_address)

Expand All @@ -153,6 +153,7 @@ def start(self, test_case):
stdout=self.iut_log_file,
stderr=self.iut_log_file)
else:
self.iut_log_file = open(os.path.join(test_case.log_dir, "autopts-iutctl-zephyr.log"), "a")
qemu_cmd = get_qemu_cmd(self.kernel_image)

log("Starting QEMU zephyr process: %s", qemu_cmd)
Expand Down

0 comments on commit c4362c9

Please sign in to comment.