first commit
This commit is contained in:
commit
443558bafc
4 changed files with 1099 additions and 0 deletions
55
test-script.sh
Executable file
55
test-script.sh
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Test script for GRUB repair script
|
||||
# This script tests basic functionality without actually mounting systems
|
||||
|
||||
echo "Testing GRUB repair script..."
|
||||
|
||||
# Test help functionality
|
||||
echo "Testing help command..."
|
||||
./grub-repair.sh --help > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✓ Help command works"
|
||||
else
|
||||
echo "✗ Help command failed"
|
||||
fi
|
||||
|
||||
# Test detect command (should work without root)
|
||||
echo "Testing detect command..."
|
||||
./grub-repair.sh detect > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✓ Detect command works"
|
||||
else
|
||||
echo "✗ Detect command failed (expected without root)"
|
||||
fi
|
||||
|
||||
# Test invalid command
|
||||
echo "Testing invalid command..."
|
||||
./grub-repair.sh invalid-command > /dev/null 2>&1
|
||||
if [ $? -eq 1 ]; then
|
||||
echo "✓ Invalid command handling works"
|
||||
else
|
||||
echo "✗ Invalid command handling failed"
|
||||
fi
|
||||
|
||||
# Test script syntax
|
||||
echo "Testing script syntax..."
|
||||
bash -n grub-repair.sh
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✓ Script syntax is valid"
|
||||
else
|
||||
echo "✗ Script syntax errors found"
|
||||
fi
|
||||
|
||||
# Test script permissions
|
||||
if [ -x grub-repair.sh ]; then
|
||||
echo "✓ Script is executable"
|
||||
else
|
||||
echo "✗ Script is not executable"
|
||||
fi
|
||||
|
||||
echo "Basic tests completed!"
|
||||
echo ""
|
||||
echo "To run full tests (requires root):"
|
||||
echo "sudo ./grub-repair.sh detect"
|
||||
echo "sudo ./grub-repair.sh --help"
|
||||
Loading…
Add table
Add a link
Reference in a new issue