- Implemented TUI auto-select for automated testing - Fixed TUI automation: autoSelectMsg handling in Update() - Auto-database selection in DatabaseSelector - Created focused test suite (test_as_postgres.sh) - Created retention policy test (test_retention.sh) - All 10 security tests passing Features validated: ✅ Backup retention policy (30 days, min backups) ✅ Rate limiting (exponential backoff) ✅ Privilege checks (root detection) ✅ Resource limit validation ✅ Path sanitization ✅ Checksum verification (SHA-256) ✅ Audit logging ✅ Secure permissions ✅ Configuration persistence ✅ TUI automation framework Test results: 10/10 passed Backup files created with .dump, .sha256, .info Retention cleanup verified (old files removed)
15 lines
362 B
Go
Executable File
15 lines
362 B
Go
Executable File
// +build !windows,!openbsd,!netbsd
|
|
|
|
package restore
|
|
|
|
import "syscall"
|
|
|
|
// getDiskSpace returns available disk space in bytes (Unix/Linux/macOS/FreeBSD)
|
|
func getDiskSpace(path string) (int64, error) {
|
|
var statfs syscall.Statfs_t
|
|
if err := syscall.Statfs(path, &statfs); err != nil {
|
|
return 0, err
|
|
}
|
|
return int64(statfs.Bavail) * int64(statfs.Bsize), nil
|
|
}
|