@@ -78,16 +78,24 @@ turbinia-client config list
78
78
echo " Running Turbinia: turbinia-client submit googleclouddisk --project $GCP_PROJECT --zone $GCP_ZONE --disk_name $DISK --request_id $REQUEST_ID "
79
79
turbinia-client submit googleclouddisk --project $GCP_PROJECT --zone $GCP_ZONE --disk_name $DISK --request_id $REQUEST_ID
80
80
81
- # Wait until request is complete
82
- sleep 5
81
+ # Wait until request is received
82
+ req=$( turbinia-client status request $REQUEST_ID -j)
83
+ while [[ -z " $req " ]]
84
+ do
85
+ echo " Request $REQUEST_ID is still populating. Sleeping for 5 seconds..."
86
+ sleep 5
87
+ req=$( turbinia-client status request $REQUEST_ID -j)
88
+ done
89
+
90
+ # Wait until request is complete
83
91
req_status=$( turbinia-client status request $REQUEST_ID -j | jq -r ' .status' )
84
- while [ $req_status = " running" ]
92
+ while [[ $req_status = " running" ] ]
85
93
do
86
94
req_status=$( turbinia-client status request $REQUEST_ID -j | jq -r ' .status' )
87
95
if [[ $req_status = " running" ]]
88
96
then
89
- echo " Turbinia request $REQUEST_ID is still running. Sleeping for 10 seconds..."
90
- sleep 10
97
+ echo " Turbinia request $REQUEST_ID is still running. Sleeping for 180 seconds..."
98
+ sleep 180
91
99
fi
92
100
done
93
101
@@ -100,7 +108,7 @@ length=$(echo $task_status | jq '. | length')
100
108
# Check if there is a failed Turbinia Task
101
109
if [[ $length > 0 ]]
102
110
then
103
- echo " A failed Task for Turbinia Request $req has been detected. "
111
+ echo " A failed Task for Turbinia Request $REQUEST_ID has been detected"
104
112
echo " Listing failed Tasks..."
105
113
# Grab the Task ID
106
114
tasks=$( echo $task_status | jq -r ' .[] | .id' )
124
132
done
125
133
# If no failed Tasks were detected
126
134
else
127
- echo " No failed Tasks detected for Turbinia request $req "
135
+ echo " No failed Tasks detected for Turbinia request $REQUEST_ID "
128
136
fi
129
137
130
138
# Restore previous Turbinia config
@@ -145,4 +153,4 @@ echo "Turbinia integration tests succeeded!"
145
153
echo -n " Ended at "
146
154
date -Iseconds
147
155
148
- exit 0
156
+ exit 0
0 commit comments