Skip to content

Commit bf02c8b

Browse files
committed
Update variable names, remove only one site of network interface
1 parent 6a1f93a commit bf02c8b

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

scripts/tests/chiptest/linux.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def EnsurePrivateState():
6464
sys.exit(1)
6565

6666

67-
def CreateNamespacesForAppTest(wifi_ble_config: bool = False):
67+
def CreateNamespacesForAppTest(ble_wifi: bool = False):
6868
"""
6969
Creates appropriate namespaces for a tool and app binaries in a simulated
7070
isolated network.
@@ -106,7 +106,7 @@ def CreateNamespacesForAppTest(wifi_ble_config: bool = False):
106106
"ip link set dev eth-ci-switch up",
107107
]
108108

109-
if not wifi_ble_config:
109+
if not ble_wifi:
110110
COMMANDS += [
111111
"ip link add eth-app-direct type veth peer name eth-tool-direct",
112112
"ip link set eth-app-direct netns app",
@@ -144,7 +144,7 @@ def CreateNamespacesForAppTest(wifi_ble_config: bool = False):
144144
logging.warn("Some addresses look to still be tentative")
145145

146146

147-
def RemoveNamespaceForAppTest(wifi_ble_config: bool = False):
147+
def RemoveNamespaceForAppTest(ble_wifi: bool = False):
148148
"""
149149
Removes namespaces for a tool and app binaries previously created to simulate an
150150
isolated network. This tears down what was created in CreateNamespacesForAppTest.
@@ -165,12 +165,11 @@ def RemoveNamespaceForAppTest(wifi_ble_config: bool = False):
165165
"ip netns del app",
166166
]
167167

168-
if not wifi_ble_config:
168+
if not ble_wifi:
169169
COMMANDS += [
170170
"ip link set dev eth-app-direct down",
171171
"ip link set dev eth-tool-direct down",
172172
"ip link delete eth-tool-direct",
173-
"ip link delete eth-app-direct",
174173
]
175174

176175
for command in COMMANDS:
@@ -181,17 +180,17 @@ def RemoveNamespaceForAppTest(wifi_ble_config: bool = False):
181180
sys.exit(1)
182181

183182

184-
def PrepareNamespacesForTestExecution(in_unshare: bool, wifi_ble_config: bool = False):
183+
def PrepareNamespacesForTestExecution(in_unshare: bool, ble_wifi: bool = False):
185184
if not in_unshare:
186185
EnsureNetworkNamespaceAvailability()
187186
elif in_unshare:
188187
EnsurePrivateState()
189188

190-
CreateNamespacesForAppTest(wifi_ble_config)
189+
CreateNamespacesForAppTest(ble_wifi)
191190

192191

193-
def ShutdownNamespaceForTestExecution(wifi_ble_config: bool = False):
194-
RemoveNamespaceForAppTest(wifi_ble_config)
192+
def ShutdownNamespaceForTestExecution(ble_wifi: bool = False):
193+
RemoveNamespaceForAppTest(ble_wifi)
195194

196195

197196
class DbusTest:

0 commit comments

Comments
 (0)