Merge "Throw an error if a shell command results in an error."

This commit is contained in:
Sudheer Shanka 2022-04-15 17:37:56 +00:00 • committed by Gerrit Code Review
commit 90a74273e7

View file

@ -25,7 +25,7 @@ import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
import static android.net.wifi.WifiConfiguration.METERED_OVERRIDE_METERED;
import static android.net.wifi.WifiConfiguration.METERED_OVERRIDE_NONE;
import static com.android.compatibility.common.util.SystemUtil.runShellCommand;
import static com.android.compatibility.common.util.SystemUtil.runShellCommandOrThrow;
import static com.android.cts.net.hostside.AbstractRestrictBackgroundNetworkTestCase.TAG;
import static org.junit.Assert.assertEquals;
@ -390,7 +390,7 @@ public class NetworkPolicyTestUtils {
}
public static String executeShellCommand(String command) {
final String result = runShellCommand(command).trim();
final String result = runShellCommandOrThrow(command).trim();
Log.d(TAG, "Output of '" + command + "': '" + result + "'");
return result;
}