2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
SecurityTestCase
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)
フィールド
testName
public TestName testName
パブリック コンストラクタ
SecurityTestCase
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)
指定された関数を実行して文字列を収集し、カーネル ポインタリークをテストします。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 が接続されていない可能性があります。タイムアウトするか Wi-Fi が接続されるまで Wi-Fi をポーリングします。
パラメータ |
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)
モジュールが Play 管理対象の場合は true を返します。
Mainline モジュールに基づいてテストをスキップする例:
@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 |
safeReboot
public void safeReboot ()
例外 |
DeviceNotAvailableException |
|
setUp
public void setUp ()
デバイスがオンラインになるまで待機し、デバイスの最新の起動時間をマークします。
tearDown
public void tearDown ()
スマートフォンがオンラインであることを確認して、デバイスがクラッシュしたかどうかを確認します。
updateKernelStartTime
public void updateKernelStartTime ()
計画された再起動後に呼び出された場合に、テストが合格するようにします。
例外 |
DeviceNotAvailableException |
|
保護されたメソッド
containsDriver
protected boolean containsDriver (ITestDevice device,
String driver,
boolean checkReadable)
マシンにドライバが存在するかどうかを確認します。
パラメータ |
device |
ITestDevice |
driver |
String |
checkReadable |
boolean |
containsDriver
protected boolean containsDriver (ITestDevice device,
String driver)
ドライバが存在し、読み取り可能かどうかを確認します。
パラメータ |
device |
ITestDevice |
driver |
String |
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-26 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-26 UTC。"],[],[]]