Thread: simulate Thread on eth1 for tests

This commit changes OpenThread to simulate on eth1 instead of loopback interface.

Bug: 329188649
Test: presubmit
Change-Id: I80a2842be02c03c5987ac8be8368fa86d7c6bace
This commit is contained in:
Yakun Xu 2024-05-15 08:49:19 +08:00
commit 7bc7d69e1e

View file

@ -78,9 +78,10 @@ public final class FullThreadDevice {
*/
public FullThreadDevice(int nodeId) {
try {
mProcess = Runtime.getRuntime().exec("/system/bin/ot-cli-ftd " + nodeId);
mProcess = Runtime.getRuntime().exec("/system/bin/ot-cli-ftd -Leth1 " + nodeId);
} catch (IOException e) {
throw new IllegalStateException("Failed to start ot-cli-ftd (id=" + nodeId + ")", e);
throw new IllegalStateException(
"Failed to start ot-cli-ftd -Leth1 (id=" + nodeId + ")", e);
}
mReader = new BufferedReader(new InputStreamReader(mProcess.getInputStream()));
mWriter = new BufferedWriter(new OutputStreamWriter(mProcess.getOutputStream()));