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를 반환합니다.
메인라인 모듈을 기반으로 테스트를 건너뛰는 예:
@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 |
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 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)"],[],[]]