Fix VIM automated tests

VIM automated tests were broken after FM APIs were removed from
sysinv. This updated contains the following changes that enable
VIM automated tests:

1.Add the FM endpoint information to the scenario tests config file
2.Change the alarm-list and event-list CLI from system shell to fm shell
3.Fix two exception error messages

Closes-Bug: 1790906

Change-Id: If712d09861a20aa8a8796300bfa18e17f1d3be7d
Signed-off-by: Tao Liu <tao.liu@windriver.com>
This commit is contained in:
Tao Liu 2018-09-05 11:54:01 -05:00
parent 483cf84c0b
commit 0d00446d7b
4 changed files with 14 additions and 8 deletions

View File

@ -32,7 +32,7 @@ def get_logs(token, start=None, end=None):
"""
url = token.get_service_url(OPENSTACK_SERVICE.FM)
if url is None:
raise ValueError("OpenStack SysInv URL is invalid")
raise ValueError("OpenStack FM URL is invalid")
api_cmd = url + "/event_log?logs=True"
@ -61,7 +61,7 @@ def get_alarm_history(token, start=None, end=None):
"""
url = token.get_service_url(OPENSTACK_SERVICE.FM)
if url is None:
raise ValueError("OpenStack SysInv URL is invalid")
raise ValueError("OpenStack FM URL is invalid")
api_cmd = url + "/event_log?alarms=True"

View File

@ -69,6 +69,12 @@ service_name=sysinv
service_type=platform
endpoint_type=admin
[fm]
region_name=RegionOne
service_name=fm
service_type=faultmanagement
endpoint_type=admin
[mtc]
endpoint_override=http://localhost:2112

View File

@ -120,7 +120,7 @@ class TestHost(_test_base.Test):
open(filename, 'w').close()
os.system("source /etc/nova/openrc; echo -e '\tALARM-LIST' >> %s; "
"system alarm-list --nowrap | sed 's/^/\t /' >> %s; "
"fm alarm-list --nowrap | sed 's/^/\t /' >> %s; "
"echo -e '\n' >> %s" % (filename, filename, filename))
def save_customer_logs(self, filename, wipe=False):
@ -131,7 +131,7 @@ class TestHost(_test_base.Test):
open(filename, 'w').close()
os.system("source /etc/nova/openrc; echo -e '\tLOG-LIST' >> %s; "
"system event-list --logs --nowrap --nopaging --limit 100 --query "
"fm event-list --logs --nowrap --nopaging --limit 100 --query "
"'start=%s;end=%s' | sed 's/^/\t /' >> %s; echo -e '\n' >> %s"
% (filename, self._start_datetime, self._end_datetime,
filename, filename))
@ -144,7 +144,7 @@ class TestHost(_test_base.Test):
open(filename, 'w').close()
os.system("source /etc/nova/openrc; echo -e '\tALARM-HISTORY' >> %s; "
"system event-list --alarms --nowrap --nopaging --limit 100 "
"fm event-list --alarms --nowrap --nopaging --limit 100 "
"--query 'start=%s;end=%s' | sed 's/^/\t /' >> %s; "
"echo -e '\n' >> %s"
% (filename, self._start_datetime, self._end_datetime,

View File

@ -119,7 +119,7 @@ class TestInstance(_test_base.Test):
open(filename, 'w').close()
os.system("source /etc/nova/openrc; echo -e '\tALARM-LIST' >> %s; "
"system alarm-list --nowrap | sed 's/^/\t /' >> %s; "
"fm alarm-list --nowrap | sed 's/^/\t /' >> %s; "
"echo -e '\n' >> %s" % (filename, filename, filename))
def save_customer_logs(self, filename, wipe=False):
@ -130,7 +130,7 @@ class TestInstance(_test_base.Test):
open(filename, 'w').close()
os.system("source /etc/nova/openrc; echo -e '\tLOG-LIST' >> %s; "
"system event-list --logs --nowrap --nopaging --limit 100 --query "
"fm event-list --logs --nowrap --nopaging --limit 100 --query "
"'start=%s;end=%s' | sed 's/^/\t /' >> %s; echo -e '\n' >> %s"
% (filename, self._start_datetime, self._end_datetime,
filename, filename))
@ -143,7 +143,7 @@ class TestInstance(_test_base.Test):
open(filename, 'w').close()
os.system("source /etc/nova/openrc; echo -e '\tALARM-HISTORY' >> %s; "
"system event-list --alarms --nowrap --nopaging --limit 100 "
"fm event-list --alarms --nowrap --nopaging --limit 100 "
"--query 'start=%s;end=%s' | sed 's/^/\t /' >> %s; "
"echo -e '\n' >> %s"
% (filename, self._start_datetime, self._end_datetime,