Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gnocchi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cloud
charms
gnocchi
Commits
1f725598
Commit
1f725598
authored
8 years ago
by
James Page
Browse files
Options
Downloads
Patches
Plain Diff
Add basic gnocchi status check
parent
963528c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tests/basic_deployment.py
+21
-0
21 additions, 0 deletions
src/tests/basic_deployment.py
with
21 additions
and
0 deletions
src/tests/basic_deployment.py
+
21
−
0
View file @
1f725598
...
...
@@ -22,6 +22,10 @@ import time
import
charmhelpers.contrib.openstack.amulet.deployment
as
amulet_deployment
import
charmhelpers.contrib.openstack.amulet.utils
as
os_amulet_utils
from
gnocchiclient.v1
import
client
as
gnocchi_client
from
keystoneclient
import
session
as
keystone_session
from
keystoneclient.auth
import
identity
as
keystone_identity
# Use DEBUG to turn on debug logging
u
=
os_amulet_utils
.
OpenStackAmuletUtils
(
os_amulet_utils
.
DEBUG
)
...
...
@@ -118,6 +122,17 @@ class GnocchiCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
password
=
'
openstack
'
,
tenant
=
'
admin
'
)
# Authenticate admin with gnocchi endpoint
keystone_ep
=
self
.
keystone
.
service_catalog
.
url_for
(
service_type
=
'
identity
'
,
interface
=
'
publicURL
'
)
auth
=
keystone_identity
.
V2Token
(
auth_url
=
keystone_ep
,
token
=
self
.
keystone
.
auth_token
)
sess
=
keystone_session
.
Session
(
auth
=
auth
)
self
.
gnocchi
=
gnocchi_client
.
Client
(
session
=
sess
)
def
check_and_wait
(
self
,
check_command
,
interval
=
2
,
max_wait
=
200
,
desc
=
None
):
waited
=
0
...
...
@@ -168,3 +183,9 @@ class GnocchiCharmDeployment(amulet_deployment.OpenStackAmuletDeployment):
amulet
.
raise_status
(
amulet
.
FAIL
,
msg
=
ret
)
u
.
log
.
debug
(
'
OK
'
)
def
test_200_api_connection
(
self
):
"""
Simple api calls to check service is up and responding
"""
u
.
log
.
debug
(
'
Checking api functionality...
'
)
assert
(
self
.
gnocchi
.
status
()
!=
[])
u
.
log
.
debug
(
'
OK
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment