จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
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)
ตรวจสอบว่ามีคนขับรถอยู่และอ่านได้หรือไม่
|
ค่าคงที่
ค่าเริ่มต้นหมดเวลา
protected static final int TIMEOUT_DEFAULT
มูลค่าคงที่:
60 ปี
(0x0000003C)
หมดเวลา
public static final int TIMEOUT_NONDETERMINISTIC
มูลค่าคงที่:
315
(0x0000013b)
ช่อง
ชื่อการทดสอบ
public TestName testName
ช่างก่อสร้างสาธารณะ
SecurityTestCase
public SecurityTestCase ()
วิธีการสาธารณะ
VerifyMatch
public void assertMatches (String pattern,
String input)
พารามิเตอร์ |
pattern |
String |
input |
String |
VerifyMatchesMultiLine
public void assertMatchesMultiLine (String pattern,
String input)
พารามิเตอร์ |
pattern |
String |
input |
String |
VerifyNotKernelPointer
public void assertNotKernelPointer (Callable<String> getPtrFunction,
ITestDevice deviceToReboot)
เรียกใช้ฟังก์ชันที่มีให้ที่รวบรวมสตริงเพื่อทดสอบกับการรั่วไหลของตัวชี้เคอร์เนล
การใช้งานฟังก์ชัน getPtrFunction จะต้องแสดงผลสตริงที่ขึ้นต้นด้วยตัวชี้
เช่น "01234567" อนุญาตให้ใช้อักขระต่อท้ายได้ ยกเว้น [0-9a-fA-F] ในกรณีที่
ตัวชี้ดูเหมือนจะมีความเสี่ยง มีการส่งการยืนยัน JUnit ไป เนื่องจากเคอร์เซอร์เคอร์เนลอาจมีลักษณะดังนี้
มีการแฮชแล้ว เป็นไปได้ว่าตัวชี้ที่แฮชจะทับซ้อนกับพื้นที่เคอร์เนลปกติ
ทำการทดสอบซ้ำเพื่อให้ผลบวกลวงไม่มีนัยสำคัญทางสถิติ เมื่อเคอร์เซอร์เคอร์เนลไม่
เปลี่ยนโดยไม่ต้องรีบูต ให้มอบอุปกรณ์ที่จะรีบูต
พารามิเตอร์ |
getPtrFunction |
Callable : ฟังก์ชันที่แสดงผลสตริงที่ขึ้นต้นด้วยตัวชี้ |
deviceToReboot |
ITestDevice : อุปกรณ์ที่จะรีบูตเมื่อเคอร์เซอร์เคอร์เนลไม่เปลี่ยนแปลง
|
VerifyNotMatches
public void assertNotMatches (String pattern,
String input)
พารามิเตอร์ |
pattern |
String |
input |
String |
VerifyNotMatchesMultiLine
public void assertNotMatchesMultiLine (String pattern,
String input)
พารามิเตอร์ |
pattern |
String |
input |
String |
VerifyWifiConnected
public void assertWifiConnected (ITestDevice device)
ยืนยันว่าสถานะการเชื่อมต่อ Wi-Fi มีการเชื่อมต่อ เนื่องจาก STS สามารถรีบูตอุปกรณ์ได้ทันที
ก่อนที่จะทำการทดสอบ Wi-Fi อาจไม่ได้เชื่อมต่อก่อนที่จะทำการทดสอบ เราสำรวจสัญญาณ Wi-Fi จนถึง
หมดเวลาหรือมีการเชื่อมต่อ Wi-Fi
พารามิเตอร์ |
device |
ITestDevice : อุปกรณ์ที่เรียกใช้
|
AttributionIsSupportedNfcDevice
public void assumeIsSupportedNfcDevice (ITestDevice device)
พารามิเตอร์ |
device |
ITestDevice |
บันทึกรายงาน BuildMetrics
public static MetricsReportLog buildMetricsReportLog (ITestDevice device)
พารามิเตอร์ |
device |
ITestDevice |
คิกรีเทิร์น |
MetricsReportLog |
|
CreateWifiHelper
public WifiHelper createWifiHelper ()
การขว้าง |
DeviceNotAvailableException |
|
GetAbi
public static IAbi getAbi (ITestDevice device)
พารามิเตอร์ |
device |
ITestDevice |
getBuildInfo
public static IBuildInfo getBuildInfo (ITestDevice device)
พารามิเตอร์ |
device |
ITestDevice |
getPocPusher
public static PocPusher getPocPusher (ITestDevice device)
พารามิเตอร์ |
device |
ITestDevice |
getTestName
public static String getTestName (ITestDevice device)
พารามิเตอร์ |
device |
ITestDevice |
โมดูลIsPlayManaged
public boolean moduleIsPlayManaged (String modulePackageName)
แสดงค่า "จริง" หากโมดูลมีการเล่น
ตัวอย่างการข้ามการทดสอบตามโมดูลเมนไลน์
@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 ()
ตรวจสอบว่าโทรศัพท์ออนไลน์อยู่และตรวจสอบว่าอุปกรณ์ขัดข้องหรือไม่
อัปเดตเวลา KernelStart
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 |
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-08-23 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"]],["อัปเดตล่าสุด 2024-08-23 UTC"],[],[]]