Merge "Throw an error if a shell command results in an error." am: 90a74273e7

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2064787

Change-Id: I0ea6c58e8f48f32ccbcf42c2c07f42c66c453c86
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Sudheer Shanka 2022-04-15 17:53:47 +00:00 • committed by Automerger Merge Worker
commit dccd4d04ad

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;
}