* auto-update: remove the update directory after successful update

This commit is contained in:
Simon Zolin
2019-06-05 18:00:17 +03:00
parent ec5e2be31f
commit a165410c9f
2 changed files with 12 additions and 11 deletions

View File

@@ -12,20 +12,19 @@ func testDoUpdate(t *testing.T) {
pkgURL: "https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.95/AdGuardHome_v0.95_linux_amd64.tar.gz",
pkgName: "./AdGuardHome_v0.95_linux_amd64.tar.gz",
newVer: "v0.95",
updateDir: "./update-v0.95",
backupDir: "./backup-v0.94",
updateDir: "./agh-update-v0.95",
backupDir: "./agh-backup-v0.94",
configName: "./AdGuardHome.yaml",
updateConfigName: "./update-v0.95/AdGuardHome/AdGuardHome.yaml",
updateConfigName: "./agh-update-v0.95/AdGuardHome/AdGuardHome.yaml",
curBinName: "./AdGuardHome",
bkpBinName: "./backup-v0.94/AdGuardHome",
newBinName: "./update-v0.95/AdGuardHome/AdGuardHome",
bkpBinName: "./agh-backup-v0.94/AdGuardHome",
newBinName: "./agh-update-v0.95/AdGuardHome/AdGuardHome",
}
e := doUpdate(&u)
if e != nil {
t.Fatalf("FAILED: %s", e)
}
os.RemoveAll(u.backupDir)
os.RemoveAll(u.updateDir)
}
func testTargzFileUnpack(t *testing.T) {