create subunit test results for the undercloud sanity check
In OpenStack health all the tests are marked as failures because by default we create a failing subunit result for all jobs. We need to create results for the undercloud. Related-Bug: #1729686 Change-Id: I4850eaadc09035577cb48a367c5f482ed07b7a32
This commit is contained in:
parent
d1cd3cd9e4
commit
42d71884f9
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
## Validate the undercloud installation
|
## Validate the undercloud installation
|
||||||
## ====================================
|
## ====================================
|
||||||
|
script_return_value=0
|
||||||
|
|
||||||
|
## * Install deps for subunit results
|
||||||
|
sudo yum install -y python-os-testr
|
||||||
|
|
||||||
## * Set the uri of TripleO UI based on SSL usage
|
## * Set the uri of TripleO UI based on SSL usage
|
||||||
## ::
|
## ::
|
||||||
|
@ -13,27 +17,52 @@ function ui_sanity_check {
|
||||||
if [ -f "/etc/httpd/conf.d/25-tripleo-ui.conf" ]; then
|
if [ -f "/etc/httpd/conf.d/25-tripleo-ui.conf" ]; then
|
||||||
if ! curl {{ ui_uri }} 2>/dev/null | grep -q 'TripleO'; then
|
if ! curl {{ ui_uri }} 2>/dev/null | grep -q 'TripleO'; then
|
||||||
echo "ERROR: TripleO UI front page is not loading."
|
echo "ERROR: TripleO UI front page is not loading."
|
||||||
exit 1
|
generate-subunit $(date +%s) 10 fail tripleo_ui_test >> {{ working_dir }}/undercloud_sanity.subunit
|
||||||
|
script_return_value=1
|
||||||
fi
|
fi
|
||||||
|
generate-subunit $(date +%s) 10 success tripleo_ui_test >> {{ working_dir }}/undercloud_sanity.subunit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# * Specify the function to test CLI
|
||||||
|
## ::
|
||||||
|
function citest {
|
||||||
|
test_name=`sed 's/ /_/g' <<< "$@"`
|
||||||
|
"$@"
|
||||||
|
local status=$?
|
||||||
|
if [ $status -ne 0 ]; then
|
||||||
|
echo "error with $1" >&2
|
||||||
|
generate-subunit $(date +%s) 10 fail $test_name >> {{ working_dir }}/undercloud_sanity.subunit
|
||||||
|
script_return_value=1
|
||||||
|
else
|
||||||
|
generate-subunit $(date +%s) 10 success $test_name >> {{ working_dir }}/undercloud_sanity.subunit
|
||||||
|
fi
|
||||||
|
return $status
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## * Check the answers from each undercloud service
|
## * Check the answers from each undercloud service
|
||||||
## ::
|
## ::
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
rm -f {{ working_dir }}/undercloud_sanity.subunit.gz
|
||||||
|
rm -f {{ working_dir }}/undercloud_sanity.subunit
|
||||||
|
|
||||||
source {{ working_dir}}/stackrc
|
source {{ working_dir}}/stackrc
|
||||||
openstack user list
|
citest openstack user list
|
||||||
openstack catalog list
|
citest openstack catalog list
|
||||||
nova service-list
|
citest nova service-list
|
||||||
glance image-list
|
citest glance image-list
|
||||||
neutron subnet-list
|
citest neutron subnet-list
|
||||||
neutron net-list
|
citest neutron net-list
|
||||||
neutron agent-list
|
citest neutron agent-list
|
||||||
ironic node-list
|
citest ironic node-list
|
||||||
openstack stack list
|
citest openstack stack list
|
||||||
ui_sanity_check
|
ui_sanity_check
|
||||||
|
|
||||||
|
exit $script_return_value
|
||||||
|
|
||||||
set +x
|
set +x
|
||||||
|
|
||||||
### --stop_docs
|
### --stop_docs
|
||||||
|
|
Loading…
Reference in New Issue