GkiDeviceFlashPreparer

public class GkiDeviceFlashPreparer
extends BaseTargetPreparer implements ILabPreparer

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.GkiDeviceFlashPreparer


Android 공통 커널 일반 이미지로 기기를 플래시하는 타겟 준비자 자세한 내용은 https://source.android.com/devices/architecture/kernel/android-common을 참고하세요.

요약

공개 생성자

GkiDeviceFlashPreparer()

공개 메서드

void setUp(TestInformation testInfo)

테스트를 위해 타겟 설정을 실행합니다.

void validateGkiBootImg(ITestDevice device, IBuildInfo buildInfo)

GKI 부팅 이미지가 예상대로인지 확인

보호된 메서드

void addHashFooter(ITestDevice device, IBuildInfo buildInfo, File tmpDir)

GKI 부팅 이미지가 예상대로인지 확인

void buildGkiSystemDlkmImg(ITestDevice device, IBuildInfo buildInfo, File tmpDir)

system_dlkm 보관 파일이 제공된 경우 GKI system_dlkm 이미지 빌드

File extractSystemDlkmTarGzip(File systemDlkmArchive)

system_dlkm tar gzip 파일을 system_dlkm_staging 폴더에 추출합니다.

void flattenSystemDlkm(ITestDevice device, File systemDlkmStagingDir)

모든 커널 모듈이 /lib/modules 바로 아래에 있도록 system_dlkm 스테이징 디렉터리를 평면화합니다.

String[] getDeviceKernelVersion(ITestDevice device)

플래시하기 전에 기기에서 기기 커널 버전을 가져옵니다.

IHostOptions getHostOptions()

IHostOptions 참조 가져오기

String[] getKernelVersionFromImage(File image)

boot/vendor_boot/system_dlkm/vendor_dlkm 이미지 파일에서 커널 버전을 추출합니다.

File getRequestedFile(ITestDevice device, String requestedFileName, File sourceFile, File tmpDir)

요청된 파일 이름으로 소스 파일 (zip 또는 폴더)에서 요청된 파일을 가져옵니다.

IRunUtil getRunUtil()

사용할 IRunUtil 인스턴스를 가져옵니다.

String[] parseKernelVersion(String source, String kernelVersionString)
void validateGkiBootImg(ITestDevice device, IBuildInfo buildInfo, File tmpDir)

GKI 부팅 이미지가 예상대로인지 확인

void validateKernelCompatibility(String imageName, String[] imageVersion, String[] bootVersion, ITestDevice device)
void validateKernelVersion(ITestDevice device, IBuildInfo buildInfo, File tmpDir)

이미지의 커널 버전이 예상대로인지 확인합니다.

공개 생성자

GkiDeviceFlashPreparer

public GkiDeviceFlashPreparer ()

공개 메서드

setUp

public void setUp (TestInformation testInfo)

테스트를 위해 타겟 설정을 실행합니다.

매개변수
testInfo TestInformation: 호출의 TestInformation입니다.

생성 값
BuildError
DeviceNotAvailableException
TargetSetupError

validateGkiBootImg

public void validateGkiBootImg (ITestDevice device, 
                IBuildInfo buildInfo)

GKI 부팅 이미지가 예상대로인지 확인 (지원 중단됨. tmpDir을 제공하여 호출하세요)

매개변수
device ITestDevice: ITestDevice

buildInfo IBuildInfo: 빌드 정보 IBuildInfo

생성 값
TargetSetupError 유효한 gki boot.img가 없는 경우

보호된 메서드

addHashFooter

protected void addHashFooter (ITestDevice device, 
                IBuildInfo buildInfo, 
                File tmpDir)

GKI 부팅 이미지가 예상대로인지 확인 유효한 boot.img가 없으면 예외를 발생시킴

매개변수
device ITestDevice: ITestDevice

buildInfo IBuildInfo: 빌드 정보 IBuildInfo

tmpDir File: 임시 디렉터리 File

생성 값
TargetSetupError 유효한 gki boot.img가 없는 경우
DeviceNotAvailableException

buildGkiSystemDlkmImg

protected void buildGkiSystemDlkmImg (ITestDevice device, 
                IBuildInfo buildInfo, 
                File tmpDir)

system_dlkm 보관 파일이 제공된 경우 GKI system_dlkm 이미지 빌드

매개변수
device ITestDevice: ITestDevice

buildInfo IBuildInfo: 빌드 정보 IBuildInfo

tmpDir File: 임시 디렉터리 File

생성 값
TargetSetupError 이미지 파일을 빌드하는 중에 오류가 발생한 경우

extractSystemDlkmTarGzip

protected File extractSystemDlkmTarGzip (File systemDlkmArchive)

system_dlkm tar gzip 파일을 system_dlkm_staging 폴더에 추출합니다. 이 함수는 단위 테스트를 위해 압축 해제를 스텁하기 위해 ERROR(/TarUtil.extractTarGzipToTemp)를 래핑합니다.

