GITHUB
If nothing happens, download the sumuoi.mobi extension for Visual Studio and try again.Bạn đang xem: Github
Go back


OverviewTest Setup
Purpose
Smoke tests are a suite of basic core functionality tests for Cloud Foundry.They are suitable as an initial test against a new or updated deployment toreveal fundamental problems with the system.
Bạn đang xem: Github
There are three tests in this suite, all of which are pretty simple:
runtime: Pushes an app and validates that HTTP requests are properly routed to the app.logging: Pushes an app and validates that logs can be fetched for the app.isolation_segments: Entitles an org to an isolation segment and pushes two apps,one to the isolation segment, and one to the shared segment.The test validates that isolated apps are only accessed via the isolated router,and that apps on the shared segment are only accessed via the shared router.
They are not intended to test more sophisticated functionality of Cloud Foundryor to test administrator operations. The CF AcceptanceTests do perform thismore extensive testing, although they are designed to be run as part of adevelopment pipeline and not against production environments.
Test Setup
Dependencies
Set up your golang development environment, per golang.org.
Make sure you have the following installed:
Check out a copy of cf-smoke-tests and make sure that it is added to your$GOPATH. The recommended way to do this is to run go get -u -d sumuoi.mobi/cloudfoundry/cf-smoke-tests. You will receive a warning “nobuildable Go source files”; this can be ignored as there is no compilable gocode in the package.(Alternatively, you can simply cd into the directoryand run git pull.)
To run the CF Smoke tests, you will need:
a running CF instancean environment variable $CONFIG which points to a .json file thatcontains the application domain
ConfigBelow is an example integration_config.json:
{ “suite_name” : “CF_SMOKE_TESTS”, “api” : “api.bosh-lite.com”, “apps_domain” : “bosh-lite.com”, “user” : “non-admin”, “password” : “super-secure”, “cleanup” : true, “logging_app” : “”, “runtime_app” : “”, “enable_windows_tests” : false, “windows_stack” : “windows2012R2”, “isolation_segment_name” : “is1”, “isolation_segment_domain” : “is1.bosh-lite.com”, “enable_isolation_segment_tests” : true}The following are special case configurations.
CredentialsMust supply one of the following login credentials.
Xem thêm: ‘ Here You Go Nghĩa Là Gì, Here You Go
User credentials
“user”: “username”, “password”: “password”Client credentials “client”: “client-name”, “client_secret”: “client-secret”Skip SSL validationIf you are running the tests against bosh-lite or any other environment usingself-signed certificates, add
“skip_ssl_validation”: trueOrg and space cleanupIf you would like to preserve the organization, space, and app created during thetests for debugging, add
“cleanup”: falseWindowsIf you have deployed Windows cells, add
If you”d like to run isolation segment tests, set enable_isolation_segment_tests to true and provide values for isolation_segment_name, isolation_segment_domain.For more details on how to setup routing isolation segments, read this document.
Artifacts directoryTo store cf cli trace output, set
“artifacts_directory”: “/tmp/smoke-artifacts”The following files may be created:
CF-TRACE-Smoke-1.txtCF-TRACE-Smoke-2.txtjunit-Applications-1.xml…Admin vs. Regular UserSmoke tests can be configured withtwo types of users.
Admin user:Smoke tests can be configured to run using admin credentials.Given this configuration,the tests may or may not use existing resources like orgs and spaces,because an admin user can easily create them.This configuration is recommended for tests run against environments created using automation tools,for example, CI (continuous integration) environments on development teams.
NOTE:If you are enabling isolation segments tests and would liketo use a non-admin user, the existing organization providedas org configuration property must be entitled to theisolation segment provided by isolation_segment_name.In addition, you need to create a space insideorg and provide it as isolation_segment_space.isolation_segment_space must be assigned the isolation segmentisolation_segment_name.
have the following set up:
The smoke-tests org must be entitled to use the isolation segment.The space that is referred to as isolation_segment_space in the smoke-tests config must be assigned to the isolation segment
Running TestsTo execute the tests, run:
Arguments, such as -focus=, -nodes=, etc., that are passed to the script are sent to ginkgo
For example, to execute tests in parallel across two processes one would run:
./bin/test -nodes=2
Seeing command-line output
To see verbose output from cf, use ginkgo”s -v flag.