セキュリティテストケース
public class SecurityTestCase
extends StsExtraBusinessLogicHostTestBase
java.lang.Object |
↳ | com.android.tradefed.testtype.junit4.BaseHostJUnit4Test |
| ↳ | com.android.compatibility.common.tradefed.testtype.BusinessLogicHostTestBase |
| | ↳ | com.android.compatibility.common.tradefed.testtype.ExtraBusinessLogicHostTestBase |
| | | ↳ | com.android.sts.common.tradefed.testtype.StsExtraBusinessLogicHostTestBase |
| | | | ↳ | com.android.sts.common.tradefed.testtype.SecurityTestCase |
すべての STS テストのベース テスト クラス。
代わりにRootSecurityTestCase
またはNonRootSecurityTestCase
を使用してください。
概要
保護されたメソッド |
---|
boolean | containsDriver (ITestDevice device, String driver, boolean checkReadable) ドライバーがマシンに存在するかどうかを確認します。 |
boolean | containsDriver (ITestDevice device, String driver) ドライバーが存在し、読み取り可能かどうかを確認します。 |
定数
TIMEOUT_DEFAULT
protected static final int TIMEOUT_DEFAULT
定数値: 60 (0x0000003c)
TIMEOUT_NONDETERMINISTIC
public static final int TIMEOUT_NONDETERMINISTIC
定数値: 315 (0x0000013b)
田畑
テスト名
public TestName testName
パブリック コンストラクター
セキュリティテストケース
public SecurityTestCase ()
公開メソッド
assertMatches
public void assertMatches (String pattern,
String input)
パラメーター |
---|
pattern | String |
input | String |
assertMatchesMultiLine
public void assertMatchesMultiLine (String pattern,
String input)
パラメーター |
---|
pattern | String |
input | String |
assertNotKernelPointer
public void assertNotKernelPointer (Callable<String> getPtrFunction,
ITestDevice deviceToReboot)
カーネル ポインター リークをテストするために String を収集する提供された関数を実行します。 getPtrFunction 関数の実装は、ポインターで始まる文字列を返す必要があります。つまり、「01234567」です。 [0-9a-fA-F] を除き、末尾の文字を使用できます。ポインターが脆弱であると思われる場合、JUnit アサートがスローされます。カーネル ポインターはハッシュ化できるため、ハッシュ化されたポインターが通常のカーネル空間にオーバーラップする可能性があります。テストが再実行され、偽陽性が統計的に有意でなくなります。再起動しないとカーネル ポインターが変わらない場合は、再起動するデバイスを指定します。
パラメーター |
---|
getPtrFunction | Callable : ポインタで始まる文字列を返す関数 |
deviceToReboot | ITestDevice : カーネル ポインターが変更されない場合に再起動するデバイス |
assertNotMatches
public void assertNotMatches (String pattern,
String input)
パラメーター |
---|
pattern | String |
input | String |
assertNotMatchesMultiLine
public void assertNotMatchesMultiLine (String pattern,
String input)
パラメーター |
---|
pattern | String |
input | String |
assertWifiConnected
public void assertWifiConnected (ITestDevice device)
Wi-Fi 接続ステータスが接続済みであることをアサートします。 STS はテストを実行する直前にデバイスを再起動できるため、テストの実行前に Wi-Fi が接続されていない可能性があります。タイムアウトになるか、wifi が接続されるまで、wifi をポーリングします。
パラメーター |
---|
device | ITestDevice : 実行するデバイス |
assumeIsSupportedNfcDevice
public void assumeIsSupportedNfcDevice (ITestDevice device)
buildMetricsReportLog
public static MetricsReportLog buildMetricsReportLog (ITestDevice device)
createWifiHelper
public WifiHelper createWifiHelper ()
スロー |
---|
DeviceNotAvailableException | |
getAbi
public static IAbi getAbi (ITestDevice device)
getBuildInfo
public static IBuildInfo getBuildInfo (ITestDevice device)
getPocPusher
public static PocPusher getPocPusher (ITestDevice device)
getTestName
public static String getTestName (ITestDevice device)
moduleIsPlayManaged
public boolean moduleIsPlayManaged (String modulePackageName)
モジュールが再生管理されている場合は true を返します。
メインライン モジュールに基づくテストをスキップする例:
@Test
public void testPocCVE_1234_5678() throws Exception {
// This will skip the test if MODULE_METADATA mainline module is play managed.
assumeFalse(moduleIsPlayManaged("com.google.android.captiveportallogin"));
// Do testing...
}
パラメーター |
---|
modulePackageName | String |
セーフリブート
public void safeReboot ()
スロー |
---|
DeviceNotAvailableException | |
設定
public void setUp ()
デバイスがオンラインになるのを待ち、デバイスの最新の起動時間をマークします
取り壊す
public void tearDown ()
電話がオンラインであることを確認し、デバイスがクラッシュしたかどうかを確認します
updateKernelStartTime
public void updateKernelStartTime ()
計画された再起動後に呼び出された場合、テストに合格できるようにします。
スロー |
---|
DeviceNotAvailableException | |
保護されたメソッド
含まれるドライバー
protected boolean containsDriver (ITestDevice device,
String driver,
boolean checkReadable)
ドライバーがマシンに存在するかどうかを確認します。
パラメーター |
---|
device | ITestDevice |
driver | String |
checkReadable | boolean |
含まれるドライバー
protected boolean containsDriver (ITestDevice device,
String driver)
ドライバーが存在し、読み取り可能かどうかを確認します。
パラメーター |
---|
device | ITestDevice |
driver | String |