-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-webhook-integration.sh
More file actions
executable file
Β·151 lines (126 loc) Β· 4.74 KB
/
test-webhook-integration.sh
File metadata and controls
executable file
Β·151 lines (126 loc) Β· 4.74 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/bin/bash
# Test script for NodeODM webhook integration
# This simulates the registration/de-registration process without starting NodeODM
echo "π§ͺ Testing NodeODM Webhook Integration"
echo "====================================="
# Set up test environment variables
export CLUSTER_HOST="clusterodm.tacc.utexas.edu"
export CLUSTER_PORT="443"
export NODE_HOST="$(hostname)"
export NODE_PORT="3001"
export TAPIS_TOKEN="test:$(whoami):$(date +%s)"
echo "π Test Configuration:"
echo " Cluster: $CLUSTER_HOST:$CLUSTER_PORT"
echo " Node: $NODE_HOST:$NODE_PORT"
echo " Token: ${TAPIS_TOKEN:0:20}..."
echo ""
# Test 1: Registration
echo "π Test 1: Node Registration"
echo "----------------------------"
if [ -f "./register-node.sh" ]; then
echo "β
Registration script found"
# Test registration (will fail without ClusterODM running, but shows the process)
echo "Attempting registration..."
./register-node.sh --retries 1 --retry-delay 1
if [ $? -eq 0 ]; then
echo "β
Registration test completed successfully"
REGISTRATION_SUCCESS=true
else
echo "β οΈ Registration failed (expected if ClusterODM not accessible)"
REGISTRATION_SUCCESS=false
fi
else
echo "β Registration script not found"
REGISTRATION_SUCCESS=false
fi
echo ""
# Test 2: De-registration
echo "π Test 2: Node De-registration"
echo "------------------------------"
if [ -f "./deregister-node.sh" ]; then
echo "β
De-registration script found"
# Test de-registration
echo "Attempting de-registration..."
./deregister-node.sh --retries 1 --retry-delay 1
if [ $? -eq 0 ]; then
echo "β
De-registration test completed successfully"
DEREGISTRATION_SUCCESS=true
else
echo "β οΈ De-registration failed (expected if ClusterODM not accessible)"
DEREGISTRATION_SUCCESS=false
fi
else
echo "β De-registration script not found"
DEREGISTRATION_SUCCESS=false
fi
echo ""
# Test 3: ZIP package contents
echo "π¦ Test 3: ZIP Package Verification"
echo "----------------------------------"
if [ -f "./nodeodm-ls6.zip" ]; then
echo "β
ZIP package found"
echo "Package contents:"
unzip -l nodeodm-ls6.zip | grep -E "(register-node|deregister-node|tapisjob_app)"
# Check if webhook scripts are in the ZIP
if unzip -l nodeodm-ls6.zip | grep -q "register-node.sh"; then
echo "β
register-node.sh included in ZIP"
else
echo "β register-node.sh missing from ZIP"
fi
if unzip -l nodeodm-ls6.zip | grep -q "deregister-node.sh"; then
echo "β
deregister-node.sh included in ZIP"
else
echo "β deregister-node.sh missing from ZIP"
fi
else
echo "β ZIP package not found (run ./build-zip.sh first)"
fi
echo ""
# Test 4: Function definitions in main script
echo "βοΈ Test 4: Function Integration Check"
echo "-----------------------------------"
if [ -f "./tapisjob_app.sh" ]; then
echo "β
Main script found"
if grep -q "register_with_clusterodm" tapisjob_app.sh; then
echo "β
register_with_clusterodm function found"
else
echo "β register_with_clusterodm function missing"
fi
if grep -q "deregister_from_clusterodm" tapisjob_app.sh; then
echo "β
deregister_from_clusterodm function found"
else
echo "β deregister_from_clusterodm function missing"
fi
if grep -q "TAPIS_TOKEN" tapisjob_app.sh; then
echo "β
Tapis token usage found"
else
echo "β Tapis token usage missing"
fi
else
echo "β Main script not found"
fi
echo ""
# Summary
echo "π Test Summary"
echo "==============="
echo "Registration scripts: $([ -f register-node.sh ] && [ -f deregister-node.sh ] && echo "β
Present" || echo "β Missing")"
echo "ZIP package: $([ -f nodeodm-ls6.zip ] && echo "β
Built" || echo "β Not built")"
echo "Function integration: $(grep -q "register_with_clusterodm\|deregister_from_clusterodm" tapisjob_app.sh 2>/dev/null && echo "β
Integrated" || echo "β Not integrated")"
echo ""
echo "π Integration Status:"
if [ -f register-node.sh ] && [ -f deregister-node.sh ] && [ -f nodeodm-ls6.zip ]; then
echo "β
NodeODM webhook integration is ready for deployment!"
echo ""
echo "π Next steps:"
echo " 1. Upload nodeodm-ls6.zip to accessible URL"
echo " 2. Update app.json containerImage URL"
echo " 3. Submit Tapis job"
echo " 4. NodeODM will automatically register/de-register with ClusterODM"
else
echo "β οΈ Integration incomplete - check missing components above"
fi
echo ""
echo "π For debugging, check:"
echo " - ClusterODM admin interface: https://clusterodm.tacc.utexas.edu/admin"
echo " - NodeODM logs in job output"
echo " - Webhook endpoint: https://clusterodm.tacc.utexas.edu/webhook/"