-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_enhanced.sh
More file actions
executable file
·64 lines (50 loc) · 1.38 KB
/
test_enhanced.sh
File metadata and controls
executable file
·64 lines (50 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
echo "Testing enhanced hyperV functionality..."
# Build the application
echo "Building hyperV..."
cargo build --release
# Test the new features
echo ""
echo "1. Testing log following (will create a task that generates logs)"
# Create a simple log-generating script
cat > /tmp/log_generator.sh << 'EOF'
#!/bin/bash
echo "Starting log generator..."
for i in {1..10}; do
echo "Log entry $i at $(date)"
sleep 1
done
echo "Log generator finished"
EOF
chmod +x /tmp/log_generator.sh
# Test task creation with enhanced fields
echo ""
echo "2. Creating a test task..."
./target/release/hyperV new \
--name "log-test" \
--binary "/tmp/log_generator.sh" \
--auto-restart
echo ""
echo "3. Starting the task..."
./target/release/hyperV start log-test
echo ""
echo "4. Checking status (should show new fields)..."
./target/release/hyperV status log-test
echo ""
echo "5. Showing logs..."
./target/release/hyperV logs log-test --lines 5
echo ""
echo "6. Testing log following for 3 seconds..."
timeout 3s ./target/release/hyperV logs log-test --follow || true
echo ""
echo "7. Stopping the task..."
./target/release/hyperV stop log-test
echo ""
echo "8. Final status check..."
./target/release/hyperV status log-test
echo ""
echo "9. Cleaning up..."
./target/release/hyperV remove log-test
rm -f /tmp/log_generator.sh
echo ""
echo "✅ Enhanced functionality test completed!"