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
를 사용하세요.
요약
상수 | |
---|---|
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)
커널 포인터 누출을 테스트할 문자열을 수집하는 제공된 함수를 실행합니다. |
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)
모듈이 Play 관리형인 경우 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)
필드
testName
public TestName testName
공개 생성자
SecurityTestCase
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)
커널 포인터 누출을 테스트할 문자열을 수집하는 제공된 함수를 실행합니다. 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가 연결되지 않을 수 있습니다. 제한 시간이 도래하거나 Wi-Fi가 연결될 때까지 Wi-Fi를 폴링합니다.
매개변수 | |
---|---|
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)
모듈이 Play 관리형인 경우 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 |
safeReboot
public void safeReboot ()
생성 값 | |
---|---|
DeviceNotAvailableException |
setUp
public void setUp ()
기기가 온라인 상태가 될 때까지 기다린 후 기기의 가장 최근 부팅 시간을 표시합니다.
생성 값 | |
---|---|
Exception |
tearDown
public void tearDown ()
휴대전화가 온라인 상태인지 확인하고 기기가 비정상 종료되었는지 확인합니다.
생성 값 | |
---|---|
Exception |
updateKernelStartTime
public void updateKernelStartTime ()
계획된 재부팅 후에 호출되면 테스트가 통과되도록 허용합니다.
생성 값 | |
---|---|
DeviceNotAvailableException |
보호된 메서드
containsDriver
protected boolean containsDriver (ITestDevice device, String driver, boolean checkReadable)
머신에 드라이버가 있는지 확인합니다.
매개변수 | |
---|---|
device |
ITestDevice |
driver |
String |
checkReadable |
boolean |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
Exception |
containsDriver
protected boolean containsDriver (ITestDevice device, String driver)
드라이버가 있고 읽을 수 있는지 확인합니다.
매개변수 | |
---|---|
device |
ITestDevice |
driver |
String |
반환 값 | |
---|---|
boolean |
생성 값 | |
---|---|
Exception |