セキュリティテストケース

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を使用してください。

概要

定数

int TIMEOUT_DEFAULT

int TIMEOUT_NONDETERMINISTIC

田畑

public PocPusher pocPusher

public TestName testName

パブリック コンストラクター

SecurityTestCase ()

公開メソッド

void assertMatches (String pattern, String input)
void assertMatchesMultiLine (String pattern, String input)
void assertNotKernelPointer (Callable<String> getPtrFunction, ITestDevice deviceToReboot)

カーネル ポインター リークをテストするために String を収集する提供された関数を実行します。

void assertNotMatches (String pattern, String input)
void assertNotMatchesMultiLine (String pattern, String input)
void assertWifiConnected (ITestDevice device)

Wi-Fi 接続ステータスが接続済みであることをアサートします。

void assumeIsSupportedNfcDevice (ITestDevice device)
static MetricsReportLog buildMetricsReportLog (ITestDevice device)
WifiHelper createWifiHelper ()
static IAbi getAbi (ITestDevice device)
static IBuildInfo getBuildInfo (ITestDevice device)
static PocPusher getPocPusher (ITestDevice device)
static String getTestName (ITestDevice device)
boolean moduleIsPlayManaged (String modulePackageName)

モジュールが再生管理されている場合は true を返します。

void safeReboot ()
void setUp ()

デバイスがオンラインになるのを待ち、デバイスの最新の起動時間をマークします

void tearDown ()

電話がオンラインであることを確認し、デバイスがクラッシュしたかどうかを確認します

void updateKernelStartTime ()

計画された再起動後に呼び出された場合、テストに合格できるようにします。

保護されたメソッド

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)

田畑

pocPusher

public PocPusher pocPusher

テスト名

public TestName testName

パブリック コンストラクター

セキュリティテストケース

public SecurityTestCase ()

公開メソッド

assertMatches

public void assertMatches (String pattern, 
                String input)

パラメーター
pattern String

input String

スロー
Exception

assertMatchesMultiLine

public void assertMatchesMultiLine (String pattern, 
                String input)

パラメーター
pattern String

input String

スロー
Exception

assertNotKernelPointer

public void assertNotKernelPointer (Callable<String> getPtrFunction, 
                ITestDevice deviceToReboot)

カーネル ポインター リークをテストするために String を収集する提供された関数を実行します。 getPtrFunction 関数の実装は、ポインターで始まる文字列を返す必要があります。つまり、「01234567」です。 [0-9a-fA-F] を除き、末尾の文字を使用できます。ポインターが脆弱であると思われる場合、JUnit アサートがスローされます。カーネル ポインターはハッシュ化できるため、ハッシュ化されたポインターが通常のカーネル空間にオーバーラップする可能性があります。テストが再実行され、偽陽性が統計的に有意でなくなります。再起動しないとカーネル ポインターが変わらない場合は、再起動するデバイスを指定します。

パラメーター
getPtrFunction Callable : ポインタで始まる文字列を返す関数

deviceToReboot ITestDevice : カーネル ポインターが変更されない場合に再起動するデバイス

スロー
Exception

assertNotMatches

public void assertNotMatches (String pattern, 
                String input)

パラメーター
pattern String

input String

スロー
Exception

assertNotMatchesMultiLine

public void assertNotMatchesMultiLine (String pattern, 
                String input)

パラメーター
pattern String

input String

スロー
Exception

assertWifiConnected

public void assertWifiConnected (ITestDevice device)

Wi-Fi 接続ステータスが接続済みであることをアサートします。 STS はテストを実行する直前にデバイスを再起動できるため、テストの実行前に Wi-Fi が接続されていない可能性があります。タイムアウトになるか、wifi が接続されるまで、wifi をポーリングします。

パラメーター
device ITestDevice : 実行するデバイス

スロー
Exception

assumeIsSupportedNfcDevice

public void assumeIsSupportedNfcDevice (ITestDevice device)

パラメーター
device ITestDevice

スロー
Exception

buildMetricsReportLog

public static MetricsReportLog buildMetricsReportLog (ITestDevice device)

パラメーター
device ITestDevice

戻り値
MetricsReportLog

createWifiHelper

public WifiHelper createWifiHelper ()

戻り値
WifiHelper

スロー
DeviceNotAvailableException

getAbi

public static IAbi getAbi (ITestDevice device)

パラメーター
device ITestDevice

戻り値
IAbi

getBuildInfo

public static IBuildInfo getBuildInfo (ITestDevice device)

パラメーター
device ITestDevice

戻り値
IBuildInfo

getPocPusher

public static PocPusher getPocPusher (ITestDevice device)

パラメーター
device ITestDevice

戻り値
PocPusher

getTestName

public static String getTestName (ITestDevice device)

パラメーター
device ITestDevice

戻り値
String

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

戻り値
boolean

スロー
Exception

セーフリブート

public void safeReboot ()

スロー
DeviceNotAvailableException

設定

public void setUp ()

デバイスがオンラインになるのを待ち、デバイスの最新の起動時間をマークします

スロー
Exception

取り壊す

public void tearDown ()

電話がオンラインであることを確認し、デバイスがクラッシュしたかどうかを確認します

スロー
Exception

updateKernelStartTime

public void updateKernelStartTime ()

計画された再起動後に呼び出された場合、テストに合格できるようにします。

スロー
DeviceNotAvailableException

保護されたメソッド

含まれるドライバー

protected boolean containsDriver (ITestDevice device, 
                String driver, 
                boolean checkReadable)

ドライバーがマシンに存在するかどうかを確認します。

パラメーター
device ITestDevice

driver String

checkReadable boolean

戻り値
boolean

スロー
Exception

含まれるドライバー

protected boolean containsDriver (ITestDevice device, 
                String driver)

ドライバーが存在し、読み取り可能かどうかを確認します。

パラメーター
device ITestDevice

driver String

戻り値
boolean

スロー
Exception