-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_backendai_env.sh
More file actions
executable file
·50 lines (40 loc) · 1.56 KB
/
test_backendai_env.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1.56 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
#!/bin/bash
# Test script for Backend.AI environment variable support
echo "Testing Backend.AI environment variable support..."
echo "================================================="
echo
# Set Backend.AI environment variables
export BACKENDAI_CLUSTER_HOSTS="node1.example.com,node2.example.com,node3.example.com"
export BACKENDAI_CLUSTER_HOST="node1.example.com"
export BACKENDAI_CLUSTER_ROLE="main"
echo "Environment variables set:"
echo " BACKENDAI_CLUSTER_HOSTS=$BACKENDAI_CLUSTER_HOSTS"
echo " BACKENDAI_CLUSTER_HOST=$BACKENDAI_CLUSTER_HOST"
echo " BACKENDAI_CLUSTER_ROLE=$BACKENDAI_CLUSTER_ROLE"
echo
# Build the project
echo "Building bssh..."
cargo build --release 2>/dev/null || cargo build --release
echo
echo "Test 1: List clusters (should show 'backendai' cluster)"
echo "---------------------------------------------------------"
./target/release/bssh list
echo
echo "Test 2: Execute command without -c flag (should auto-detect Backend.AI)"
echo "------------------------------------------------------------------------"
./target/release/bssh "echo test" 2>&1 | head -20
echo
echo "Test 3: Interactive mode without -c flag"
echo "-----------------------------------------"
echo "Command: ./target/release/bssh interactive --help"
./target/release/bssh interactive --help
echo
echo "Test 4: Ping nodes (connectivity test)"
echo "---------------------------------------"
./target/release/bssh ping 2>&1 | head -20
echo
echo "Cleaning up environment variables..."
unset BACKENDAI_CLUSTER_HOSTS
unset BACKENDAI_CLUSTER_HOST
unset BACKENDAI_CLUSTER_ROLE
echo "Tests complete!"