Print the result of command when test is failed

When ConnectivityManagerTest#testGetMultipathPreference() is
failed, it only prints "Unexpected format from cmd netpolicy" and
it's not helpful.
Print the result of command can help people to know what's the
difference between expected result and actual result.

Bug: 187921745
Test: atest CtsNetTestCases:ConnectivityManagerTest#testGetMultipathPreference
Change-Id: I63cd4b043e7c70775156aa5244d25ee2268f9f32
This commit is contained in:
lucaslin
2021-06-28 16:50:38 +08:00
parent a569410667
commit 5fe3926a11

View File

@@ -1084,7 +1084,7 @@ public class ConnectivityManagerTest {
final Matcher m = Pattern.compile("^" + ssid + ";(true|false|none)$",
Pattern.MULTILINE | Pattern.UNIX_LINES).matcher(policyString);
if (!m.find()) {
fail("Unexpected format from cmd netpolicy");
fail("Unexpected format from cmd netpolicy, policyString = " + policyString);
}
return m.group(1);
}