mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
fix(ci): optimize an openthread ci case
This commit is contained in:
parent
bab289ca78
commit
454c3140ad
@ -2,7 +2,6 @@
|
|||||||
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||||
# !/usr/bin/env python3
|
# !/usr/bin/env python3
|
||||||
# this file defines some functions for testing cli and br under pytest framework
|
# this file defines some functions for testing cli and br under pytest framework
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
import struct
|
import struct
|
||||||
@ -411,12 +410,15 @@ def host_publish_service() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def host_close_service() -> None:
|
def host_close_service() -> None:
|
||||||
command = "ps | grep avahi-publish-s | awk '{print $1}'"
|
command = 'ps aux | grep avahi-publish-s'
|
||||||
out_bytes = subprocess.check_output(command, shell=True, timeout=5)
|
out_bytes = subprocess.check_output(command, shell=True, timeout=5)
|
||||||
out_str = out_bytes.decode('utf-8')
|
out_str = out_bytes.decode('utf-8')
|
||||||
the_pid = re.findall(r'(\d+)\n', str(out_str))
|
service_info = [line for line in out_str.splitlines() if 'testxxx _testxxx._udp' in line]
|
||||||
for pid in the_pid:
|
for line in service_info:
|
||||||
|
print('Process:', line)
|
||||||
|
pid = line.split()[1]
|
||||||
command = 'kill -9 ' + pid
|
command = 'kill -9 ' + pid
|
||||||
|
print('kill ', pid)
|
||||||
subprocess.call(command, shell=True, timeout=5)
|
subprocess.call(command, shell=True, timeout=5)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user