summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyota MIBU <r-mibu@cq.jp.nec.com>2017-03-08 06:53:40 +0000
committerRyota MIBU <r-mibu@cq.jp.nec.com>2017-03-08 09:01:05 +0000
commitc86393e972ce849a48e1cf43d079be30dd149ed4 (patch)
treea53e5993b6f7810c815d5dc613fbdf0b39b755ed
parenta748fd98e83b7ad63ccef6a3af529963991bb3d0 (diff)
[apex] change config for doctor testing
JIRA: DOCTOR-96 Change-Id: I5b0923ffeb53ff53ad9f780b8b5ebdce834d995a Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
-rw-r--r--tests/lib/installers/apex64
1 files changed, 63 insertions, 1 deletions
diff --git a/tests/lib/installers/apex b/tests/lib/installers/apex
index d9c41f80..55878dec 100644
--- a/tests/lib/installers/apex
+++ b/tests/lib/installers/apex
@@ -24,10 +24,44 @@ function get_controller_ips {
die_if_not_set $LINENO CONTROLLER_IPS "No controller IPs"
}
+function installer_apply_patches {
+ # TODO(r-mibu): fix the followings in upstream (apex)
+ for node in $CONTROLLER_IPS;do
+ echo "check controller configuration for doctor ($node)"
+ ssh $ssh_opts_cpu "heat-admin@$node" '
+ set -x
+ date
+ echo "### apply patches (installer=apex)"
+
+ ep_conf=/etc/ceilometer/event_pipeline.yaml
+ ep_entry="- notifier://?topic=alarm.all"
+ if sudo grep -e "$ep_entry" $ep_conf; then
+ echo "NOTE: ceilometer is configured as we needed"
+ else
+ echo "modify the ceilometer config"
+ sudo sed -i -e "$ a \ \ \ \ \ \ \ \ \ \ $ep_entry # added by doctor script" $ep_conf
+ sudo systemctl restart openstack-ceilometer-notification.service
+ fi
+
+ co_conf=/etc/congress/congress.conf
+ co_entry="congress.datasources.doctor_driver.DoctorDriver"
+ if sudo grep -e "^drivers.*$co_entry" $co_conf; then
+ echo "NOTE: congress is configured as we needed"
+ else
+ echo "modify the congress config"
+ sudo sed -i -e "/^drivers/s/$/,$co_entry # added by doctor script/" \
+ $co_conf
+ sudo systemctl restart openstack-congress-server.service
+ fi
+ ' > installer_apply_patches_$node.log 2>&1
+ done
+}
+
function setup_installer {
get_installer_ip
installer_get_ssh_keys
get_controller_ips
+ installer_apply_patches
# NOTE: while executing command as doctor user,
# 'OS_PROJECT_ID' env parameter make openstack clients confused.
@@ -45,7 +79,35 @@ function get_compute_ip_from_hostname {
die_if_not_set $LINENO COMPUTE_IP "Could get IP address of $compute_host."
}
+function installer_revert_patches {
+ # TODO(r-mibu): fix the followings in upstream (apex)
+ get_controller_ips
+ for node in $CONTROLLER_IPS;do
+ echo "restore controller configuration if touched ($node)"
+ ssh $ssh_opts_cpu "heat-admin@$node" '
+ set -x
+ echo "### revert patches (installer=apex)"
+ date
+
+ co_conf=/etc/congress/congress.conf
+ co_entry="congress.datasources.doctor_driver.DoctorDriver"
+ if sudo grep -q -e "# added by doctor script" $co_conf; then
+ echo "modify the congress config"
+ sudo sed -i -e "/^drivers/s/^\(.*\),$co_entry # added by doctor script/\1/" $co_conf
+ sudo systemctl restart openstack-congress-server.service
+ fi
+
+ ep_conf=/etc/ceilometer/event_pipeline.yaml
+ if sudo grep -q -e "# added by doctor script" $ep_conf; then
+ echo "modify the ceilometer config"
+ sudo sed -ie "/# added by doctor script/d" $ep_conf
+ sudo systemctl restart openstack-ceilometer-notification.service
+ fi
+ ' >> installer_apply_patches_$node.log 2>&1
+ done
+}
+
function cleanup_installer {
- # Noop
+ installer_revert_patches
return
}