新增doris的部署内容
This commit is contained in:
@@ -10,57 +10,57 @@ import (
|
||||
*/
|
||||
|
||||
func TestFetchDependencyRepos_Middle(t *testing.T) {
|
||||
|
||||
errorPullImageList, errorGzipImageList, realCmiiImageName, allGzipFileNameList := C_DownloadCompressUploadDependency(true, false, false)
|
||||
|
||||
|
||||
errorPullImageList, errorGzipImageList, realCmiiImageName, allGzipFileNameList := C_DownloadCompressUploadDependency(true, true, false)
|
||||
|
||||
utils.BeautifulPrintListWithTitle(errorPullImageList, "errorPullImageList")
|
||||
utils.BeautifulPrintListWithTitle(errorGzipImageList, "errorGzipImageList")
|
||||
utils.BeautifulPrintListWithTitle(realCmiiImageName, "realCmiiImageName")
|
||||
utils.BeautifulPrintListWithTitle(allGzipFileNameList, "allGzipFileNameList")
|
||||
|
||||
|
||||
}
|
||||
|
||||
func TestFetchDependencyRepos_RKE(t *testing.T) {
|
||||
|
||||
|
||||
errorPullImageList, errorGzipImageList, realCmiiImageName, allGzipFileNameList := C_DownloadCompressUploadDependency(true, false, true)
|
||||
|
||||
|
||||
utils.BeautifulPrintListWithTitle(errorPullImageList, "errorPullImageList")
|
||||
utils.BeautifulPrintListWithTitle(errorGzipImageList, "errorGzipImageList")
|
||||
utils.BeautifulPrintListWithTitle(realCmiiImageName, "realCmiiImageName")
|
||||
utils.BeautifulPrintListWithTitle(allGzipFileNameList, "allGzipFileNameList")
|
||||
|
||||
|
||||
}
|
||||
|
||||
func TestLoadSplitGzipImageToTargetHarbor(t *testing.T) {
|
||||
errorLoadImageNameList, errorPushImageNameList := LoadSplitCmiiGzipImageToTargetHarbor("xmyd", DirectPushDeployHarborHost)
|
||||
|
||||
|
||||
utils.BeautifulPrintListWithTitle(errorLoadImageNameList, "errorLoadImageNameList")
|
||||
utils.BeautifulPrintListWithTitle(errorPushImageNameList, "errorPushImageNameList")
|
||||
}
|
||||
|
||||
func TestLoadSplitDepGzipImageToTargetHarbor(t *testing.T) {
|
||||
errorLoadImageNameList, errorPushImageNameList := LoadSplitDepGzipImageToTargetHarbor(DirectPushDeployHarborHost)
|
||||
|
||||
|
||||
utils.BeautifulPrintListWithTitle(errorLoadImageNameList, "errorLoadImageNameList")
|
||||
utils.BeautifulPrintListWithTitle(errorPushImageNameList, "errorPushImageNameList")
|
||||
}
|
||||
|
||||
func TestPullFromEntityAndSyncConditionally(t *testing.T) {
|
||||
|
||||
|
||||
// 下载镜像的核心函数
|
||||
sync := ImageSyncEntity{
|
||||
DownloadCondition: &DownloadEntity{
|
||||
ShouldDownloadImage: true,
|
||||
ProjectName: "6.2.0_demo",
|
||||
ProjectVersion: "6.2.0-demo",
|
||||
CmiiNameTagList: []string{
|
||||
CmiiNameTagList: []string{
|
||||
//"cmii-uav-mqtthandler:5.4.0-bjdyt-052102",
|
||||
},
|
||||
FullNameImageList: []string{},
|
||||
FullNameImageList: []string{},
|
||||
DownloadAuthUserName: "",
|
||||
DownloadAuthPassword: "",
|
||||
},
|
||||
|
||||
|
||||
CompressCondition: &CompressEntity{
|
||||
ShouldCompressImageToGzip: true,
|
||||
ShouldGzipSplit: true,
|
||||
@@ -72,12 +72,12 @@ func TestPullFromEntityAndSyncConditionally(t *testing.T) {
|
||||
DirectHarborHost: "harbor.wdd.io:8033",
|
||||
ShouldDirectPushToHarbor: false,
|
||||
}
|
||||
|
||||
|
||||
// 调用函数并获取结果。这里需要根据你的实际需求来验证返回的结果是否符合预期。
|
||||
result := sync.PullFromEntityAndSyncConditionally()
|
||||
|
||||
|
||||
utils.BeautifulPrint(result)
|
||||
|
||||
|
||||
// 添加断言以检查函数的输出,例如:
|
||||
// ...其他验证逻辑...
|
||||
}
|
||||
@@ -89,7 +89,7 @@ func TestPullFromEntityAndSyncConditionally_ChongQingErJiPingTai(t *testing.T) {
|
||||
ShouldDownloadImage: true,
|
||||
ProjectName: "cqejpt",
|
||||
ProjectVersion: "",
|
||||
CmiiNameTagList: []string{
|
||||
CmiiNameTagList: []string{
|
||||
//"cmii-uav-mqtthandler:5.4.0-bjdyt-052102",
|
||||
},
|
||||
FullNameImageList: []string{
|
||||
@@ -158,7 +158,7 @@ func TestPullFromEntityAndSyncConditionally_ChongQingErJiPingTai(t *testing.T) {
|
||||
DownloadAuthUserName: "",
|
||||
DownloadAuthPassword: "",
|
||||
},
|
||||
|
||||
|
||||
CompressCondition: &CompressEntity{
|
||||
ShouldCompressImageToGzip: false,
|
||||
ShouldGzipSplit: true,
|
||||
@@ -170,43 +170,43 @@ func TestPullFromEntityAndSyncConditionally_ChongQingErJiPingTai(t *testing.T) {
|
||||
DirectHarborHost: "chongqingshcis-a189ec98.ecis.chongqing-1.cmecloud.cn",
|
||||
ShouldDirectPushToHarbor: true,
|
||||
}
|
||||
|
||||
|
||||
// 调用函数并获取结果。这里需要根据你的实际需求来验证返回的结果是否符合预期。
|
||||
result := sync.PullFromEntityAndSyncConditionally()
|
||||
|
||||
|
||||
utils.BeautifulPrint(result)
|
||||
|
||||
|
||||
// 添加断言以检查函数的输出,例如:
|
||||
// ...其他验证逻辑...
|
||||
}
|
||||
|
||||
func TestDownloadLoadTagUpload(t *testing.T) {
|
||||
|
||||
|
||||
localGzipFileList := []string{
|
||||
"/root/octopus_image/middle",
|
||||
"/root/octopus_image/rke",
|
||||
"/root/octopus_image/xjyd",
|
||||
}
|
||||
|
||||
|
||||
for _, s := range localGzipFileList {
|
||||
log.InfoF("start to sync => %s", s)
|
||||
|
||||
|
||||
targetImageFullNameList := A_DownloadLoadTagUpload(false, "", "", s, "172.28.0.251:8033")
|
||||
|
||||
|
||||
utils.BeautifulPrintListWithTitle(targetImageFullNameList, "targetImageFullNameList")
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
func TestConcatAndUniformCmiiImage(t *testing.T) {
|
||||
// 创建一个模拟的fullImageList和cmiiImageList,用于测试函数的行为。这里需要根据你的实际需求来设置mock数据和预期结果。
|
||||
fullImageList := []string{"image3", "image4"}
|
||||
cmiiImageList := []string{"image1", "image2"}
|
||||
|
||||
|
||||
// 调用函数并获取结果。这里需要根据你的实际需求来验证返回的结果是否符合预期。
|
||||
result := concatAndUniformCmiiImage(fullImageList, cmiiImageList)
|
||||
|
||||
|
||||
// 添加断言以检查函数的输出,例如:
|
||||
expectedResult := []string{"image3", "image4", image2.CmiiHarborPrefix + "image1", image2.CmiiHarborPrefix + "image2"}
|
||||
if len(result) != len(expectedResult) {
|
||||
@@ -228,9 +228,9 @@ func TestImageSyncEntity_PullFromEntityAndSyncConditionally(t *testing.T) {
|
||||
},
|
||||
DirectHarborHost: "36.134.71.138",
|
||||
}
|
||||
|
||||
|
||||
imageSyncResult := imageSyncEntity.PullFromEntityAndSyncConditionally()
|
||||
|
||||
|
||||
utils.BeautifulPrint(imageSyncResult)
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user