From be873ead5c1443b0c3e3c14946973b9f737a8431 Mon Sep 17 00:00:00 2001 From: Renz Date: Mon, 10 Nov 2025 13:18:04 +0000 Subject: [PATCH] chore:push --- TEST_PLAN.md | 251 ---- TEST_RESULTS_SUMMARY.md | 160 -- test_results_20251110_090957.txt | 2331 ------------------------------ 3 files changed, 2742 deletions(-) delete mode 100644 TEST_PLAN.md delete mode 100644 TEST_RESULTS_SUMMARY.md delete mode 100644 test_results_20251110_090957.txt diff --git a/TEST_PLAN.md b/TEST_PLAN.md deleted file mode 100644 index 29a66b2..0000000 --- a/TEST_PLAN.md +++ /dev/null @@ -1,251 +0,0 @@ -# DBBackup Comprehensive Test Plan - -**Date**: November 10, 2025 -**Goal**: Test all command-line and interactive functions to ensure stability - -## Issues Found - -### ๐Ÿ› BUG #1: `--create` flag not implemented in single database restore -**Severity**: HIGH -**Location**: `internal/restore/engine.go` - `RestoreSingle()` function -**Description**: The `createIfMissing` parameter is accepted but never used. Function doesn't create target database. -**Expected**: When `--create` flag is used, should create database if it doesn't exist -**Actual**: Fails with "database does not exist" error -**Fix Required**: Add database creation logic before restore - ---- - -## Test Matrix - -### 1. BACKUP OPERATIONS - -#### 1.1 Single Database Backup -| Test Case | Command | Expected Result | Status | -|-----------|---------|-----------------|--------| -| Basic backup | `backup single ownership_test` | โœ… Success | โœ… PASS | -| With compression level | `backup single ownership_test --compression=9` | Success with higher compression | โณ TODO | -| With custom backup dir | `backup single ownership_test --backup-dir=/tmp/backups` | Success, file in /tmp/backups | โณ TODO | -| Non-existent database | `backup single nonexistent_db` | Error: database does not exist | โณ TODO | -| Without permissions | `backup single postgres` (as non-postgres user) | Error: authentication failed | โณ TODO | - -#### 1.2 Cluster Backup -| Test Case | Command | Expected Result | Status | -|-----------|---------|-----------------|--------| -| Basic cluster backup | `backup cluster` | โœ… Success, all DBs backed up | โœ… PASS | -| With parallel jobs | `backup cluster --jobs=4` | Success with 4 parallel jobs | โณ TODO | -| With custom compression | `backup cluster --compression=1` | Fast backup, larger file | โณ TODO | -| Disk space insufficient | `backup cluster` (low disk space) | Error: insufficient disk space | โณ TODO | - ---- - -### 2. RESTORE OPERATIONS - -#### 2.1 Single Database Restore -| Test Case | Command | Expected Result | Status | -|-----------|---------|-----------------|--------| -| Basic restore | `restore single backup.dump --target=test_db --confirm` | Database exists: Success | โณ TODO | -| With --create flag | `restore single backup.dump --target=new_db --create --confirm` | โŒ BUG: Database not created | โŒ **BUG #1** | -| With --clean flag | `restore single backup.dump --target=existing_db --clean --confirm` | Drop + Restore success | โณ TODO | -| Dry-run mode | `restore single backup.dump --target=test_db --dry-run` | Show plan, no changes | โณ TODO | -| Without --confirm | `restore single backup.dump --target=test_db` | Show dry-run automatically | โณ TODO | -| Non-existent file | `restore single /tmp/nonexistent.dump --confirm` | Error: file not found | โณ TODO | -| Corrupted archive | `restore single corrupted.dump --confirm` | Error: invalid archive | โณ TODO | -| Wrong format | `restore single cluster.tar.gz --confirm` | Error: not a single DB backup | โณ TODO | - -#### 2.2 Cluster Restore -| Test Case | Command | Expected Result | Status | -|-----------|---------|-----------------|--------| -| Basic cluster restore | `restore cluster backup.tar.gz --confirm` | โœ… All DBs restored with ownership | โœ… PASS | -| Dry-run mode | `restore cluster backup.tar.gz --dry-run` | Show restore plan | โณ TODO | -| Without --confirm | `restore cluster backup.tar.gz` | Show dry-run automatically | โณ TODO | -| Non-superuser | `restore cluster backup.tar.gz --confirm` (non-superuser) | Warning: limited ownership | โณ TODO | -| Disk space insufficient | `restore cluster backup.tar.gz --confirm` | Error: insufficient disk space | โณ TODO | -| With --force flag | `restore cluster backup.tar.gz --force --confirm` | Skip safety checks | โณ TODO | - -#### 2.3 Restore List -| Test Case | Command | Expected Result | Status | -|-----------|---------|-----------------|--------| -| List all backups | `restore list` | โœ… Show all backup files | โœ… PASS | -| List with filter | `restore list --database=test_db` | Show only test_db backups | โณ TODO | -| Empty backup dir | `restore list` (no backups) | Show "No backups found" | โณ TODO | - ---- - -### 3. STATUS OPERATIONS - -| Test Case | Command | Expected Result | Status | -|-----------|---------|-----------------|--------| -| Basic status | `status` | Show database list | โณ TODO | -| Detailed status | `status --detailed` | Show with sizes/counts | โณ TODO | -| JSON format | `status --format=json` | Valid JSON output | โณ TODO | -| Filter by database | `status --database=test_db` | Show only test_db | โณ TODO | - ---- - -### 4. INTERACTIVE MODE (TUI) - -#### 4.1 Main Menu Navigation -| Test Case | Action | Expected Result | Status | -|-----------|--------|-----------------|--------| -| Launch TUI | `./dbbackup` or `./dbbackup interactive` | Show main menu | โณ TODO | -| Navigate with arrows | Up/Down arrows | Highlight moves | โณ TODO | -| Select with Enter | Enter key on option | Execute option | โณ TODO | -| Quit with q | Press 'q' | Exit gracefully | โณ TODO | -| Ctrl+C handling | Press Ctrl+C | Exit gracefully | โณ TODO | - -#### 4.2 Backup Single Database (TUI) -| Test Case | Action | Expected Result | Status | -|-----------|--------|-----------------|--------| -| Select database | Choose from list | Database selected | โณ TODO | -| Confirm backup | Confirm dialog | Backup starts | โณ TODO | -| Cancel backup | Cancel dialog | Return to menu | โณ TODO | -| Progress display | During backup | Show progress bar | โณ TODO | -| Completion message | After success | Show success message | โณ TODO | -| Error handling | Backup fails | Show error, don't crash | โณ TODO | - -#### 4.3 Backup Cluster (TUI) -| Test Case | Action | Expected Result | Status | -|-----------|--------|-----------------|--------| -| Confirm cluster backup | Confirm dialog | Backup all DBs | โณ TODO | -| Progress tracking | During backup | Show N/M databases | โณ TODO | -| ETA display | Long operation | Show time remaining | โณ TODO | -| Error on one DB | One DB fails | Continue with others | โณ TODO | - -#### 4.4 Restore Single Database (TUI) -| Test Case | Action | Expected Result | Status | -|-----------|--------|-----------------|--------| -| Select archive | Choose from list | Archive selected | โณ TODO | -| Select target DB | Choose/enter name | Target selected | โณ TODO | -| Confirm restore | Confirm dialog | Restore starts | โณ TODO | -| Cancel restore | Cancel dialog | Return to menu | โณ TODO | -| Progress display | During restore | Show progress | โณ TODO | - -#### 4.5 Restore Cluster (TUI) -| Test Case | Action | Expected Result | Status | -|-----------|--------|-----------------|--------| -| Select cluster archive | Choose from list | Archive selected | โณ TODO | -| Confirm restore | Warning + confirm | Restore starts | โณ TODO | -| Progress tracking | During restore | Show N/M databases | โณ TODO | -| Ownership preservation | After restore | Verify owners correct | โณ TODO | - -#### 4.6 View Status (TUI) -| Test Case | Action | Expected Result | Status | -|-----------|--------|-----------------|--------| -| Show all databases | Select status option | List all DBs | โณ TODO | -| Scroll long lists | Arrow keys | Scroll works | โณ TODO | -| Return to menu | Back/Escape | Return to main menu | โณ TODO | - -#### 4.7 Operation History (TUI) -| Test Case | Action | Expected Result | Status | -|-----------|--------|-----------------|--------| -| View history | Select history option | Show past operations | โณ TODO | -| Navigate history | Up/Down arrows | Scroll through history | โณ TODO | -| Long operations | View 2-hour backup | Show correct duration | โณ TODO | -| Empty history | First run | Show "No history" | โณ TODO | - ---- - -### 5. EDGE CASES & ERROR SCENARIOS - -#### 5.1 Authentication & Permissions -| Test Case | Scenario | Expected Result | Status | -|-----------|----------|-----------------|--------| -| Peer auth mismatch | Run as root with --user postgres | Show warning, suggest sudo | โณ TODO | -| No password | Connect with peer auth | Success via Unix socket | โณ TODO | -| Wrong password | Connect with bad password | Error: authentication failed | โณ TODO | -| No .pgpass file | Remote connection | Prompt for password | โณ TODO | - -#### 5.2 Disk Space -| Test Case | Scenario | Expected Result | Status | -|-----------|----------|-----------------|--------| -| Insufficient space | Backup when disk full | Error before starting | โณ TODO | -| Restore needs space | Restore 10GB with 5GB free | Error with clear message | โณ TODO | - -#### 5.3 Database State -| Test Case | Scenario | Expected Result | Status | -|-----------|----------|-----------------|--------| -| Active connections | Restore DB with connections | Terminate connections first | โณ TODO | -| Database locked | Backup locked DB | Wait or error gracefully | โณ TODO | -| Corrupted database | Backup corrupted DB | Warning but continue | โณ TODO | - -#### 5.4 Network & Remote -| Test Case | Scenario | Expected Result | Status | -|-----------|----------|-----------------|--------| -| Remote host | `--host=remote.server` | Connect via TCP | โณ TODO | -| Network timeout | Connection hangs | Timeout with error | โณ TODO | -| SSL required | `--ssl-mode=require` | Connect with SSL | โณ TODO | - ---- - -### 6. CROSS-PLATFORM COMPATIBILITY - -| Platform | Test | Status | -|----------|------|--------| -| Linux amd64 | All operations | โณ TODO | -| Linux arm64 | All operations | โณ TODO | -| macOS Intel | All operations | โณ TODO | -| macOS ARM | All operations | โณ TODO | -| Windows amd64 | All operations | โณ TODO | - ---- - -## Testing Procedure - -### Phase 1: Command-Line Testing (Current) -1. โœ… Test basic backup single -2. โœ… Test basic backup cluster -3. โœ… Test restore list -4. โŒ **Found BUG #1**: restore single --create not working -5. โณ Test remaining command-line operations - -### Phase 2: Fix Critical Bugs -1. Fix BUG #1: Implement database creation in RestoreSingle -2. Test fix thoroughly -3. Commit and push - -### Phase 3: Interactive Mode Testing -1. Test all TUI menu options -2. Test navigation and user input -3. Test progress indicators -4. Test error handling - -### Phase 4: Edge Case Testing -1. Test authentication scenarios -2. Test disk space limits -3. Test error conditions -4. Test concurrent operations - -### Phase 5: Documentation & Report -1. Update README with known issues -2. Create bug fix changelog -3. Update user documentation -4. Final stability report - ---- - -## Success Criteria - -- โœ… All critical bugs fixed -- โœ… All command-line operations work as documented -- โœ… All interactive operations complete successfully -- โœ… Error messages are clear and helpful -- โœ… No crashes or panics under normal use -- โœ… Cross-platform builds succeed -- โœ… Documentation matches actual behavior - ---- - -## Notes - -- Test with PostgreSQL peer authentication (most common setup) -- Test with MariaDB/MySQL (ensure no regressions) -- Test with both superuser and regular user accounts -- Test with various database sizes (small, medium, large) -- Test with special characters in database names - ---- - -**Last Updated**: November 10, 2025 -**Test Progress**: 3/100+ tests completed -**Critical Bugs Found**: 1 -**Status**: IN PROGRESS diff --git a/TEST_RESULTS_SUMMARY.md b/TEST_RESULTS_SUMMARY.md deleted file mode 100644 index c81477e..0000000 --- a/TEST_RESULTS_SUMMARY.md +++ /dev/null @@ -1,160 +0,0 @@ -# Test Suite Results Summary - -**Date**: November 10, 2025 -**Test Suite**: test_suite.sh -**Results File**: test_results_20251110_090957.txt - -## Summary Statistics - -- **Total Tests**: 54 -- **Passed**: 48 (88.9%) -- **Failed**: 6 (11.1%) -- **Skipped**: 0 - -## Failed Tests Analysis - -### 1. โŒ Backup single with custom backup dir -**Command**: `backup single test_automation_db --backup-dir=/tmp/test_backups_XXXXX` -**Exit Code**: 1 -**Error**: `backup command failed: exit status 1` -**Issue**: Likely permission issue with custom directory or pg_dump output directory -**Severity**: MEDIUM -**Action Required**: Investigate backup directory creation and permissions - ---- - -### 2. โŒ Backup cluster with custom backup dir -**Command**: `backup cluster --backup-dir=/tmp/test_backups_XXXXX` -**Exit Code**: 1 -**Error**: Similar to #1 -**Issue**: Same as #1 - custom backup directory handling -**Severity**: MEDIUM -**Action Required**: Same fix as #1 - ---- - -### 3. โŒ Restore single with --verbose -**Command**: `restore single backup.dump --target=test_db --verbose --confirm` -**Exit Code**: 1 -**Error**: Restore command failed -**Issue**: --verbose flag may not be properly passed or database already exists -**Severity**: LOW -**Action Required**: Investigate --verbose flag handling in restore - ---- - -### 4. โŒ Restore single with --force -**Command**: `restore single backup.dump --target=test_db --force --confirm` -**Exit Code**: 1 -**Error**: Restore command failed -**Issue**: --force flag may not skip safety checks as expected, or database state issue -**Severity**: MEDIUM -**Action Required**: Verify --force flag bypasses validation correctly - ---- - -### 5. โŒ SSL mode require (should have failed) -**Command**: `status --ssl-mode=require` -**Exit Code**: 0 (expected: non-zero) -**Error**: Test expected this to fail (SSL not configured), but it succeeded -**Issue**: SSL mode validation not enforced, or test assumption incorrect -**Severity**: LOW -**Action Required**: Verify if SSL mode should fail without SSL configured - ---- - -### 6. โŒ Invalid CPU workload (should fail) -**Command**: `status --cpu-workload=invalid` -**Exit Code**: 0 (expected: non-zero) -**Error**: Invalid value accepted -**Issue**: Input validation missing for CPU workload parameter -**Severity**: LOW -**Action Required**: Add validation for cpu-workload flag values - ---- - -## Passed Tests Highlights - -โœ… All basic commands (help, version, status) -โœ… Backup single database with various compression levels -โœ… Backup cluster operations -โœ… Restore list functionality -โœ… Restore single database (basic, --clean, --create, --dry-run) -โœ… Restore cluster operations (all variants) -โœ… Global flags (host, port, user, db-type, jobs, cores) -โœ… Authentication tests (peer auth, user flags) -โœ… Error scenarios (non-existent database, invalid compression, invalid port) -โœ… Interactive mode help - -## Test Coverage Analysis - -### Well-Tested Areas โœ… -- Basic backup operations (single & cluster) -- Restore operations (single & cluster) -- Compression levels -- Job parallelization -- Authentication handling -- Global configuration flags -- Error handling for invalid inputs - -### Areas Needing Attention โš ๏ธ -1. Custom backup directory handling -2. --verbose flag in restore operations -3. --force flag behavior in restore -4. SSL mode validation -5. CPU workload input validation - -### Not Fully Tested ๐Ÿ” -- MariaDB/MySQL operations (only PostgreSQL tested) -- Remote database connections (only localhost) -- Network failure scenarios -- Large database operations (>1GB) -- Concurrent operations -- Full interactive TUI testing - -## Recommendations - -### High Priority -1. Fix custom backup directory issues (#1, #2) -2. Fix --force flag in restore (#4) - -### Medium Priority -3. Investigate --verbose flag behavior (#3) -4. Add input validation for cpu-workload flag (#6) - -### Low Priority -5. Review SSL mode requirements (#5) - -### Future Enhancements -- Add MySQL/MariaDB test cases -- Add remote connection tests -- Add performance benchmarks -- Add stress tests (large databases) -- Add concurrent operation tests -- Full interactive TUI automation - -## Conclusion - -**Overall Status**: โœ… STABLE (88.9% pass rate) - -The application is **highly stable** with only minor issues found: -- Core functionality works correctly -- All critical operations tested successfully -- Failed tests are edge cases or validation issues -- No crashes or data corruption observed - -The identified issues are non-critical and can be addressed in future updates. - ---- - -**Test Environment**: -- OS: Linux -- PostgreSQL: Running with peer authentication -- User: postgres (via sudo) -- Platform: Linux amd64 - -**Next Steps**: -1. Review and fix the 6 identified issues -2. Re-run test suite to verify fixes -3. Proceed with interactive mode testing -4. Create regression test suite diff --git a/test_results_20251110_090957.txt b/test_results_20251110_090957.txt deleted file mode 100644 index 2e78950..0000000 --- a/test_results_20251110_090957.txt +++ /dev/null @@ -1,2331 +0,0 @@ - -================================================================ - DBBackup Complete Test Suite -================================================================ -Date: Mon Nov 10 09:09:57 AM UTC 2025 -Host: psqldb -User: root -DBBackup: ./dbbackup -Results File: test_results_20251110_090957.txt - -[09:09:57] Setting up test environment... -[09:09:57] Test environment ready - -================================================================ - 1. Basic Commands -================================================================ -[09:09:57] Running: Help command -Command: sudo -u postgres ./dbbackup --help -Exit Code: 0 -Output: -A comprehensive database backup and restore solution supporting both PostgreSQL and MySQL. - -Features: -- CPU-aware parallel processing -- Multiple backup modes (cluster, single database, sample) -- Interactive UI and CLI modes -- Archive verification and restore -- Progress indicators and timing summaries -- Robust error handling and logging - -Database Support: -- PostgreSQL (via pg_dump/pg_restore) -- MySQL (via mysqldump/mysql) - -For help with specific commands, use: dbbackup [command] --help - -Usage: - dbbackup [command] - -Available Commands: - backup Create database backups - completion Generate the autocompletion script for the specified shell - cpu Show CPU information and optimization settings - help Help about any command - interactive Start interactive menu mode - list List available backups and databases - preflight Run preflight checks - restore Restore databases from backup archives - restore Restore databases from backup archives - status Show connection status and configuration - verify Verify backup archive integrity - -Flags: - --auto-detect-cores Auto-detect CPU cores (default true) - --backup-dir string Backup directory (default "/var/lib/pgsql/db_backups") - --compression int Compression level (0-9) (default 6) - --cpu-workload string CPU workload type (cpu-intensive|io-intensive|balanced) (default "balanced") - --database string Database name (default "postgres") - -d, --db-type string Database type (postgres|mysql|mariadb) (default "postgres") - --debug Enable debug logging - --dump-jobs int Number of parallel dump jobs (default 8) - -h, --help help for dbbackup - --host string Database host (default "localhost") - --insecure Disable SSL (shortcut for --ssl-mode=disable) - --jobs int Number of parallel jobs (default 8) - --max-cores int Maximum CPU cores to use (default 16) - --no-color Disable colored output - --password string Database password - --port int Database port (default 5432) - --ssl-mode string SSL mode for connections (default "prefer") ---- -โœ… PASS: Help command -[09:09:57] Running: Version flag -Command: sudo -u postgres ./dbbackup --version -Exit Code: 0 -Output: -dbbackup version dev (built: unknown, commit: unknown) ---- -โœ… PASS: Version flag -[09:09:57] Running: Status command -Command: sudo -u postgres ./dbbackup status -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - -โ ‹ Checking required tools... - -โœ… Required tools available -INFO  [2025-11-10T09:09:57] Connected to PostgreSQL successfully driver=pgx max_conns=10 - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 16 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (13 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: Status command - -================================================================ - 2. Backup Single Database -================================================================ -[09:09:57] Running: Backup single database (basic) -Command: sudo -u postgres ./dbbackup backup single test_automation_db -Exit Code: 0 -Output: -INFO  [2025-11-10T09:09:57] Starting single database backup database=test_automation_db -INFO  [2025-11-10T09:09:57] Connected to PostgreSQL successfully max_conns=10 driver=pgx - -๐Ÿ”„ Starting backup: test_automation_db -INFO  [2025-11-10T09:09:57] Operation started -INFO  [2025-11-10T09:09:57] Step started -INFO  [2025-11-10T09:09:57] Step completed (29.487ยตs) - [10%] Backup directory prepared - [20%] Generated backup filename -INFO  [2025-11-10T09:09:57] Step started -INFO  [2025-11-10T09:09:57] Step completed (21.662ยตs) - [30%] Backup command prepared -INFO  [2025-11-10T09:09:57] Step started - [40%] Starting database backup... -INFO  [2025-11-10T09:09:57] Step completed (87.011298ms) - [80%] Database backup completed -INFO  [2025-11-10T09:09:57] Step started -INFO  [2025-11-10T09:09:57] Step completed (45.019ยตs) - [90%] Backup verified: 2.4 KB -INFO  [2025-11-10T09:09:57] Step started -INFO  [2025-11-10T09:09:57] Step completed (450.46ยตs) - [100%] Backup operation completed successfully -โœ… โœ… Single database backup completed: db_test_automation_db_20251110_090957.dump - -INFO  [2025-11-10T09:09:57] Operation completed (87.892633ms) ---- -โœ… PASS: Backup single database (basic) -[09:09:57] Running: Backup single with compression level 9 -Command: sudo -u postgres ./dbbackup backup single test_automation_db --compression=9 -Exit Code: 0 -Output: -INFO  [2025-11-10T09:09:57] Starting single database backup database=test_automation_db -INFO  [2025-11-10T09:09:57] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting backup: test_automation_db -INFO  [2025-11-10T09:09:57] Operation started -INFO  [2025-11-10T09:09:57] Step started -INFO  [2025-11-10T09:09:57] Step completed (26.581ยตs) - [10%] Backup directory prepared - [20%] Generated backup filename -INFO  [2025-11-10T09:09:57] Step started -INFO  [2025-11-10T09:09:57] Step completed (10.12ยตs) - [30%] Backup command prepared -INFO  [2025-11-10T09:09:57] Step started - [40%] Starting database backup... -INFO  [2025-11-10T09:09:57] Step completed (94.738684ms) - [80%] Database backup completed -INFO  [2025-11-10T09:09:57] Step started -INFO  [2025-11-10T09:09:57] Step completed (27.583ยตs) - [90%] Backup verified: 2.4 KB -INFO  [2025-11-10T09:09:57] Step started -INFO  [2025-11-10T09:09:57] Step completed (185.086ยตs) - [100%] Backup operation completed successfully -โœ… โœ… Single database backup completed: db_test_automation_db_20251110_090957.dump - -INFO  [2025-11-10T09:09:57] Operation completed (95.17162ms) ---- -โœ… PASS: Backup single with compression level 9 -[09:09:57] Running: Backup single with compression level 1 -Command: sudo -u postgres ./dbbackup backup single test_automation_db --compression=1 -Exit Code: 0 -Output: -INFO  [2025-11-10T09:09:57] Starting single database backup database=test_automation_db -INFO  [2025-11-10T09:09:57] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting backup: test_automation_db -INFO  [2025-11-10T09:09:57] Operation started -INFO  [2025-11-10T09:09:57] Step started -INFO  [2025-11-10T09:09:57] Step completed (43.06ยตs) - [10%] Backup directory prepared - [20%] Generated backup filename -INFO  [2025-11-10T09:09:57] Step started -INFO  [2025-11-10T09:09:57] Step completed (22.425ยตs) - [30%] Backup command prepared -INFO  [2025-11-10T09:09:57] Step started - [40%] Starting database backup... -INFO  [2025-11-10T09:09:58] Step completed (97.709995ms) - [80%] Database backup completed -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (39.803ยตs) - [90%] Backup verified: 2.4 KB -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (198.257ยตs) - [100%] Backup operation completed successfully -โœ… โœ… Single database backup completed: db_test_automation_db_20251110_090957.dump - -INFO  [2025-11-10T09:09:58] Operation completed (98.283211ms) ---- -โœ… PASS: Backup single with compression level 1 -[09:09:58] Running: Backup single with custom backup dir -Command: sudo -u postgres ./dbbackup backup single test_automation_db --backup-dir=/tmp/test_backups_1046326 -Exit Code: 1 -Output: -INFO  [2025-11-10T09:09:58] Starting single database backup database=test_automation_db -INFO  [2025-11-10T09:09:58] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting backup: test_automation_db -INFO  [2025-11-10T09:09:58] Operation started -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (29.638ยตs) - [10%] Backup directory prepared - [20%] Generated backup filename -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (20.642ยตs) - [30%] Backup command prepared -INFO  [2025-11-10T09:09:58] Step started - [40%] Starting database backup... -ERROR [2025-11-10T09:09:58] Step failed (6.848703ms) error=backup execution failed: backup command failed: exit status 1 -โŒ โŒ backup failed: backup command failed: exit status 1 - -ERROR [2025-11-10T09:09:58] Operation failed error=backup failed: backup command failed: exit status 1 (7.081045ms) -Error: backup failed: backup command failed: exit status 1 -Usage: - dbbackup backup single [database] [flags] - -Flags: - -h, --help help for single - -Global Flags: - --auto-detect-cores Auto-detect CPU cores (default true) - --backup-dir string Backup directory (default "/var/lib/pgsql/db_backups") - --compression int Compression level (0-9) (default 6) - --cpu-workload string CPU workload type (cpu-intensive|io-intensive|balanced) (default "balanced") - --database string Database name (default "postgres") - -d, --db-type string Database type (postgres|mysql|mariadb) (default "postgres") - --debug Enable debug logging - --dump-jobs int Number of parallel dump jobs (default 8) - --host string Database host (default "localhost") - --insecure Disable SSL (shortcut for --ssl-mode=disable) - --jobs int Number of parallel jobs (default 8) - --max-cores int Maximum CPU cores to use (default 16) - --no-color Disable colored output - --password string Database password - --port int Database port (default 5432) - --ssl-mode string SSL mode for connections (default "prefer") - --user string Database user (default "postgres") - -ERROR [2025-11-10T09:09:58] Application failed error=backup failed: backup command failed: exit status 1 ---- -โŒ FAIL: Backup single with custom backup dir (exit code: 1) -[09:09:58] Running: Backup single with jobs=1 -Command: sudo -u postgres ./dbbackup backup single test_automation_db --jobs=1 -Exit Code: 0 -Output: -INFO  [2025-11-10T09:09:58] Starting single database backup database=test_automation_db -INFO  [2025-11-10T09:09:58] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting backup: test_automation_db -INFO  [2025-11-10T09:09:58] Operation started -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (24.798ยตs) - [10%] Backup directory prepared - [20%] Generated backup filename -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (9.769ยตs) - [30%] Backup command prepared -INFO  [2025-11-10T09:09:58] Step started - [40%] Starting database backup... -INFO  [2025-11-10T09:09:58] Step completed (93.903526ms) - [80%] Database backup completed -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (35.784ยตs) - [90%] Backup verified: 2.4 KB -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (174.422ยตs) - [100%] Backup operation completed successfully -โœ… โœ… Single database backup completed: db_test_automation_db_20251110_090958.dump - -INFO  [2025-11-10T09:09:58] Operation completed (94.353115ms) ---- -โœ… PASS: Backup single with jobs=1 -[09:09:58] Running: Backup single with jobs=16 -Command: sudo -u postgres ./dbbackup backup single test_automation_db --jobs=16 -Exit Code: 0 -Output: -INFO  [2025-11-10T09:09:58] Starting single database backup database=test_automation_db -INFO  [2025-11-10T09:09:58] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting backup: test_automation_db -INFO  [2025-11-10T09:09:58] Operation started -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (26.215ยตs) - [10%] Backup directory prepared - [20%] Generated backup filename -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (13.906ยตs) - [30%] Backup command prepared -INFO  [2025-11-10T09:09:58] Step started - [40%] Starting database backup... -INFO  [2025-11-10T09:09:58] Step completed (97.612874ms) - [80%] Database backup completed -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (34.496ยตs) - [90%] Backup verified: 2.4 KB -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (177.431ยตs) - [100%] Backup operation completed successfully -โœ… โœ… Single database backup completed: db_test_automation_db_20251110_090958.dump - -INFO  [2025-11-10T09:09:58] Operation completed (98.064382ms) ---- -โœ… PASS: Backup single with jobs=16 -[09:09:58] Running: Backup single non-existent database (should fail) -Command: sudo -u postgres ./dbbackup backup single nonexistent_database_xyz -Exit Code: 1 -Output: -INFO  [2025-11-10T09:09:58] Starting single database backup database=nonexistent_database_xyz -INFO  [2025-11-10T09:09:58] Connected to PostgreSQL successfully max_conns=10 driver=pgx -Error: database 'nonexistent_database_xyz' does not exist -Usage: - dbbackup backup single [database] [flags] - -Flags: - -h, --help help for single - -Global Flags: - --auto-detect-cores Auto-detect CPU cores (default true) - --backup-dir string Backup directory (default "/var/lib/pgsql/db_backups") - --compression int Compression level (0-9) (default 6) - --cpu-workload string CPU workload type (cpu-intensive|io-intensive|balanced) (default "balanced") - --database string Database name (default "postgres") - -d, --db-type string Database type (postgres|mysql|mariadb) (default "postgres") - --debug Enable debug logging - --dump-jobs int Number of parallel dump jobs (default 8) - --host string Database host (default "localhost") - --insecure Disable SSL (shortcut for --ssl-mode=disable) - --jobs int Number of parallel jobs (default 8) - --max-cores int Maximum CPU cores to use (default 16) - --no-color Disable colored output - --password string Database password - --port int Database port (default 5432) - --ssl-mode string SSL mode for connections (default "prefer") - --user string Database user (default "postgres") - -ERROR [2025-11-10T09:09:58] Application failed error=database 'nonexistent_database_xyz' does not exist ---- -โœ… PASS: Backup single non-existent database (should fail) (correctly failed) -[09:09:58] Running: Backup single with debug logging -Command: sudo -u postgres ./dbbackup backup single test_automation_db --debug -Exit Code: 0 -Output: -INFO  [2025-11-10T09:09:58] Starting single database backup database=test_automation_db -INFO  [2025-11-10T09:09:58] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting backup: test_automation_db -INFO  [2025-11-10T09:09:58] Operation started -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (31.619ยตs) - [10%] Backup directory prepared - [20%] Generated backup filename -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (12.937ยตs) - [30%] Backup command prepared -INFO  [2025-11-10T09:09:58] Step started - [40%] Starting database backup... -INFO  [2025-11-10T09:09:58] Step completed (94.583288ms) - [80%] Database backup completed -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (43.511ยตs) - [90%] Backup verified: 2.4 KB -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (177.804ยตs) - [100%] Backup operation completed successfully -โœ… โœ… Single database backup completed: db_test_automation_db_20251110_090958.dump - -INFO  [2025-11-10T09:09:58] Operation completed (95.097145ms) ---- -โœ… PASS: Backup single with debug logging -[09:09:58] Running: Backup single with no-color -Command: sudo -u postgres ./dbbackup backup single test_automation_db --no-color -Exit Code: 0 -Output: -INFO  [2025-11-10T09:09:58] Starting single database backup database=test_automation_db -INFO  [2025-11-10T09:09:58] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting backup: test_automation_db -INFO  [2025-11-10T09:09:58] Operation started -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (30.472ยตs) - [10%] Backup directory prepared - [20%] Generated backup filename -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (23.534ยตs) - [30%] Backup command prepared -INFO  [2025-11-10T09:09:58] Step started - [40%] Starting database backup... -INFO  [2025-11-10T09:09:58] Step completed (104.354812ms) - [80%] Database backup completed -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (44.888ยตs) - [90%] Backup verified: 2.4 KB -INFO  [2025-11-10T09:09:58] Step started -INFO  [2025-11-10T09:09:58] Step completed (270.241ยตs) - [100%] Backup operation completed successfully -โœ… โœ… Single database backup completed: db_test_automation_db_20251110_090958.dump - -INFO  [2025-11-10T09:09:58] Operation completed (104.973414ms) ---- -โœ… PASS: Backup single with no-color - -================================================================ - 3. Backup Cluster -================================================================ -[09:09:58] Running: Backup cluster (basic) -Command: sudo -u postgres ./dbbackup backup cluster -Exit Code: 0 -Output: -INFO  [2025-11-10T09:09:58] Starting cluster backup -INFO  [2025-11-10T09:09:58] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting cluster backup (all databases) -INFO  [2025-11-10T09:09:58] [Cluster Backup] Starting cluster backup - Backing up global objects... - Getting database list... - Backing up 16 databases... - [1/16] Backing up database: backup_test_db - Database size: 83.6 MB - โœ… Completed backup_test_db (56.5 MB) - [2/16] Backing up database: cli_test_db - Database size: 7.6 MB - โœ… Completed cli_test_db (8.1 KB) - [3/16] Backing up database: cluster_restore_test - Database size: 7.4 MB - โœ… Completed cluster_restore_test (870 B) - [4/16] Backing up database: final_test_db - Database size: 7.5 MB - โœ… Completed final_test_db (2.8 KB) - [5/16] Backing up database: large_test_db - Database size: 42.2 MB - โœ… Completed large_test_db (806.9 KB) - [6/16] Backing up database: menu_test_db - Database size: 7.5 MB - โœ… Completed menu_test_db (3.0 KB) - [7/16] Backing up database: ownership_test - Database size: 7.5 MB - โœ… Completed ownership_test (2.6 KB) - [8/16] Backing up database: perfect_test_db - Database size: 7.5 MB - โœ… Completed perfect_test_db (3.0 KB) - [9/16] Backing up database: postgres - Database size: 7.4 MB - โœ… Completed postgres (822 B) - [10/16] Backing up database: restored_ownership_test - Database size: 7.5 MB - โœ… Completed restored_ownership_test (2.7 KB) - [11/16] Backing up database: test_automation_db - Database size: 7.5 MB - โœ… Completed test_automation_db (2.4 KB) - [12/16] Backing up database: test_restore_timing - Database size: 7.5 MB - โœ… Completed test_restore_timing (3.9 KB) - [13/16] Backing up database: test_sample_backup - Database size: 7.5 MB - โœ… Completed test_sample_backup (4.9 KB) - [14/16] Backing up database: test_single_backup - Database size: 7.5 MB - โœ… Completed test_single_backup (3.9 KB) ---- -โœ… PASS: Backup cluster (basic) -[09:10:04] Running: Backup cluster with compression 9 -Command: sudo -u postgres ./dbbackup backup cluster --compression=9 -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:05] Starting cluster backup -INFO  [2025-11-10T09:10:05] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting cluster backup (all databases) -INFO  [2025-11-10T09:10:05] [Cluster Backup] Starting cluster backup - Backing up global objects... - Getting database list... - Backing up 16 databases... - [1/16] Backing up database: backup_test_db - Database size: 83.6 MB - โœ… Completed backup_test_db (56.5 MB) - [2/16] Backing up database: cli_test_db - Database size: 7.6 MB - โœ… Completed cli_test_db (8.1 KB) - [3/16] Backing up database: cluster_restore_test - Database size: 7.4 MB - โœ… Completed cluster_restore_test (870 B) - [4/16] Backing up database: final_test_db - Database size: 7.5 MB - โœ… Completed final_test_db (2.8 KB) - [5/16] Backing up database: large_test_db - Database size: 42.2 MB - โœ… Completed large_test_db (806.9 KB) - [6/16] Backing up database: menu_test_db - Database size: 7.5 MB - โœ… Completed menu_test_db (3.0 KB) - [7/16] Backing up database: ownership_test - Database size: 7.5 MB - โœ… Completed ownership_test (2.6 KB) - [8/16] Backing up database: perfect_test_db - Database size: 7.5 MB - โœ… Completed perfect_test_db (3.0 KB) - [9/16] Backing up database: postgres - Database size: 7.4 MB - โœ… Completed postgres (822 B) - [10/16] Backing up database: restored_ownership_test - Database size: 7.5 MB - โœ… Completed restored_ownership_test (2.7 KB) - [11/16] Backing up database: test_automation_db - Database size: 7.5 MB - โœ… Completed test_automation_db (2.4 KB) - [12/16] Backing up database: test_restore_timing - Database size: 7.5 MB - โœ… Completed test_restore_timing (3.9 KB) - [13/16] Backing up database: test_sample_backup - Database size: 7.5 MB - โœ… Completed test_sample_backup (4.9 KB) - [14/16] Backing up database: test_single_backup - Database size: 7.5 MB - โœ… Completed test_single_backup (3.9 KB) ---- -โœ… PASS: Backup cluster with compression 9 -[09:10:10] Running: Backup cluster with jobs=4 -Command: sudo -u postgres ./dbbackup backup cluster --jobs=4 -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:10] Starting cluster backup -INFO  [2025-11-10T09:10:10] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting cluster backup (all databases) -INFO  [2025-11-10T09:10:10] [Cluster Backup] Starting cluster backup - Backing up global objects... - Getting database list... - Backing up 16 databases... - [1/16] Backing up database: backup_test_db - Database size: 83.6 MB - โœ… Completed backup_test_db (56.5 MB) - [2/16] Backing up database: cli_test_db - Database size: 7.6 MB - โœ… Completed cli_test_db (8.1 KB) - [3/16] Backing up database: cluster_restore_test - Database size: 7.4 MB - โœ… Completed cluster_restore_test (870 B) - [4/16] Backing up database: final_test_db - Database size: 7.5 MB - โœ… Completed final_test_db (2.8 KB) - [5/16] Backing up database: large_test_db - Database size: 42.2 MB - โœ… Completed large_test_db (806.9 KB) - [6/16] Backing up database: menu_test_db - Database size: 7.5 MB - โœ… Completed menu_test_db (3.0 KB) - [7/16] Backing up database: ownership_test - Database size: 7.5 MB - โœ… Completed ownership_test (2.6 KB) - [8/16] Backing up database: perfect_test_db - Database size: 7.5 MB - โœ… Completed perfect_test_db (3.0 KB) - [9/16] Backing up database: postgres - Database size: 7.4 MB - โœ… Completed postgres (822 B) - [10/16] Backing up database: restored_ownership_test - Database size: 7.5 MB - โœ… Completed restored_ownership_test (2.7 KB) - [11/16] Backing up database: test_automation_db - Database size: 7.5 MB - โœ… Completed test_automation_db (2.4 KB) - [12/16] Backing up database: test_restore_timing - Database size: 7.5 MB - โœ… Completed test_restore_timing (3.9 KB) - [13/16] Backing up database: test_sample_backup - Database size: 7.5 MB - โœ… Completed test_sample_backup (4.9 KB) - [14/16] Backing up database: test_single_backup - Database size: 7.5 MB - โœ… Completed test_single_backup (3.9 KB) ---- -โœ… PASS: Backup cluster with jobs=4 -[09:10:16] Running: Backup cluster with dump-jobs=4 -Command: sudo -u postgres ./dbbackup backup cluster --dump-jobs=4 -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:16] Starting cluster backup -INFO  [2025-11-10T09:10:16] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting cluster backup (all databases) -INFO  [2025-11-10T09:10:16] [Cluster Backup] Starting cluster backup - Backing up global objects... - Getting database list... - Backing up 16 databases... - [1/16] Backing up database: backup_test_db - Database size: 83.6 MB - โœ… Completed backup_test_db (56.5 MB) - [2/16] Backing up database: cli_test_db - Database size: 7.6 MB - โœ… Completed cli_test_db (8.1 KB) - [3/16] Backing up database: cluster_restore_test - Database size: 7.4 MB - โœ… Completed cluster_restore_test (870 B) - [4/16] Backing up database: final_test_db - Database size: 7.5 MB - โœ… Completed final_test_db (2.8 KB) - [5/16] Backing up database: large_test_db - Database size: 42.2 MB - โœ… Completed large_test_db (806.9 KB) - [6/16] Backing up database: menu_test_db - Database size: 7.5 MB - โœ… Completed menu_test_db (3.0 KB) - [7/16] Backing up database: ownership_test - Database size: 7.5 MB - โœ… Completed ownership_test (2.6 KB) - [8/16] Backing up database: perfect_test_db - Database size: 7.5 MB - โœ… Completed perfect_test_db (3.0 KB) - [9/16] Backing up database: postgres - Database size: 7.4 MB - โœ… Completed postgres (822 B) - [10/16] Backing up database: restored_ownership_test - Database size: 7.5 MB - โœ… Completed restored_ownership_test (2.7 KB) - [11/16] Backing up database: test_automation_db - Database size: 7.5 MB - โœ… Completed test_automation_db (2.4 KB) - [12/16] Backing up database: test_restore_timing - Database size: 7.5 MB - โœ… Completed test_restore_timing (3.9 KB) - [13/16] Backing up database: test_sample_backup - Database size: 7.5 MB - โœ… Completed test_sample_backup (4.9 KB) - [14/16] Backing up database: test_single_backup - Database size: 7.5 MB - โœ… Completed test_single_backup (3.9 KB) ---- -โœ… PASS: Backup cluster with dump-jobs=4 -[09:10:22] Running: Backup cluster with custom backup dir -Command: sudo -u postgres ./dbbackup backup cluster --backup-dir=/tmp/test_backups_1046326 -Exit Code: 1 -Output: -INFO  [2025-11-10T09:10:22] Starting cluster backup -INFO  [2025-11-10T09:10:22] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting cluster backup (all databases) -INFO  [2025-11-10T09:10:22] [Cluster Backup] Starting cluster backup -ERROR [2025-11-10T09:10:22] [Cluster Backup] FAILED: Failed to create temporary directory (0.0s) -โŒ Failed to create temporary directory - -Error: failed to create temp directory: mkdir /tmp/test_backups_1046326/.cluster_20251110_091022: permission denied -Usage: - dbbackup backup cluster [flags] - -Flags: - -h, --help help for cluster - -Global Flags: - --auto-detect-cores Auto-detect CPU cores (default true) - --backup-dir string Backup directory (default "/var/lib/pgsql/db_backups") - --compression int Compression level (0-9) (default 6) - --cpu-workload string CPU workload type (cpu-intensive|io-intensive|balanced) (default "balanced") - --database string Database name (default "postgres") - -d, --db-type string Database type (postgres|mysql|mariadb) (default "postgres") - --debug Enable debug logging - --dump-jobs int Number of parallel dump jobs (default 8) - --host string Database host (default "localhost") - --insecure Disable SSL (shortcut for --ssl-mode=disable) - --jobs int Number of parallel jobs (default 8) - --max-cores int Maximum CPU cores to use (default 16) - --no-color Disable colored output - --password string Database password - --port int Database port (default 5432) - --ssl-mode string SSL mode for connections (default "prefer") - --user string Database user (default "postgres") - -ERROR [2025-11-10T09:10:22] Application failed error=failed to create temp directory: mkdir /tmp/test_backups_1046326/.cluster_20251110_091022: permission denied ---- -โŒ FAIL: Backup cluster with custom backup dir (exit code: 1) -[09:10:22] Running: Backup cluster with debug -Command: sudo -u postgres ./dbbackup backup cluster --debug -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:22] Starting cluster backup -INFO  [2025-11-10T09:10:22] Connected to PostgreSQL successfully driver=pgx max_conns=10 - -๐Ÿ”„ Starting cluster backup (all databases) -INFO  [2025-11-10T09:10:22] [Cluster Backup] Starting cluster backup - Backing up global objects... - Getting database list... - Backing up 16 databases... - [1/16] Backing up database: backup_test_db - Database size: 83.6 MB - โœ… Completed backup_test_db (56.5 MB) - [2/16] Backing up database: cli_test_db - Database size: 7.6 MB - โœ… Completed cli_test_db (8.1 KB) - [3/16] Backing up database: cluster_restore_test - Database size: 7.4 MB - โœ… Completed cluster_restore_test (870 B) - [4/16] Backing up database: final_test_db - Database size: 7.5 MB - โœ… Completed final_test_db (2.8 KB) - [5/16] Backing up database: large_test_db - Database size: 42.2 MB - โœ… Completed large_test_db (806.9 KB) - [6/16] Backing up database: menu_test_db - Database size: 7.5 MB - โœ… Completed menu_test_db (3.0 KB) - [7/16] Backing up database: ownership_test - Database size: 7.5 MB - โœ… Completed ownership_test (2.6 KB) - [8/16] Backing up database: perfect_test_db - Database size: 7.5 MB - โœ… Completed perfect_test_db (3.0 KB) - [9/16] Backing up database: postgres - Database size: 7.4 MB - โœ… Completed postgres (822 B) - [10/16] Backing up database: restored_ownership_test - Database size: 7.5 MB - โœ… Completed restored_ownership_test (2.7 KB) - [11/16] Backing up database: test_automation_db - Database size: 7.5 MB - โœ… Completed test_automation_db (2.4 KB) - [12/16] Backing up database: test_restore_timing - Database size: 7.5 MB - โœ… Completed test_restore_timing (3.9 KB) - [13/16] Backing up database: test_sample_backup - Database size: 7.5 MB - โœ… Completed test_sample_backup (4.9 KB) - [14/16] Backing up database: test_single_backup - Database size: 7.5 MB - โœ… Completed test_single_backup (3.9 KB) ---- -โœ… PASS: Backup cluster with debug - -================================================================ - 4. Restore List -================================================================ -[09:10:27] Running: List available backups -Command: sudo -u postgres ./dbbackup restore list -Exit Code: 0 -Output: - -๐Ÿ“ฆ Available backup archives in /var/lib/pgsql/db_backups - -FILENAME FORMAT SIZE MODIFIED DATABASE ------------------------------------------------------------------------------------------------------------------------- -cluster_20251022_170857.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 17:09:05 cluster -cluster_20251022_172513.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 17:25:21 cluster -cluster_20251022_181047.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:10:55 cluster -cluster_20251022_181202.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:12:11 cluster -cluster_20251022_182103.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:21:11 cluster -cluster_20251022_182400.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:24:09 cluster -cluster_20251022_182421.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:24:29 cluster -cluster_20251022_182433.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:24:41 cluster -cluster_20251022_183430.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:34:39 cluster -cluster_20251022_183955.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:40:05 cluster -cluster_20251022_184009.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:40:18 cluster -cluster_20251022_184035.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:40:44 cluster -cluster_20251022_184049.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:40:58 cluster -cluster_20251022_184313.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:43:21 cluster -cluster_20251022_184533.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:45:41 cluster -cluster_20251022_184859.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:49:08 cluster -cluster_20251022_185144.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:51:53 cluster -cluster_20251022_185423.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:54:32 cluster -cluster_20251022_185845.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:58:54 cluster -cluster_20251022_185926.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 18:59:35 cluster -cluster_20251022_190430.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 19:04:38 cluster -cluster_20251022_190938.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 19:09:46 cluster -cluster_20251022_191703.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 19:17:13 cluster -cluster_20251022_192558.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 19:26:07 cluster -cluster_20251022_192906.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-22 19:29:15 cluster -cluster_20251023_091803.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-23 09:18:13 cluster -cluster_20251023_142814.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-23 14:28:22 cluster -cluster_20251023_151441.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-23 15:14:48 cluster -cluster_20251024_090319.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-10-24 09:03:26 cluster -cluster_20251105_121823.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-05 12:18:29 cluster -cluster_20251105_121855.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-05 12:19:00 cluster -cluster_20251105_132523.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-05 13:25:29 cluster -cluster_20251105_132616.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-05 13:26:22 cluster -cluster_20251105_133105.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-05 13:31:11 cluster -cluster_20251105_133459.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-05 13:35:06 cluster -cluster_20251105_133924.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-05 13:39:29 cluster -cluster_20251105_134829.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-05 13:48:34 cluster -cluster_20251105_135646.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-05 13:56:52 cluster -cluster_20251105_140256.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-05 14:03:02 cluster -cluster_20251106_081543.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-06 08:15:48 cluster -cluster_20251107_101639.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-07 10:16:44 cluster -cluster_20251107_112726.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-07 11:27:32 cluster -cluster_20251107_114858.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-07 11:49:03 cluster -cluster_20251107_124952.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-07 12:49:57 cluster -cluster_20251107_130416.tar.gz Cluster Archive (tar.gz) 56.6 MB 2025-11-07 13:04:22 cluster ---- -โœ… PASS: List available backups -[09:10:27] Running: List backups from custom dir -Command: sudo -u postgres ./dbbackup restore list --backup-dir=/tmp/test_backups_1046326 -Exit Code: 0 -Output: -No backup archives found in: /tmp/test_backups_1046326 ---- -โœ… PASS: List backups from custom dir - -================================================================ - 5. Restore Single Database -================================================================ -[09:10:27] Using backup file: /var/lib/pgsql/db_backups/db_test_automation_db_20251110_090958.dump -[09:10:27] Running: Restore single database (basic) -Command: sudo -u postgres ./dbbackup restore single /var/lib/pgsql/db_backups/db_test_automation_db_20251110_090958.dump --target=test_automation_db_restored --confirm -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:27] Archive information -INFO  [2025-11-10T09:10:27] Validating archive... -INFO  [2025-11-10T09:10:27] Checking disk space... -INFO  [2025-11-10T09:10:27] Disk space check passed -INFO  [2025-11-10T09:10:27] Starting restore... database=test_automation_db_restored -INFO  [2025-11-10T09:10:27] Detected archive format - -๐Ÿ”„ Restoring database 'test_automation_db_restored' from db_test_automation_db_20251110_090958.dump -INFO  [2025-11-10T09:10:27] Executing restore command -INFO  [2025-11-10T09:10:27] Restore command completed successfully -โœ… Database 'test_automation_db_restored' restored successfully - -INFO  [2025-11-10T09:10:27] [Single Database Restore] COMPLETED: Restored database 'test_automation_db_restored' from db_test_automation_db_20251110_090958.dump (0.0s) -INFO  [2025-11-10T09:10:27] โœ… Restore completed successfully database=test_automation_db_restored ---- -โœ… PASS: Restore single database (basic) -[09:10:28] Running: Restore single with --clean flag -Command: sudo -u postgres ./dbbackup restore single /var/lib/pgsql/db_backups/db_test_automation_db_20251110_090958.dump --target=test_automation_db_restored --clean --confirm -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:28] Archive information -INFO  [2025-11-10T09:10:28] Validating archive... -INFO  [2025-11-10T09:10:28] Checking disk space... -INFO  [2025-11-10T09:10:28] Disk space check passed -INFO  [2025-11-10T09:10:28] Starting restore... database=test_automation_db_restored -INFO  [2025-11-10T09:10:28] Detected archive format - -๐Ÿ”„ Restoring database 'test_automation_db_restored' from db_test_automation_db_20251110_090958.dump -INFO  [2025-11-10T09:10:28] Executing restore command -INFO  [2025-11-10T09:10:28] Restore command completed successfully -โœ… Database 'test_automation_db_restored' restored successfully - -INFO  [2025-11-10T09:10:28] [Single Database Restore] COMPLETED: Restored database 'test_automation_db_restored' from db_test_automation_db_20251110_090958.dump (0.0s) -INFO  [2025-11-10T09:10:28] โœ… Restore completed successfully database=test_automation_db_restored ---- -โœ… PASS: Restore single with --clean flag -[09:10:28] Running: Restore single with --create flag -Command: sudo -u postgres ./dbbackup restore single /var/lib/pgsql/db_backups/db_test_automation_db_20251110_090958.dump --target=test_automation_db_created --create --confirm -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:28] Archive information -INFO  [2025-11-10T09:10:28] Validating archive... -INFO  [2025-11-10T09:10:28] Checking disk space... -INFO  [2025-11-10T09:10:28] Disk space check passed -INFO  [2025-11-10T09:10:28] Starting restore... database=test_automation_db_created -INFO  [2025-11-10T09:10:28] Detected archive format - -๐Ÿ”„ Restoring database 'test_automation_db_created' from db_test_automation_db_20251110_090958.dump -INFO  [2025-11-10T09:10:28] Checking if target database exists database=test_automation_db_created -INFO  [2025-11-10T09:10:28] Creating database -INFO  [2025-11-10T09:10:28] Successfully created database -INFO  [2025-11-10T09:10:28] Executing restore command -INFO  [2025-11-10T09:10:28] Restore command completed successfully -โœ… Database 'test_automation_db_created' restored successfully - -INFO  [2025-11-10T09:10:28] [Single Database Restore] COMPLETED: Restored database 'test_automation_db_created' from db_test_automation_db_20251110_090958.dump (0.1s) -INFO  [2025-11-10T09:10:28] โœ… Restore completed successfully database=test_automation_db_created ---- -โœ… PASS: Restore single with --create flag -[09:10:28] Running: Restore single with --dry-run -Command: sudo -u postgres ./dbbackup restore single /var/lib/pgsql/db_backups/db_test_automation_db_20251110_090958.dump --target=test_automation_db_restored --dry-run -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:28] Archive information -INFO  [2025-11-10T09:10:28] Validating archive... -INFO  [2025-11-10T09:10:28] Checking disk space... -INFO  [2025-11-10T09:10:28] Disk space check passed - -๐Ÿ” DRY-RUN MODE - No changes will be made - -Would restore: - Archive: /var/lib/pgsql/db_backups/db_test_automation_db_20251110_090958.dump - Format: PostgreSQL Dump - Target Database: test_automation_db_restored - Clean Before Restore: false - Create If Missing: false - -To execute this restore, add --confirm flag ---- -โœ… PASS: Restore single with --dry-run -[09:10:28] Running: Restore single with --verbose -Command: sudo -u postgres ./dbbackup restore single /var/lib/pgsql/db_backups/db_test_automation_db_20251110_090958.dump --target=test_automation_db_restored --verbose --confirm -Exit Code: 1 -Output: -INFO  [2025-11-10T09:10:28] Archive information -INFO  [2025-11-10T09:10:28] Validating archive... -INFO  [2025-11-10T09:10:28] Checking disk space... -INFO  [2025-11-10T09:10:28] Disk space check passed -INFO  [2025-11-10T09:10:28] Starting restore... database=test_automation_db_restored -INFO  [2025-11-10T09:10:28] Detected archive format - -๐Ÿ”„ Restoring database 'test_automation_db_restored' from db_test_automation_db_20251110_090958.dump -INFO  [2025-11-10T09:10:28] Executing restore command -ERROR [2025-11-10T09:10:28] Restore command failed error=exit status 1 -โŒ Restore failed: restore failed: exit status 1 -Output: pg_restore: error: could not execute query: ERROR: relation "test_table" already exists -Command was: CREATE TABLE public.test_table ( - id integer NOT NULL, - data text -); - - - - -ERROR [2025-11-10T09:10:28] [Single Database Restore] FAILED: Restore failed: restore failed: exit status 1 -Output: pg_restore: error: could not execute query: ERROR: relation "test_table" already exists -Command was: CREATE TABLE public.test_table ( - id integer NOT NULL, - data text -); - - - (0.0s) -Error: restore failed: restore failed: exit status 1 -Output: pg_restore: error: could not execute query: ERROR: relation "test_table" already exists -Command was: CREATE TABLE public.test_table ( - id integer NOT NULL, - data text -); - - - -Usage: - dbbackup restore single [archive-file] [flags] - -Flags: - --clean Drop and recreate target database - --confirm Confirm and execute restore (required) - --create Create target database if it doesn't exist - --dry-run Show what would be done without executing - --force Skip safety checks and confirmations - -h, --help help for single - --no-progress Disable progress indicators - --target string Target database name (defaults to original) ---- -โŒ FAIL: Restore single with --verbose (exit code: 1) -[09:10:28] Running: Restore single with --force -Command: sudo -u postgres ./dbbackup restore single /var/lib/pgsql/db_backups/db_test_automation_db_20251110_090958.dump --target=test_automation_db_restored --force --confirm -Exit Code: 1 -Output: -INFO  [2025-11-10T09:10:28] Archive information -INFO  [2025-11-10T09:10:28] Starting restore... database=test_automation_db_restored -INFO  [2025-11-10T09:10:28] Detected archive format - -๐Ÿ”„ Restoring database 'test_automation_db_restored' from db_test_automation_db_20251110_090958.dump -INFO  [2025-11-10T09:10:28] Executing restore command -ERROR [2025-11-10T09:10:28] Restore command failed error=exit status 1 -โŒ Restore failed: restore failed: exit status 1 -Output: pg_restore: error: could not execute query: ERROR: relation "test_table" already exists -Command was: CREATE TABLE public.test_table ( - id integer NOT NULL, - data text -); - - - - -ERROR [2025-11-10T09:10:28] [Single Database Restore] FAILED: Restore failed: restore failed: exit status 1 -Output: pg_restore: error: could not execute query: ERROR: relation "test_table" already exists -Command was: CREATE TABLE public.test_table ( - id integer NOT NULL, - data text -); - - - (0.0s) -Error: restore failed: restore failed: exit status 1 -Output: pg_restore: error: could not execute query: ERROR: relation "test_table" already exists -Command was: CREATE TABLE public.test_table ( - id integer NOT NULL, - data text -); - - - -Usage: - dbbackup restore single [archive-file] [flags] - -Flags: - --clean Drop and recreate target database - --confirm Confirm and execute restore (required) - --create Create target database if it doesn't exist - --dry-run Show what would be done without executing - --force Skip safety checks and confirmations - -h, --help help for single - --no-progress Disable progress indicators - --target string Target database name (defaults to original) - --verbose Show detailed restore progress - -Global Flags: ---- -โŒ FAIL: Restore single with --force (exit code: 1) -[09:10:28] Running: Restore single without --confirm (should show dry-run) -Command: sudo -u postgres ./dbbackup restore single /var/lib/pgsql/db_backups/db_test_automation_db_20251110_090958.dump --target=test_automation_db_restored -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:28] Archive information -INFO  [2025-11-10T09:10:28] Validating archive... -INFO  [2025-11-10T09:10:28] Checking disk space... -INFO  [2025-11-10T09:10:28] Disk space check passed - -๐Ÿ” DRY-RUN MODE - No changes will be made - -Would restore: - Archive: /var/lib/pgsql/db_backups/db_test_automation_db_20251110_090958.dump - Format: PostgreSQL Dump - Target Database: test_automation_db_restored - Clean Before Restore: false - Create If Missing: false - -To execute this restore, add --confirm flag ---- -โœ… PASS: Restore single without --confirm (should show dry-run) -[09:10:28] Running: Restore non-existent file (should fail) -Command: sudo -u postgres ./dbbackup restore single /tmp/nonexistent_file.dump --confirm -Exit Code: 1 -Output: -Error: archive not found: /tmp/nonexistent_file.dump -Usage: - dbbackup restore single [archive-file] [flags] - -Flags: - --clean Drop and recreate target database - --confirm Confirm and execute restore (required) - --create Create target database if it doesn't exist - --dry-run Show what would be done without executing - --force Skip safety checks and confirmations - -h, --help help for single - --no-progress Disable progress indicators - --target string Target database name (defaults to original) - --verbose Show detailed restore progress - -Global Flags: - --auto-detect-cores Auto-detect CPU cores (default true) - --backup-dir string Backup directory (default "/var/lib/pgsql/db_backups") - --compression int Compression level (0-9) (default 6) - --cpu-workload string CPU workload type (cpu-intensive|io-intensive|balanced) (default "balanced") - --database string Database name (default "postgres") - -d, --db-type string Database type (postgres|mysql|mariadb) (default "postgres") - --debug Enable debug logging - --dump-jobs int Number of parallel dump jobs (default 8) - --host string Database host (default "localhost") - --insecure Disable SSL (shortcut for --ssl-mode=disable) - --jobs int Number of parallel jobs (default 8) - --max-cores int Maximum CPU cores to use (default 16) - --no-color Disable colored output - --password string Database password - --port int Database port (default 5432) - --ssl-mode string SSL mode for connections (default "prefer") - --user string Database user (default "postgres") - -ERROR [2025-11-10T09:10:28] Application failed error=archive not found: /tmp/nonexistent_file.dump ---- -โœ… PASS: Restore non-existent file (should fail) (correctly failed) - -================================================================ - 6. Restore Cluster -================================================================ -[09:10:28] Using cluster backup: /var/lib/pgsql/db_backups/cluster_20251110_091022.tar.gz -[09:10:28] Running: Restore cluster with --dry-run -Command: sudo -u postgres ./dbbackup restore cluster /var/lib/pgsql/db_backups/cluster_20251110_091022.tar.gz --dry-run -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:28] Cluster archive information -INFO  [2025-11-10T09:10:28] Validating archive... -INFO  [2025-11-10T09:10:28] Checking disk space... -INFO  [2025-11-10T09:10:28] Disk space check passed - -๐Ÿ” DRY-RUN MODE - No changes will be made - -Would restore cluster: - Archive: /var/lib/pgsql/db_backups/cluster_20251110_091022.tar.gz - Parallel Jobs: 0 (0 = auto) - -To execute this restore, add --confirm flag ---- -โœ… PASS: Restore cluster with --dry-run -[09:10:28] Running: Restore cluster with --verbose -Command: sudo -u postgres ./dbbackup restore cluster /var/lib/pgsql/db_backups/cluster_20251110_091022.tar.gz --verbose --confirm -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:28] Cluster archive information -INFO  [2025-11-10T09:10:28] Validating archive... -INFO  [2025-11-10T09:10:28] Checking disk space... -INFO  [2025-11-10T09:10:28] Disk space check passed -INFO  [2025-11-10T09:10:28] Starting cluster restore... - -๐Ÿ”„ Restoring cluster from cluster_20251110_091022.tar.gz -INFO  [2025-11-10T09:10:28] Extracting cluster archive - Checking privileges... -INFO  [2025-11-10T09:10:29] Superuser privileges confirmed - full ownership restoration enabled -INFO  [2025-11-10T09:10:29] Restoring global objects (roles, tablespaces) - Restoring global objects (roles, tablespaces)... -INFO  [2025-11-10T09:10:29] Successfully restored global objects - Restoring database backup_test_db (1/16) | 0/16 | Starting... -INFO  [2025-11-10T09:10:29] Restoring database -INFO  [2025-11-10T09:10:29] Dropping existing database for clean restore -INFO  [2025-11-10T09:10:29] Dropped existing database -INFO  [2025-11-10T09:10:29] Creating database -INFO  [2025-11-10T09:10:29] Successfully created database -INFO  [2025-11-10T09:10:29] Restoring database database=backup_test_db -INFO  [2025-11-10T09:10:29] Executing restore command -INFO  [2025-11-10T09:10:31] Restore command completed successfully - Restoring database cli_test_db (2/16) | 1/16 (6%) | Elapsed: 2s | ETA: ~36s remaining -INFO  [2025-11-10T09:10:31] Restoring database -INFO  [2025-11-10T09:10:31] Dropping existing database for clean restore -INFO  [2025-11-10T09:10:32] Dropped existing database -INFO  [2025-11-10T09:10:32] Creating database -INFO  [2025-11-10T09:10:32] Successfully created database -INFO  [2025-11-10T09:10:32] Restoring database database=cli_test_db -INFO  [2025-11-10T09:10:32] Executing restore command -INFO  [2025-11-10T09:10:32] Restore command completed successfully - Restoring database cluster_restore_test (3/16) | 2/16 (12%) | Elapsed: 3s | ETA: ~23s remaining -INFO  [2025-11-10T09:10:32] Restoring database -INFO  [2025-11-10T09:10:32] Dropping existing database for clean restore -INFO  [2025-11-10T09:10:33] Dropped existing database -INFO  [2025-11-10T09:10:33] Creating database -INFO  [2025-11-10T09:10:33] Successfully created database -INFO  [2025-11-10T09:10:33] Restoring database database=cluster_restore_test -INFO  [2025-11-10T09:10:33] Executing restore command -INFO  [2025-11-10T09:10:33] Restore command completed successfully - Restoring database final_test_db (4/16) | 3/16 (19%) | Elapsed: 4s | ETA: ~17s remaining -INFO  [2025-11-10T09:10:33] Restoring database -INFO  [2025-11-10T09:10:33] Dropping existing database for clean restore -INFO  [2025-11-10T09:10:33] Dropped existing database -INFO  [2025-11-10T09:10:33] Creating database -INFO  [2025-11-10T09:10:33] Successfully created database -INFO  [2025-11-10T09:10:33] Restoring database database=final_test_db -INFO  [2025-11-10T09:10:33] Executing restore command -INFO  [2025-11-10T09:10:33] Restore command completed successfully - Restoring database large_test_db (5/16) | 4/16 (25%) | Elapsed: 4s | ETA: ~14s remaining ---- -โœ… PASS: Restore cluster with --verbose -[09:10:42] Running: Restore cluster with --force -Command: sudo -u postgres ./dbbackup restore cluster /var/lib/pgsql/db_backups/cluster_20251110_091022.tar.gz --force --confirm -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:42] Cluster archive information -INFO  [2025-11-10T09:10:42] Starting cluster restore... - -๐Ÿ”„ Restoring cluster from cluster_20251110_091022.tar.gz -INFO  [2025-11-10T09:10:42] Extracting cluster archive - Checking privileges... -INFO  [2025-11-10T09:10:43] Superuser privileges confirmed - full ownership restoration enabled -INFO  [2025-11-10T09:10:43] Restoring global objects (roles, tablespaces) - Restoring global objects (roles, tablespaces)... -INFO  [2025-11-10T09:10:43] Successfully restored global objects - Restoring database backup_test_db (1/16) | 0/16 | Starting... -INFO  [2025-11-10T09:10:43] Restoring database -INFO  [2025-11-10T09:10:43] Dropping existing database for clean restore -INFO  [2025-11-10T09:10:44] Dropped existing database -INFO  [2025-11-10T09:10:44] Creating database -INFO  [2025-11-10T09:10:44] Successfully created database -INFO  [2025-11-10T09:10:44] Restoring database database=backup_test_db -INFO  [2025-11-10T09:10:44] Executing restore command -INFO  [2025-11-10T09:10:45] Restore command completed successfully - Restoring database cli_test_db (2/16) | 1/16 (6%) | Elapsed: 2s | ETA: ~35s remaining -INFO  [2025-11-10T09:10:45] Restoring database -INFO  [2025-11-10T09:10:45] Dropping existing database for clean restore -INFO  [2025-11-10T09:10:46] Dropped existing database -INFO  [2025-11-10T09:10:46] Creating database -INFO  [2025-11-10T09:10:46] Successfully created database -INFO  [2025-11-10T09:10:46] Restoring database database=cli_test_db -INFO  [2025-11-10T09:10:46] Executing restore command -INFO  [2025-11-10T09:10:46] Restore command completed successfully - Restoring database cluster_restore_test (3/16) | 2/16 (12%) | Elapsed: 3s | ETA: ~22s remaining -INFO  [2025-11-10T09:10:46] Restoring database -INFO  [2025-11-10T09:10:46] Dropping existing database for clean restore -INFO  [2025-11-10T09:10:47] Dropped existing database -INFO  [2025-11-10T09:10:47] Creating database -INFO  [2025-11-10T09:10:47] Successfully created database -INFO  [2025-11-10T09:10:47] Restoring database database=cluster_restore_test -INFO  [2025-11-10T09:10:47] Executing restore command -INFO  [2025-11-10T09:10:47] Restore command completed successfully - Restoring database final_test_db (4/16) | 3/16 (19%) | Elapsed: 3s | ETA: ~17s remaining -INFO  [2025-11-10T09:10:47] Restoring database -INFO  [2025-11-10T09:10:47] Dropping existing database for clean restore -INFO  [2025-11-10T09:10:48] Dropped existing database -INFO  [2025-11-10T09:10:48] Creating database -INFO  [2025-11-10T09:10:48] Successfully created database -INFO  [2025-11-10T09:10:48] Restoring database database=final_test_db -INFO  [2025-11-10T09:10:48] Executing restore command -INFO  [2025-11-10T09:10:48] Restore command completed successfully - Restoring database large_test_db (5/16) | 4/16 (25%) | Elapsed: 4s | ETA: ~14s remaining -INFO  [2025-11-10T09:10:48] Restoring database -INFO  [2025-11-10T09:10:48] Dropping existing database for clean restore -INFO  [2025-11-10T09:10:48] Dropped existing database ---- -โœ… PASS: Restore cluster with --force -[09:10:57] Running: Restore cluster with --jobs=2 -Command: sudo -u postgres ./dbbackup restore cluster /var/lib/pgsql/db_backups/cluster_20251110_091022.tar.gz --jobs=2 --confirm -Exit Code: 0 -Output: -INFO  [2025-11-10T09:10:57] Cluster archive information -INFO  [2025-11-10T09:10:57] Validating archive... -INFO  [2025-11-10T09:10:57] Checking disk space... -INFO  [2025-11-10T09:10:57] Disk space check passed -INFO  [2025-11-10T09:10:57] Starting cluster restore... - -๐Ÿ”„ Restoring cluster from cluster_20251110_091022.tar.gz -INFO  [2025-11-10T09:10:57] Extracting cluster archive - Checking privileges... -INFO  [2025-11-10T09:10:57] Superuser privileges confirmed - full ownership restoration enabled -INFO  [2025-11-10T09:10:57] Restoring global objects (roles, tablespaces) - Restoring global objects (roles, tablespaces)... -INFO  [2025-11-10T09:10:57] Successfully restored global objects - Restoring database backup_test_db (1/16) | 0/16 | Starting... -INFO  [2025-11-10T09:10:57] Restoring database -INFO  [2025-11-10T09:10:57] Dropping existing database for clean restore -INFO  [2025-11-10T09:10:58] Dropped existing database -INFO  [2025-11-10T09:10:58] Creating database -INFO  [2025-11-10T09:10:58] Successfully created database -INFO  [2025-11-10T09:10:58] Restoring database database=backup_test_db -INFO  [2025-11-10T09:10:58] Executing restore command -INFO  [2025-11-10T09:10:59] Restore command completed successfully - Restoring database cli_test_db (2/16) | 1/16 (6%) | Elapsed: 2s | ETA: ~35s remaining -INFO  [2025-11-10T09:10:59] Restoring database -INFO  [2025-11-10T09:10:59] Dropping existing database for clean restore -INFO  [2025-11-10T09:11:00] Dropped existing database -INFO  [2025-11-10T09:11:00] Creating database -INFO  [2025-11-10T09:11:00] Successfully created database -INFO  [2025-11-10T09:11:00] Restoring database database=cli_test_db -INFO  [2025-11-10T09:11:00] Executing restore command -INFO  [2025-11-10T09:11:00] Restore command completed successfully - Restoring database cluster_restore_test (3/16) | 2/16 (12%) | Elapsed: 3s | ETA: ~22s remaining -INFO  [2025-11-10T09:11:00] Restoring database -INFO  [2025-11-10T09:11:00] Dropping existing database for clean restore -INFO  [2025-11-10T09:11:01] Dropped existing database -INFO  [2025-11-10T09:11:01] Creating database -INFO  [2025-11-10T09:11:01] Successfully created database -INFO  [2025-11-10T09:11:01] Restoring database database=cluster_restore_test -INFO  [2025-11-10T09:11:01] Executing restore command -INFO  [2025-11-10T09:11:01] Restore command completed successfully - Restoring database final_test_db (4/16) | 3/16 (19%) | Elapsed: 3s | ETA: ~16s remaining -INFO  [2025-11-10T09:11:01] Restoring database -INFO  [2025-11-10T09:11:01] Dropping existing database for clean restore -INFO  [2025-11-10T09:11:02] Dropped existing database -INFO  [2025-11-10T09:11:02] Creating database -INFO  [2025-11-10T09:11:02] Successfully created database -INFO  [2025-11-10T09:11:02] Restoring database database=final_test_db -INFO  [2025-11-10T09:11:02] Executing restore command -INFO  [2025-11-10T09:11:02] Restore command completed successfully - Restoring database large_test_db (5/16) | 4/16 (25%) | Elapsed: 4s | ETA: ~13s remaining ---- -โœ… PASS: Restore cluster with --jobs=2 -[09:11:11] Running: Restore cluster without --confirm (should show dry-run) -Command: sudo -u postgres ./dbbackup restore cluster /var/lib/pgsql/db_backups/cluster_20251110_091022.tar.gz -Exit Code: 0 -Output: -INFO  [2025-11-10T09:11:11] Cluster archive information -INFO  [2025-11-10T09:11:11] Validating archive... -INFO  [2025-11-10T09:11:11] Checking disk space... -INFO  [2025-11-10T09:11:11] Disk space check passed - -๐Ÿ” DRY-RUN MODE - No changes will be made - -Would restore cluster: - Archive: /var/lib/pgsql/db_backups/cluster_20251110_091022.tar.gz - Parallel Jobs: 0 (0 = auto) - -To execute this restore, add --confirm flag ---- -โœ… PASS: Restore cluster without --confirm (should show dry-run) - -================================================================ - 7. Global Flags -================================================================ -[09:11:11] Running: Custom host flag -Command: sudo -u postgres ./dbbackup status --host=localhost -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Checking required tools...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully driver=pgx max_conns=10 - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: Custom host flag -[09:11:11] Running: Custom port flag -Command: sudo -u postgres ./dbbackup status --port=5432 -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Checking required tools...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully driver=pgx max_conns=10 - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: Custom port flag -[09:11:11] Running: Custom user flag -Command: sudo -u postgres ./dbbackup status --user=postgres -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Connecting to postgres...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully driver=pgx max_conns=10 - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: Custom user flag -[09:11:11] Running: Database type postgres -Command: sudo -u postgres ./dbbackup status --db-type=postgres -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - -โ ‹ Checking required tools... - -โœ… Required tools available -INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully max_conns=10 driver=pgx - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: Database type postgres -[09:11:11] Running: SSL mode disable (insecure) -Command: sudo -u postgres ./dbbackup status --insecure -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - SSL: disabled - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Checking required tools...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully max_conns=10 driver=pgx - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: SSL mode disable (insecure) -[09:11:11] Running: SSL mode require -Command: sudo -u postgres ./dbbackup status --ssl-mode=require -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: require - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Checking required tools...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully driver=pgx max_conns=10 - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โŒ FAIL: SSL mode require (should have failed) -[09:11:11] Running: SSL mode prefer -Command: sudo -u postgres ./dbbackup status --ssl-mode=prefer -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Connecting to postgres...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully max_conns=10 driver=pgx - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: SSL mode prefer -[09:11:11] Running: Max cores flag -Command: sudo -u postgres ./dbbackup status --max-cores=4 -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 4 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Connecting to postgres...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully driver=pgx max_conns=10 - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: Max cores flag -[09:11:11] Running: Disable auto-detect cores -Command: sudo -u postgres ./dbbackup status --auto-detect-cores=false -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: false - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Checking required tools...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully driver=pgx max_conns=10 - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: Disable auto-detect cores -[09:11:11] Running: CPU workload balanced -Command: sudo -u postgres ./dbbackup status --cpu-workload=balanced -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Connecting to postgres...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully driver=pgx max_conns=10 - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: CPU workload balanced -[09:11:11] Running: CPU workload cpu-intensive -Command: sudo -u postgres ./dbbackup status --cpu-workload=cpu-intensive -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Checking required tools...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully max_conns=10 driver=pgx - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: CPU workload cpu-intensive -[09:11:11] Running: CPU workload io-intensive -Command: sudo -u postgres ./dbbackup status --cpu-workload=io-intensive -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Checking required tools...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully max_conns=10 driver=pgx - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: CPU workload io-intensive - -================================================================ - 8. Authentication Tests -================================================================ -[09:11:11] Running: Connection with peer auth (default) -Command: sudo -u postgres ./dbbackup status -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Checking required tools...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully driver=pgx max_conns=10 - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: Connection with peer auth (default) -[09:11:11] Running: Connection with --user flag -Command: sudo -u postgres ./dbbackup status --user=postgres -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Connecting to postgres...INFO  [2025-11-10T09:11:11] Connected to PostgreSQL successfully driver=pgx max_conns=10 - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โœ… PASS: Connection with --user flag -[09:11:11] Running: Wrong user flag (should fail/warn) -Command: ./dbbackup status --user=postgres -Exit Code: 1 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /root/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /root/db_backups (exists, writable) - - -โ ‹ Checking required tools... - -โœ… Required tools available - - -โŒ Connection failed: failed to ping PostgreSQL: failed to connect to `user=postgres database=postgres`: - 127.0.0.1:5432 (localhost): tls error: server refused TLS connection - [::1]:5432 (localhost): tls error: server refused TLS connection - 127.0.0.1:5432 (localhost): server error: FATAL: Ident authentication failed for user "postgres" (SQLSTATE 28000) - [::1]:5432 (localhost): server error: FATAL: Ident authentication failed for user "postgres" (SQLSTATE 28000) -Error: failed to ping PostgreSQL: failed to connect to `user=postgres database=postgres`: - 127.0.0.1:5432 (localhost): tls error: server refused TLS connection - [::1]:5432 (localhost): tls error: server refused TLS connection - 127.0.0.1:5432 (localhost): server error: FATAL: Ident authentication failed for user "postgres" (SQLSTATE 28000) - [::1]:5432 (localhost): server error: FATAL: Ident authentication failed for user "postgres" (SQLSTATE 28000) -Usage: - dbbackup status [flags] - -Flags: - -h, --help help for status - -Global Flags: - --auto-detect-cores Auto-detect CPU cores (default true) - --backup-dir string Backup directory (default "/root/db_backups") ---- -โœ… PASS: Wrong user flag (should fail/warn) (correctly failed) - -================================================================ - 9. Error Scenarios -================================================================ -[09:11:12] Running: Invalid compression level (should fail) -Command: sudo -u postgres ./dbbackup backup single test_automation_db --compression=99 -Exit Code: 1 -Output: -Error: configuration error: config error in field 'compression' with value 'c': must be between 0-9 -Usage: - dbbackup backup single [database] [flags] - -Flags: - -h, --help help for single - -Global Flags: - --auto-detect-cores Auto-detect CPU cores (default true) - --backup-dir string Backup directory (default "/var/lib/pgsql/db_backups") - --compression int Compression level (0-9) (default 6) - --cpu-workload string CPU workload type (cpu-intensive|io-intensive|balanced) (default "balanced") - --database string Database name (default "postgres") - -d, --db-type string Database type (postgres|mysql|mariadb) (default "postgres") - --debug Enable debug logging - --dump-jobs int Number of parallel dump jobs (default 8) - --host string Database host (default "localhost") - --insecure Disable SSL (shortcut for --ssl-mode=disable) - --jobs int Number of parallel jobs (default 8) - --max-cores int Maximum CPU cores to use (default 16) - --no-color Disable colored output - --password string Database password - --port int Database port (default 5432) - --ssl-mode string SSL mode for connections (default "prefer") - --user string Database user (default "postgres") - -ERROR [2025-11-10T09:11:12] Application failed error=configuration error: config error in field 'compression' with value 'c': must be between 0-9 ---- -โœ… PASS: Invalid compression level (should fail) (correctly failed) -[09:11:12] Running: Invalid database type (should fail) -Command: sudo -u postgres ./dbbackup status --db-type=invalid -Exit Code: 1 -Output: -Error: config error in field 'database-type' with value 'invalid': must be 'postgres', 'mysql', or 'mariadb' -Usage: - dbbackup status [flags] - -Flags: - -h, --help help for status - -Global Flags: - --auto-detect-cores Auto-detect CPU cores (default true) - --backup-dir string Backup directory (default "/var/lib/pgsql/db_backups") - --compression int Compression level (0-9) (default 6) - --cpu-workload string CPU workload type (cpu-intensive|io-intensive|balanced) (default "balanced") - --database string Database name (default "postgres") - -d, --db-type string Database type (postgres|mysql|mariadb) (default "postgres") - --debug Enable debug logging - --dump-jobs int Number of parallel dump jobs (default 8) - --host string Database host (default "localhost") - --insecure Disable SSL (shortcut for --ssl-mode=disable) - --jobs int Number of parallel jobs (default 8) - --max-cores int Maximum CPU cores to use (default 16) - --no-color Disable colored output - --password string Database password - --port int Database port (default 5432) - --ssl-mode string SSL mode for connections (default "prefer") - --user string Database user (default "postgres") - -ERROR [2025-11-10T09:11:12] Application failed error=config error in field 'database-type' with value 'invalid': must be 'postgres', 'mysql', or 'mariadb' ---- -โœ… PASS: Invalid database type (should fail) (correctly failed) -[09:11:12] Running: Invalid CPU workload (should fail) -Command: sudo -u postgres ./dbbackup status --cpu-workload=invalid -Exit Code: 0 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:5432 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - -โ ‹ Checking required tools... - -โœ… Required tools available -INFO  [2025-11-10T09:11:12] Connected to PostgreSQL successfully driver=pgx max_conns=10 - - -โœ… Connected successfully - - -โœ… Database operations successful -Connection Test Results: - Status: Connected โœ… - Version: PostgreSQL 16.10 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 14.3.1 20250617 (Red Hat 14.3.1-2), 64-bit - Databases: 18 found - Database List: backup_test_db, cli_test_db, cluster_restore_test, ... (15 more) - -โœ… Status check completed successfully! ---- -โŒ FAIL: Invalid CPU workload (should fail) (should have failed) -[09:11:12] Running: Invalid port (should fail) -Command: sudo -u postgres ./dbbackup status --port=99999 -Exit Code: 1 -Output: -============================================================== - Database Backup & Recovery Tool -============================================================== -Version: dev (built: unknown, commit: unknown) - -Configuration: - Database Type: postgres - Host: localhost:99999 - User: postgres - Database: postgres - Password: (not set) - SSL Mode: prefer - Backup Dir: /var/lib/pgsql/db_backups - Compression: 6 - Jobs: 8 - Dump Jobs: 8 - Max Cores: 16 - Auto Detect: true - -System Information: - OS: linux/amd64 - CPU Cores: 8 - Go Version: go1.24.9 - Backup Dir: /var/lib/pgsql/db_backups (exists, writable) - - - -โœ… Required tools available - -โ ‹ Connecting to postgres... - -โŒ Connection failed: failed to parse pgx config: cannot parse `postgres://postgres@localhost:99999/postgres?sslmode=prefer&pool_max_conns=10&pool_min_conns=2&application_name=dbbackup&connect_timeout=30`: invalid port (strconv.ParseUint: parsing "99999": value out of range) -Error: failed to parse pgx config: cannot parse `postgres://postgres@localhost:99999/postgres?sslmode=prefer&pool_max_conns=10&pool_min_conns=2&application_name=dbbackup&connect_timeout=30`: invalid port (strconv.ParseUint: parsing "99999": value out of range) -Usage: - dbbackup status [flags] - -Flags: - -h, --help help for status - -Global Flags: - --auto-detect-cores Auto-detect CPU cores (default true) - --backup-dir string Backup directory (default "/var/lib/pgsql/db_backups") - --compression int Compression level (0-9) (default 6) - --cpu-workload string CPU workload type (cpu-intensive|io-intensive|balanced) (default "balanced") - --database string Database name (default "postgres") - -d, --db-type string Database type (postgres|mysql|mariadb) (default "postgres") - --debug Enable debug logging - --dump-jobs int Number of parallel dump jobs (default 8) - --host string Database host (default "localhost") - --insecure Disable SSL (shortcut for --ssl-mode=disable) ---- -โœ… PASS: Invalid port (should fail) (correctly failed) -[09:11:12] Running: Backup to read-only directory (should fail) -Command: sudo -u postgres ./dbbackup backup single test_automation_db --backup-dir=/proc -Exit Code: 1 -Output: -INFO  [2025-11-10T09:11:12] Starting single database backup database=test_automation_db -INFO  [2025-11-10T09:11:12] Connected to PostgreSQL successfully max_conns=10 driver=pgx - -๐Ÿ”„ Starting backup: test_automation_db -INFO  [2025-11-10T09:11:12] Operation started -INFO  [2025-11-10T09:11:12] Step started -INFO  [2025-11-10T09:11:12] Step completed (38.439ยตs) - [10%] Backup directory prepared - [20%] Generated backup filename -INFO  [2025-11-10T09:11:12] Step started -INFO  [2025-11-10T09:11:12] Step completed (20.438ยตs) - [30%] Backup command prepared -INFO  [2025-11-10T09:11:12] Step started - [40%] Starting database backup... -ERROR [2025-11-10T09:11:12] Step failed error=backup execution failed: backup command failed: exit status 1 (8.879052ms) -โŒ โŒ backup failed: backup command failed: exit status 1 - -ERROR [2025-11-10T09:11:12] Operation failed error=backup failed: backup command failed: exit status 1 (9.084599ms) -Error: backup failed: backup command failed: exit status 1 -Usage: - dbbackup backup single [database] [flags] - -Flags: - -h, --help help for single - -Global Flags: - --auto-detect-cores Auto-detect CPU cores (default true) - --backup-dir string Backup directory (default "/var/lib/pgsql/db_backups") - --compression int Compression level (0-9) (default 6) - --cpu-workload string CPU workload type (cpu-intensive|io-intensive|balanced) (default "balanced") - --database string Database name (default "postgres") - -d, --db-type string Database type (postgres|mysql|mariadb) (default "postgres") - --debug Enable debug logging - --dump-jobs int Number of parallel dump jobs (default 8) - --host string Database host (default "localhost") - --insecure Disable SSL (shortcut for --ssl-mode=disable) - --jobs int Number of parallel jobs (default 8) - --max-cores int Maximum CPU cores to use (default 16) - --no-color Disable colored output - --password string Database password - --port int Database port (default 5432) - --ssl-mode string SSL mode for connections (default "prefer") - --user string Database user (default "postgres") - -ERROR [2025-11-10T09:11:12] Application failed error=backup failed: backup command failed: exit status 1 ---- -โœ… PASS: Backup to read-only directory (should fail) (correctly failed) - -================================================================ - 10. Interactive Mode -================================================================ -[09:11:12] Running: Interactive mode help -Command: sudo -u postgres ./dbbackup interactive --help -Exit Code: 0 -Output: -Start the interactive menu system for guided backup operations. - -Usage: - dbbackup interactive [flags] - -Aliases: - interactive, menu, ui - -Flags: - -h, --help help for interactive - -Global Flags: - --auto-detect-cores Auto-detect CPU cores (default true) - --backup-dir string Backup directory (default "/var/lib/pgsql/db_backups") - --compression int Compression level (0-9) (default 6) - --cpu-workload string CPU workload type (cpu-intensive|io-intensive|balanced) (default "balanced") - --database string Database name (default "postgres") - -d, --db-type string Database type (postgres|mysql|mariadb) (default "postgres") - --debug Enable debug logging - --dump-jobs int Number of parallel dump jobs (default 8) - --host string Database host (default "localhost") - --insecure Disable SSL (shortcut for --ssl-mode=disable) - --jobs int Number of parallel jobs (default 8) - --max-cores int Maximum CPU cores to use (default 16) - --no-color Disable colored output - --password string Database password - --port int Database port (default 5432) - --ssl-mode string SSL mode for connections (default "prefer") - --user string Database user (default "postgres") ---- -โœ… PASS: Interactive mode help - -================================================================ - Test Suite Summary -================================================================ - -Total Tests: 54 -Passed: 48 -Failed: 6 -Skipped: 0 - -โŒ FAIL: 6 test(s) failed - -Results saved to: test_results_20251110_090957.txt - -[09:11:12] Cleaning up test environment... -[09:11:12] Cleanup complete