매개변수
systemDlkmArchive File: GKI 모듈이 포함된 system_dlkm tar gzip 파일입니다.

반환
File system_dlkm tar gzip 콘텐츠가 포함된 파일

생성 값
java.io.IOException
IOException

flattenSystemDlkm

protected void flattenSystemDlkm (ITestDevice device, 
                File systemDlkmStagingDir)

모든 커널 모듈이 /lib/modules 바로 아래에 있도록 system_dlkm 스테이징 디렉터리를 평면화합니다. 이는 플랫폼 빌드의 예상 system_dlkm 파일 레이아웃과 일치하는 데 필요합니다.

매개변수
device ITestDevice: ITestDevice

systemDlkmStagingDir File: system_dlkm 스테이징 디렉터리 File

생성 값
IOException 또는 system_dlkm을 평탄화하는 데 오류가 있는 경우 TargetSetupError
TargetSetupError

getDeviceKernelVersion

protected String[] getDeviceKernelVersion (ITestDevice device)

플래시하기 전에 기기에서 기기 커널 버전을 가져옵니다.

매개변수
device ITestDevice: 커널 버전을 가져올 ITestDevice입니다.

반환
String[] 파싱된 커널 버전 정보 [kernelVersion, patchLevel, pageSize]가 포함된 ERROR(/String[]) 버전 문자열을 파싱할 수 없는 경우 null을 반환합니다.2

생성 값
DeviceNotAvailableException

getHostOptions

protected IHostOptions getHostOptions ()

IHostOptions 참조 가져오기

반환
IHostOptions 사용할 IHostOptions

getKernelVersionFromImage

protected String[] getKernelVersionFromImage (File image)

boot/vendor_boot/system_dlkm/vendor_dlkm 이미지 파일에서 커널 버전을 추출합니다. 이 메서드는 boot/vendor_boot/system_dlkm/vendor_dlkm 이미지 파일을 읽고 Android 커널 버전 문자열에서 특정 패턴을 검색합니다. 그런 다음 발견된 문자열을 파싱하여 표준화된 형식으로 커널 버전을 추출합니다.

매개변수
image File: 부팅 이미지 파일 (예: boot.img)의 File입니다.

반환
String[] 파싱된 커널 버전 정보 [kernelVersion, patchLevel, pageSize]가 포함된 ERROR(/String[]) 버전 문자열을 파싱할 수 없는 경우 null을 반환합니다.

getRequestedFile

protected File getRequestedFile (ITestDevice device, 
                String requestedFileName, 
                File sourceFile, 
                File tmpDir)

요청된 파일 이름으로 소스 파일 (zip 또는 폴더)에서 요청된 파일을 가져옵니다.

제공된 소스 파일은 ZIP 파일일 수 있습니다. 이 메서드는 임시 디렉터리에 압축을 해제하고 제공된 파일 이름으로 요청된 파일을 찾습니다.

제공된 소스 파일은 파일 폴더일 수 있습니다. 이 메서드는 제공된 파일 이름으로 요청된 파일을 찾습니다.

매개변수
device ITestDevice: ITestDevice

requestedFileName String: 요청된 파일 이름 문자열

sourceFile File: 소스 파일

tmpDir File

반환
File 요청된 파일 이름으로 지정된 파일

생성 값
com.android.tradefed.targetprep.TargetSetupError
TargetSetupError

getRunUtil

protected IRunUtil getRunUtil ()

사용할 IRunUtil 인스턴스를 가져옵니다.

반환
IRunUtil 사용할 IRunUtil

parseKernelVersion

protected String[] parseKernelVersion (String source, 
                String kernelVersionString)

매개변수
source String

kernelVersionString String

반환
String[]

validateGkiBootImg

protected void validateGkiBootImg (ITestDevice device, 
                IBuildInfo buildInfo, 
                File tmpDir)

GKI 부팅 이미지가 예상대로인지 확인 유효한 boot.img가 없으면 예외를 발생시킴

매개변수
device ITestDevice: ITestDevice

buildInfo IBuildInfo: 빌드 정보 IBuildInfo

tmpDir File: 임시 디렉터리 File

생성 값
TargetSetupError 유효한 gki boot.img가 없는 경우

validateKernelCompatibility

protected void validateKernelCompatibility (String imageName, 
                String[] imageVersion, 
                String[] bootVersion, 
                ITestDevice device)

매개변수
imageName String

imageVersion String

bootVersion String

device ITestDevice

생성 값
TargetSetupError

validateKernelVersion

protected void validateKernelVersion (ITestDevice device, 
                IBuildInfo buildInfo, 
                File tmpDir)

이미지의 커널 버전이 예상대로인지 확인합니다. 유효하지 않은 경우 예외를 발생시킵니다.

매개변수
device ITestDevice: ITestDevice

buildInfo IBuildInfo: 빌드 정보 IBuildInfo

tmpDir File: 임시 디렉터리 File

생성 값
TargetSetupError 유효한 gki boot.img가 없는 경우
DeviceNotAvailableException