/ test-cli-chunking.sh
test-cli-chunking.sh
 1  #!/bin/bash
 2  
 3  echo "🧪 Testing CLI Chunking Behavior"
 4  echo "================================"
 5  
 6  # Create test directory and files
 7  mkdir -p test-cli-files
 8  cd test-cli-files
 9  
10  # Create files of different sizes
11  echo "Creating test files..."
12  dd if=/dev/zero of=small-50kb.txt bs=1024 count=50 2>/dev/null
13  dd if=/dev/zero of=medium-150kb.txt bs=1024 count=150 2>/dev/null
14  dd if=/dev/zero of=large-2mb.txt bs=1024 count=2048 2>/dev/null
15  
16  echo "Test files created:"
17  ls -lh *.txt
18  
19  echo ""
20  echo "Testing CLI sync with dry-run to see provider configuration..."
21  
22  # Test with dry-run to see what provider is being used
23  echo ""
24  echo "1. Testing S3 provider creation..."
25  ../bin/keepsync sync . s3://test-bucket/test-path --dry-run --verbose --log-level debug
26  
27  echo ""
28  echo "2. Testing with explicit chunking settings..."
29  ../bin/keepsync sync . s3://test-bucket/test-path --dry-run --verbose --chunk-size 102400 --log-level debug
30  
31  # Clean up
32  cd ..
33  rm -rf test-cli-files
34  
35  echo ""
36  echo "Test completed. Check the output above for:"
37  echo "- Provider type being created"
38  echo "- Chunking configuration"
39  echo "- Any error messages"