зеркало из https://github.com/SteeltoeOSS/Samples.git
add test for management endpoints
This commit is contained in:
Родитель
4391b01a87
Коммит
895f22ce8e
|
@ -1,5 +1,3 @@
|
|||
# TODO: how to verify management endpoint
|
||||
|
||||
@cloud
|
||||
Feature: Cloud Foundry Samples
|
||||
In order to show you how to use Steeltoe Management Endpoint
|
||||
|
@ -16,6 +14,7 @@ Feature: Cloud Foundry Samples
|
|||
And you run: dotnet publish -f netcoreapp2.1 -r win10-x64
|
||||
And you run in the background: cf push -f manifest-windows.yml -p bin/Debug/netcoreapp2.1/win10-x64/publish
|
||||
And you wait until CloudFoundry app actuator is started
|
||||
Then you should be able to access CloudFoundry app actuator management endpoints
|
||||
|
||||
@netcoreapp2.1
|
||||
@ubuntu.14.04-x64
|
||||
|
@ -28,6 +27,7 @@ Feature: Cloud Foundry Samples
|
|||
And you run: dotnet publish -f netcoreapp2.1 -r ubuntu.14.04-x64
|
||||
And you run in the background: cf push -f manifest.yml -p bin/Debug/netcoreapp2.1/ubuntu.14.04-x64/publish
|
||||
And you wait until CloudFoundry app actuator is started
|
||||
Then you should be able to access CloudFoundry app actuator management endpoints
|
||||
|
||||
@net461
|
||||
@win10-x64
|
||||
|
@ -40,3 +40,4 @@ Feature: Cloud Foundry Samples
|
|||
And you run: dotnet publish -f net461 -r win10-x64
|
||||
And you run in the background: cf push -f manifest-windows.yml -p bin/Debug/net461/win10-x64/publish
|
||||
And you wait until CloudFoundry app actuator is started
|
||||
Then you should be able to access CloudFoundry app actuator management endpoints
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
from behave import *
|
||||
import command
|
||||
import mechanicalsoup
|
||||
import requests
|
||||
import resolve
|
||||
import sure
|
||||
import time
|
||||
|
@ -47,3 +49,18 @@ def step_impl(context, url):
|
|||
@then(u'you should see "{text}"')
|
||||
def step_impl(context, text):
|
||||
context.browser.get_current_page().get_text().should.match(r'.*{}.*'.format(text))
|
||||
|
||||
@then(u'you should be able to access CloudFoundry app {app} management endpoints')
|
||||
def step_impl(context, app):
|
||||
url = resolve.url(context, 'https://{}.x.y.z/cloudfoundryapplication'.format(app))
|
||||
token = get_oauth_token(context)
|
||||
resp = requests.get(url, headers={'Authorization': token})
|
||||
resp.status_code.should.equal(200)
|
||||
context.log.info(resp.content)
|
||||
for endpoint in ['info', 'health', 'loggers', 'trace', 'mappings']:
|
||||
resp.text.should.contain('/cloudfoundryapplication/{}'.format(endpoint))
|
||||
|
||||
def get_oauth_token(context):
|
||||
cmd = command.Command(context, 'cf oauth-token')
|
||||
cmd.run()
|
||||
return cmd.stdout.strip()
|
||||
|
|
Загрузка…
Ссылка в новой задаче