summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
f006ec1)
Fix the check_host_status, modify the `TEST_ROLE`
as `admin` temporary.
Change-Id: I7260ef027cc75fe71db3a3b706f3720a93821e10
Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
DOCTOR_USER=doctor
DOCTOR_PW=doctor
DOCTOR_PROJECT=doctor
DOCTOR_USER=doctor
DOCTOR_PW=doctor
DOCTOR_PROJECT=doctor
+#TODO: change back to `_member_` when JIRA DOCTOR-55 is done
+DOCTOR_ROLE=admin
SUPPORTED_INSTALLER_TYPES="apex local"
INSTALLER_TYPE=${INSTALLER_TYPE:-apex}
SUPPORTED_INSTALLER_TYPES="apex local"
INSTALLER_TYPE=${INSTALLER_TYPE:-apex}
awk '{d = $1 - $2; if (d < 1 && d > 0) print d " OK"; else print d " NG"}'
}
awk '{d = $1 - $2; if (d < 1 && d > 0) print d " OK"; else print d " NG"}'
}
-check_host_status_down() {
+check_host_status() {
+ expect_state=$1
(
change_to_doctor_user
host_status_line=$(nova show $VM_NAME | grep "host_status")
(
change_to_doctor_user
host_status_line=$(nova show $VM_NAME | grep "host_status")
+ if [[ $? -ne 0 ]] ; then
echo "ERROR: host_status not configured for owner in Nova policy.json"
echo "ERROR: host_status not configured for owner in Nova policy.json"
host_status=$(echo $host_status_line | awk '{print $4}')
host_status=$(echo $host_status_line | awk '{print $4}')
- [[ "$host_status" == "DOWN" ]] && {
+ if [ -z "$host_status" ] ; then
+ echo "ERROR: host_status not reported by: nova show $VM_NAME"
+ exit 1
+ elif [[ "$host_status" != "$expect_state" ]] ; then
+ echo "ERROR: host_status:$host_status not equal to expect_state: $expect_state"
+ exit 1
+ else
echo "$VM_NAME showing host_status: $host_status"
echo "$VM_NAME showing host_status: $host_status"
- }
- echo "ERROR: host_status not reported by: nova show $VM_NAME"
openstack project delete "$DOCTOR_PROJECT"
openstack user delete "$DOCTOR_USER"
openstack project delete "$DOCTOR_PROJECT"
openstack user delete "$DOCTOR_USER"
- #TODO: add host status check via nova admin api
echo "waiting disabled compute host back to be enabled..."
sleep 180
echo "waiting disabled compute host back to be enabled..."
sleep 180
ssh $ssh_opts_cpu "$COMPUTE_USER@$COMPUTE_IP" \
"[ -e disable_network.log ] && cat disable_network.log"
}
ssh $ssh_opts_cpu "$COMPUTE_USER@$COMPUTE_IP" \
"[ -e disable_network.log ] && cat disable_network.log"
}
+check_host_status "DOWN"
calculate_notification_time
echo "done"
calculate_notification_time
echo "done"