1 Star 0 Fork 0

坐公交也用券 / glbm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
apt_test.go 910 Bytes
一键复制 编辑 原始数据 按行查看 历史
Nux 提交于 2023-03-30 00:28 . 更新apt安装
package glbm
import (
"fmt"
"testing"
)
// Apt 测试
func TestApt(t *testing.T) {
apt := NewApt("1", true, false)
i := apt.Install("vsftpd")
if i {
fmt.Println("安装成功")
} else {
fmt.Println("Failed to install")
}
// fileMan := "go.deb vsftpd.deb"
// fileList := strings.Split(fileMan, " ")
// s := apt.LocalInstallList(fileList, "测试")
// if s {
// logger.Info("ok")
// }
// f := apt.AptLocalInstallFile("/home/liumou/LinuxData/git/golang/modular/glbm/ApiDpkg.go", "测试")
// if f == nil {
// logger.Info("ok")
// }
}
// 卸载
func TestAptUninstall(t *testing.T) {
apt := NewApt("1", true, true)
r := apt.Uninstall("vsftpd", "ftp")
if r {
fmt.Println("Uninstall is succeeded")
} else {
fmt.Println("Uninstall is Failed")
}
r2 := apt.Uninstall("vsft", "ftp")
if r2 {
fmt.Println("Uninstall is succeeded")
} else {
fmt.Println("Uninstall is Failed")
}
}
Go
1
https://gitee.com/liumou_site/glbm.git
git@gitee.com:liumou_site/glbm.git
liumou_site
glbm
glbm
v1.6.26

搜索帮助