KernelTargetTest

public class KernelTargetTest
extends ExecutableTargetTest

java.lang.Object
   ↳ com.android.tradefed.testtype.binary.ExecutableBaseTest
     ↳ com.android.tradefed.testtype.binary.ExecutableTargetTest
       ↳ com.android.tradefed.testtype.binary.KernelTargetTest


Test runner for executable running on the target and parsing tesult of kernel test.

Summary

Public constructors

KernelTargetTest()

Public methods

boolean compareKernelVersion(String minKernelVersion)

Check if the kernel version meets or exceeds the minimum kernel version for this test.

String findBinary(String binary)

Skips the binary check in findBinary.

Integer getDeviceKernelVersion()

Get the device kernel version with uname -r.

Integer parseKernelVersion(String version)

Parse the kernel version, major revision, and, optionally, the minimum revision from a version string into a single integer that can used for numerical comparison.

void run(TestInformation testInfo, ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

void runBinary(String binaryPath, ITestInvocationListener listener, TestDescription description)

Actually run the binary at the given path.

Protected methods

void checkCommandResult(CommandResult result, ITestInvocationListener listener, TestDescription description)

Check the result of the test command.

Public constructors

KernelTargetTest

public KernelTargetTest ()

Public methods

compareKernelVersion

public boolean compareKernelVersion (String minKernelVersion)

Check if the kernel version meets or exceeds the minimum kernel version for this test.

Parameters
minKernelVersion String: the min version string from the config.

Returns
boolean

findBinary

public String findBinary (String binary)

Skips the binary check in findBinary. Redundant with mSkipBinaryCheck but needed for backwards compatibility.

Parameters
binary String: the path of the binary or simply the binary name.

Returns
String The path to the binary, or null if not found.

Throws
DeviceNotAvailableException

getDeviceKernelVersion

public Integer getDeviceKernelVersion ()

Get the device kernel version with uname -r.

Returns
Integer

Throws
DeviceNotAvailableException

parseKernelVersion

public Integer parseKernelVersion (String version)

Parse the kernel version, major revision, and, optionally, the minimum revision from a version string into a single integer that can used for numerical comparison.

Parameters
version String: linux version string.

Returns
Integer

run

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

Parameters
testInfo TestInformation: The TestInformation object containing useful information to run tests.

listener ITestInvocationListener: the ITestInvocationListener of test results

Throws
DeviceNotAvailableException

runBinary

public void runBinary (String binaryPath, 
                ITestInvocationListener listener, 
                TestDescription description)

Actually run the binary at the given path.

Parameters
binaryPath String: The path of the binary.

listener ITestInvocationListener: The listener where to report the results.

description TestDescription: The test in progress.

Throws
DeviceNotAvailableException

Protected methods

checkCommandResult

protected void checkCommandResult (CommandResult result, 
                ITestInvocationListener listener, 
                TestDescription description)

Check the result of the test command.

Parameters
result CommandResult: test result of the command CommandResult

listener ITestInvocationListener: the ITestInvocationListener

description TestDescription: The test in progress.