Integrate tests for config protects with uninstall

This commit is contained in:
Daniele Rondina
2020-11-06 23:30:37 +01:00
parent 0f59c207b0
commit c72565e019
3 changed files with 4 additions and 1 deletions

View File

@@ -347,7 +347,8 @@ func (a *PackageArtifact) GetProtectFiles() []string {
cp := NewConfigProtect(annotationDir)
cp.Map(a.Files)
ans = cp.GetProtectFiles()
// NOTE: for unpack we need files path without initial /
ans = cp.GetProtectFiles(false)
}
return ans

View File

@@ -91,6 +91,7 @@ testUnInstall() {
assertTrue 'package uninstalled' "[ ! -e '$tmpdir/testrootfs/c' ]"
# TODO: we need remove it or not??
assertTrue 'config protect created' "[ -e '$tmpdir/testrootfs/etc/a/._cfg0001_conf' ]"
assertTrue 'config protect maintains the protected files' "[ -e '$tmpdir/testrootfs/etc/a/conf' ]"
}

View File

@@ -91,6 +91,7 @@ testUnInstall() {
assertTrue 'package uninstalled' "[ ! -e '$tmpdir/testrootfs/c' ]"
# TODO: we need remove it or not??
assertTrue 'config protect created' "[ -e '$tmpdir/testrootfs/opt/etc/._cfg0001_conf' ]"
assertTrue 'config protect maintains the protected files' "[ -e '$tmpdir/testrootfs/opt/etc/conf' ]"
}