dut

package
v0.0.0-...-434a8ce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChkProgramSuccess    uint = 0         // 检查项成功
	ChkProgramError      uint = 1 << iota // 检查项失败
	ChkMetaInfoFileError                  // 元数据项检查报错
	// precheck阻塞项返回值
	ChkToolsDependError        // 依赖工具项检查报错
	ChkPkgDependError          // precheck、midcheck // 系统存在依赖错误
	ChkCorePkgDependError      // 系统核心包存在依赖错误
	ChkSysDiskOutSpace         // precheck、midcheck(阻塞+非阻塞) 系统盘剩余空间不足
	ChkDataDiskOutSpace        // 数据盘剩余空间不足
	ChkCorePkgNotfound         // precheck、midcheck 系统核心包丢失
	ChkOptionPkgNotfound       // precheck、midcheck 系统可选包丢失
	ChkDpkgVersionNotSupported // DPKG非系统版本
	// midcheck阻塞项返回值
	ChkAptStateError       // 阻塞项,APT安装状态错误
	ChkDpkgStateError      // 阻塞项,DPKG安装状态错误
	ChkPkgListNonexistence // 阻塞项,PkgList清单中的包丢失
	ChkPkgListErrState     // 阻塞项,PkgList清单中的包安装状态错误
	ChkPkgListErrVersion   // 阻塞项,PkgList清单中的包版本错误
	ChkCoreFileMiss        // 阻塞项,系统核心文件丢失
	ChkSysPkgInfoLoadErr   // 阻塞项,当前系统包信息加载失败
	// postcheck阻塞项返回值
	ChkImportantProgressNotRunning // 系统重要进程检查失败

	// midcheck非阻塞项返回值
	ChkCorePkgErrState     // 系统核心包安装状态错误
	ChkCorePkgErrVersion   // 系统核心包版本错误
	ChkOptionPkgErrState   // 系统可选包安装状态错误
	ChkOptionPkgErrVersion // 系统可选包版本错误
	// postcheck非阻塞项返回值
	ChkUuidDirNotExist          // 更新元数据UUID目录不存在
	ChkLogFileNotExist          // 更新日志文件不存在
	ChkLogRmSensitiveInfoFailed // 更新日志脱敏失败
	ChkArchiveFileNotExist      // 更新归档文件不存在
	// dynamic检查
	ChkDynamicScriptErr    // 动态检查失败
	ChkPkgConfigError      // 软件包配置错误
	UpdatePkgInstallFailed // 软件包安装失败
	UpdateRulesCheckFailed // 更新规则检查失败
)
View Source
const (
	PreCheck  checkType = 0
	MidCheck  checkType = 1
	PostCheck checkType = 2
)

Variables

This section is empty.

Functions

func CheckSystem

func CheckSystem(typ checkType, ifOffline bool, cmdArgs []string) *system.JobError

func GenDutMetaFile

func GenDutMetaFile(metaPath, debPath string, pkgMap, coreMap, optionMap, baseMap, removeMap map[string]system.PackageInfo, rules []RuleInfo, repoInfo []RepoInfo) (string, error)

GenDutMetaFile metaPath为DutOnlineMetaConfPath或DutOfflineMetaConfPath

func GetErrorBitMap

func GetErrorBitMap() map[system.JobErrorType]uint

func NewSystem

func NewSystem(nonUnknownList []string, otherList []string) system.System

func OptionToArgs

func OptionToArgs(options map[string]string) []string

Types

type DetailErrorMsg

type DetailErrorMsg struct {
	Code ExtCode
	Msg  []string
}

type DutSystem

type DutSystem struct {
	apt.APTSystem
}

func (*DutSystem) CheckSystem

func (p *DutSystem) CheckSystem(jobId string, checkType string, environ map[string]string, args map[string]string) error

func (*DutSystem) DistUpgrade

func (p *DutSystem) DistUpgrade(jobId string, packages []string, environ map[string]string, args map[string]string) error

func (*DutSystem) FixError

func (p *DutSystem) FixError(jobId string, errType string, environ map[string]string, args map[string]string) error

func (*DutSystem) UpdateSource

func (p *DutSystem) UpdateSource(jobId string, environ map[string]string, args map[string]string) error

type ErrorCode

type ErrorCode int
const (
	ChkSuccess            ErrorCode = 0         // 检查成功
	ChkError              ErrorCode = 1 << iota // 检查失败
	ChkInvalidInput                             // 无效参数输入
	ChkFixPkgDependFailed                       // 软件包配置修复失败
	ChkBlockError                               // 阻塞项检查失败
	ChkNonblockError                            // 非阻塞项检查失败
	ChkDynError                                 // 动态检查失败
)

type ErrorContent

type ErrorContent struct {
	Code    ErrorCode
	Msg     []string
	Ext     DetailErrorMsg
	LogPath []string
}

type ExtCode

type ExtCode uint

type RepoInfo

type RepoInfo struct {
	Name       string
	FilePath   string
	HashSha256 string
}

type RuleInfo

type RuleInfo struct {
	Name    string
	Type    checkType
	Command string
	Argv    string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL