You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package Test
import (
"dsTools/Utils/ConfigUtil"
"dsTools/Utils/NetUtil"
"dsTools/Utils/ObsUtil"
"testing"
)
func TestObsList ( t * testing . T ) {
//计算上报机的MAC
macAddress := NetUtil . GetMacAddrs ( ) [ 0 ]
//为了方便测试, 再次赋值已有备份的服务器mac
macAddress = "00-50-56-BA-1D-4B"
var prefix = ObsUtil . BackupPrefix + "/" + ConfigUtil . InstallAreaCode + "/" + macAddress
ObsUtil . DeleteExpireFile ( prefix , ObsUtil . RemainDays )
}
func TestObsUpload ( t * testing . T ) {
//测试用的文件
macAddress := NetUtil . GetMacAddrs ( ) [ 0 ]
var prefix = ObsUtil . BackupPrefix + "/" + ConfigUtil . InstallAreaCode + "/" + macAddress
key := prefix + "/" + "usr.zip"
sourceFile := "E:\\usr.zip"
ObsUtil . UploadFileMultiPart ( key , sourceFile )
}
// ./obsutil config -i=WAFBGJACKDOQZDH1MKZ1 -k=dlWTUbqgCICaYJG3n0Rot4jXaen2HnfFtMVxiPEo -e=obs.cn-north-1.myhuaweicloud.com
// ./obsutil cp /usr/local/Backup/gogs_20210407080658.tar.gz obs://dsideal/gogs_20210407080658.tar.gz