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


Tüm STS testleri için temel test sınıfı.

Bunun yerine RootSecurityTestCase veya NonRootSecurityTestCase kullanın.

Özet

Sabitler

int TIMEOUT_DEFAULT

int TIMEOUT_NONDETERMINISTIC

Fields'ın oynadığı filmler

public PocPusher pocPusher

public TestName testName

Herkese açık kurucular

SecurityTestCase()

Herkese açık yöntemler

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

Çekirdek işaretçi sızıntılarına karşı test edilecek bir dize toplayan sağlanan bir işlevi çalıştırır.

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

Kablosuz bağlantı durumunun bağlı olduğunu belirtir.

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)

Bir modül Play tarafından yönetiliyorsa doğru değerini döndürür.

void safeReboot()
void setUp()

Cihazın internete bağlanmasını bekler, cihazın en son açılış zamanını işaretler

void tearDown()

Telefonun internete bağlı olduğundan emin olur ve cihazın kilitlenip kilitlenmediğini kontrol eder.

void updateKernelStartTime()

Planlanmış bir yeniden başlatma işleminden sonra çağrılırsa bir testin geçmesine izin verir.

Korunan yöntemler

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

Bir makinede sürücü olup olmadığını kontrol etme

boolean containsDriver(ITestDevice device, String driver)

Sürücü olup olmadığını ve okunabilir olup olmadığını kontrol edin.

Sabitler

TIMEOUT_DEFAULT

protected static final int TIMEOUT_DEFAULT

Sabit Değer: 60 (0x0000003c)

TIMEOUT_NONDETERMINISTIC

public static final int TIMEOUT_NONDETERMINISTIC

Sabit Değer: 315 (0x0000013b)

Fields'ın oynadığı filmler

pocPusher

public PocPusher pocPusher

testName

public TestName testName

Herkese açık kurucular

SecurityTestCase

public SecurityTestCase ()

Herkese açık yöntemler

assertMatches

public void assertMatches (String pattern, 
                String input)

Parametreler
pattern String

input String

Atışlar
Exception

assertMatchesMultiLine

public void assertMatchesMultiLine (String pattern, 
                String input)

Parametreler
pattern String

input String

Atışlar
Exception

assertNotKernelPointer

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

Çekirdek işaretçi sızıntılarına karşı test edilecek bir dize toplayan sağlanan bir işlevi çalıştırır. getPtrFunction işlevi uygulaması, işaretçiyle başlayan bir dize döndürmelidir. Ör. "01234567". [0-9a-fA-F] hariç son karakterlere izin verilir. İşaretçinin güvenlik açığı olduğu anlaşılırsa bir JUnit assert atılır. Çekirdek işaretçileri karma oluşturmaya uygun olduğundan, karma oluşturma işlemi uygulanmış işaretçinin normal çekirdek alanıyla örtüşme olasılığı vardır. Yanlış pozitiflerin istatistiksel olarak anlamsız hale gelmesi için test yeniden çalıştırılır. Çekirdek işaretçileri yeniden başlatma olmadan değişmediğinde, yeniden başlatılacak bir cihaz sağlayın.

Parametreler
getPtrFunction Callable: İşaretçiyle başlayan bir dize döndüren işlev

deviceToReboot ITestDevice: çekirdek işaretçileri değişmediğinde yeniden başlatılacak cihaz

Atışlar
Exception

assertNotMatches

public void assertNotMatches (String pattern, 
                String input)

Parametreler
pattern String

input String

Atışlar
Exception

assertNotMatchesMultiLine

public void assertNotMatchesMultiLine (String pattern, 
                String input)

Parametreler
pattern String

input String

Atışlar
Exception

assertWifiConnected

public void assertWifiConnected (ITestDevice device)

Kablosuz bağlantı durumunun bağlı olduğunu belirtir. STS, bir testi çalıştırmadan hemen önce cihazı yeniden başlatabileceğinden, test çalıştırılmadan önce kablosuz bağlantı kurulmayabilir. Zaman aşımı olana veya kablosuz bağlantı kurulana kadar kablosuz ağı sorgularız.

Parametreler
device ITestDevice: Çalıştırılacağı cihaz

Atışlar
Exception

assumeIsSupportedNfcDevice

public void assumeIsSupportedNfcDevice (ITestDevice device)

Parametreler
device ITestDevice

Atışlar
Exception

buildMetricsReportLog

public static MetricsReportLog buildMetricsReportLog (ITestDevice device)

Parametreler
device ITestDevice

İlerlemeler
MetricsReportLog

createWifiHelper

public WifiHelper createWifiHelper ()

İlerlemeler
WifiHelper

Atışlar
DeviceNotAvailableException

getAbi

public static IAbi getAbi (ITestDevice device)

Parametreler
device ITestDevice

İlerlemeler
IAbi

getBuildInfo

public static IBuildInfo getBuildInfo (ITestDevice device)

Parametreler
device ITestDevice

İlerlemeler
IBuildInfo

getPocPusher

public static PocPusher getPocPusher (ITestDevice device)

Parametreler
device ITestDevice

İlerlemeler
PocPusher

getTestName

public static String getTestName (ITestDevice device)

Parametreler
device ITestDevice

İlerlemeler
String

moduleIsPlayManaged

public boolean moduleIsPlayManaged (String modulePackageName)

Bir modül Play tarafından yönetiliyorsa doğru değerini döndürür.

Ana hat modüllerine göre bir testi atlama örneği:

  @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...
  }
 

Parametreler
modulePackageName String

İlerlemeler
boolean

Atışlar
Exception

safeReboot

public void safeReboot ()

Atışlar
DeviceNotAvailableException

setUp

public void setUp ()

Cihazın internete bağlanmasını bekler, cihazın en son açılış zamanını işaretler

Atışlar
Exception

tearDown

public void tearDown ()

Telefonun internete bağlı olduğundan emin olur ve cihazın kilitlenip kilitlenmediğini kontrol eder.

Atışlar
Exception

updateKernelStartTime

public void updateKernelStartTime ()

Planlanmış bir yeniden başlatma işleminden sonra çağrılırsa bir testin geçmesine izin verir.

Atışlar
DeviceNotAvailableException

Korunan yöntemler

containsDriver

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

Bir makinede sürücü olup olmadığını kontrol etme

Parametreler
device ITestDevice

driver String

checkReadable boolean

İlerlemeler
boolean

Atışlar
Exception

containsDriver

protected boolean containsDriver (ITestDevice device, 
                String driver)

Sürücü olup olmadığını ve okunabilir olup olmadığını kontrol edin.

Parametreler
device ITestDevice

driver String

İlerlemeler
boolean

Atışlar
Exception