fix(windows): protect lifecycle and backup state

This commit is contained in:
2026-08-18 14:05:52 +02:00
parent b6396e66fa
commit ada3f9fc7f
7 changed files with 122 additions and 21 deletions
+12 -1
View File
@@ -16,6 +16,7 @@ import (
"time"
"github.com/aritmolab/thothii/tools/tht/internal/config"
"github.com/aritmolab/thothii/tools/tht/internal/safeio"
)
func TestPreflightReturnsValidatedMetadataAndCallsAllTargetChecksWithoutExtracting(t *testing.T) {
@@ -573,10 +574,20 @@ func preflightTestInstallation(t *testing.T) config.Installation {
if err != nil {
t.Fatal(err)
}
return config.Installation{
installation := config.Installation{
Path: filepath.Join(root, "deploy", "local-dev", "thothii-installation.yaml"),
ProjectDirectory: root,
}
controlParent := filepath.Dir(installation.ControlDirectory())
for _, directory := range []string{controlParent, installation.ControlDirectory()} {
if err := os.MkdirAll(directory, 0o700); err != nil {
t.Fatal(err)
}
if err := safeio.ProtectPrivateDirectory(directory); err != nil {
t.Fatalf("protect preflight fixture directory %q: %v", directory, err)
}
}
return installation
}
func permissivePreflightDependencies() PreflightDependencies {