Git Product home page Git Product logo

cf-acceptance-tests's Introduction

CF Acceptance Tests (CATs)

This suite exercises a Cloud Foundry deployment using the cf CLI and curl. It is scoped to testing user-facing, end-to-end features.

For example, one test pushes an app with cf push, hits an endpoint on the app with curl that causes it to crash, and asserts that we see a crash event in cf events.

Tests that won't be introduced here include things like basic CRUD of an object in the Cloud Controller. Such tests belong with the component they relate to.

These tests are not intended for use against production systems. They're meant for acceptance environments used by people developing Cloud Foundry's releases. While these tests attempt to clean up after themselves, there's no guarantee that they won't change the state of your system in an undesirable way. For lightweight system tests that are safe to run against a production environment, please use the CF Smoke Tests.

NOTE: Because we want to parallelize execution, tests should be written to be executable independently. Tests should not depend on state in other tests, and should not modify the CF state in such a way as to impact other tests.

  1. Test Setup
    1. Install Required Dependencies
    2. Test Configuration
  2. Test Execution
  3. Explanation of Test Groups
  4. Contributing

Test Setup

Prerequisites for running CATS

  • Install golang >= 1.21. Set up your golang development environment, per golang.org.
  • Install the cf CLI >= 8.5.0. Make sure that it is accessible in your $PATH.
  • Install curl
  • Check out a copy of cf-acceptance-tests. It uses Go modules, so there is no need to put it in $GOPATH.
  • Install a running Cloud Foundry deployment to run these acceptance tests against. For example, bosh-lite.

Updating go dependencies

All go dependencies required by CATs are vendored in the vendor directory.

Make sure to have Golang 1.21+

In order to update a current dependency to a specific version, do the following:

cd cf-acceptance-tests
source .envrc
go get <import_path>@<revision_number>
go mod vendor

If you'd like to add a new dependency just run:

go mod tidy
go mod vendor

Test Configuration

You must set the environment variable $CONFIG which points to a JSON file that contains several pieces of data that will be used to configure the acceptance tests, e.g. telling the tests how to target your running Cloud Foundry deployment and what tests to run.

The following can be pasted into a terminal and will set up a sufficient $CONFIG to run the core test suites against a BOSH-Lite deployment of CF.

See example-cats-config.json for reference.

Only the following test groups are run by default:

include_apps
include_detect
include_routing
include_v3

The full set of config parameters is explained below:

Required parameters:
  • api: Cloud Controller API endpoint, without scheme (HTTP/S) specified.
  • admin_user: Name of a user in your CF instance with admin credentials. This admin user must have the doppler.firehose scope.
  • admin_password: Password of the admin user above.
  • apps_domain: A shared domain that tests can use to create subdomains that will route to applications also created in the tests, without scheme (HTTP/S) specified.
  • skip_ssl_validation: Set to true if using an invalid (e.g. self-signed) cert for traffic routed to your CF instance; this is generally always true for BOSH-Lite deployments of CF.
Optional parameters:

include_* parameters are used to specify whether to skip tests based on how a deployment is configured.

  • include_app_syslog_tcp: Flag to include the app syslog drain over TCP test group.

  • include_apps: Flag to include the apps test group.

  • readiness_health_checks_enabled: Defaults to true. Set to false if you are using an environment without readiness health checks.

  • include_container_networking: Flag to include tests related to container networking.

  • credhub_mode: Valid values are assisted or non-assisted. See below.

  • credhub_location: Location of CredHub instance; default is https://credhub.service.cf.internal:8844

  • credhub_client: UAA client credential for Service Broker write access to CredHub (required for CredHub tests); default is credhub_admin_client.

  • credhub_secret: UAA client secret for Service Broker write access to CredHub (required for CredHub tests).

  • include_deployments: Flag to include tests for the cloud controller rolling deployments. V3 must also be enabled.

  • include_detect: Flag to include tests in the detect group.

  • include_docker: Flag to include tests related to running Docker apps on Diego. Diego must be deployed and the CC API docker_diego feature flag must be enabled for these tests to pass.

  • include_http2_routing: Flag to include the HTTP/2 Routing tests.

  • include_internet_dependent: Flag to include tests that require the deployment to have internet access.

  • include_isolation_segments: Flag to include isolation segment tests.

  • include_private_docker_registry: Flag to run tests that rely on a private docker image. See below.

  • include_route_services: Flag to include the route services tests. Diego must be deployed for these tests to pass.

  • include_routing: Flag to include the routing tests.

  • include_routing_isolation_segments: Flag to include routing isolation segments tests. See below. Cannot be run together with logging isolation segments tests.

  • include_security_groups: Flag to include tests for security groups. See below

  • dynamic_asgs_enabled: Defaults to true. Set to false if dynamic ASGs are disabled in the test environment.

  • comma_delim_asgs_enabled: Defaults to false. Set to true if comma delimited ASG destinations are enabled in the test environment.

  • include_services: Flag to include test for the services API.

  • include_service_instance_sharing: Flag to include tests for service instance sharing between spaces. include_services must be set for these tests to run. The service_instance_sharing feature flag must also be enabled for these tests to pass.

  • include_ssh: Flag to include tests for Diego container ssh feature.

  • include_sso: Flag to include the services tests that integrate with Single Sign On. include_services must also be set for tests to run.

  • include_tasks: Flag to include the v3 task tests. include_v3 must also be set for tests to run. The CC API task_creation feature flag must be enabled for these tests to pass.

  • include_tcp_routing: Flag to include the TCP Routing tests. These tests are equivalent to the TCP Routing tests from the Routing Acceptance Tests.

  • include_user_provided_services: Flag to include test for user-provided services.

  • include_v3: Flag to include tests for the v3 API.

  • include_zipkin: Flag to include tests for Zipkin tracing. include_routing must also be set for tests to run. CF must be deployed with router.tracing.enable_zipkin set for tests to pass.

  • use_http: Set to true if you would like CF Acceptance Tests to use HTTP when making api and application requests. (default is HTTPS)

  • use_existing_organization: Set to true when you need to specify an existing organization to use rather than creating a new organization.

  • existing_organization: Name of the existing organization to use.

  • use_existing_user: The admin user configured above will normally be used to create a temporary user (with lesser permissions) to perform actions (such as push applications) during tests, and then delete said user after the tests have run; set this to true if you want to use an existing user, configured via the following properties.

  • keep_user_at_suite_end: If using an existing user (see above), set this to true unless you are okay having your existing user being deleted at the end. You can also set this to true when not using an existing user if you want to leave the temporary user around for debugging purposes after the test teardown.

  • existing_user: Name of the existing user to use.

  • existing_user_password: Password for the existing user to use.

  • artifacts_directory: If set, cf CLI trace output from test runs will be captured in files and placed in this directory. See below for more.

  • default_timeout: Default time (in seconds) to wait for polling assertions that wait for asynchronous results.

  • cf_push_timeout: Default time (in seconds) to wait for cf push commands to succeed.

  • long_curl_timeout: Default time (in seconds) to wait for assertions that curl slow endpoints of test applications.

  • broker_start_timeout (only relevant for services test group): Time (in seconds) to wait for service broker test app to start.

  • async_service_operation_timeout (only relevant for the services test group): Time (in seconds) to wait for an asynchronous service operation to complete.

  • test_password: Used to set the password for the test user. This may be needed if your CF installation has password policies.

  • timeout_scale: Used primarily to scale default timeouts for test setup and teardown actions (e.g. creating an org) as opposed to main test actions (e.g. pushing an app).

  • isolation_segment_name: Name of the isolation segment to use for the isolation segments test.

  • isolation_segment_domain: Domain that will route to the isolated router in the isolation segments and routing isolation segments tests. See below

  • private_docker_registry_image: Name of the private docker image to use when testing private docker registries. See below

  • private_docker_registry_username: Username to access the private docker repository. See below

  • private_docker_registry_password: Password to access the private docker repository. See below

  • unallocated_ip_for_security_group: An unused IP address in the private network used by CF. Defaults to 10.0.244.255. See below

  • require_proxied_app_traffic: Set this to true if Diego was configured to require proxied port mappings, i.e. if containers.proxy.enable_unproxied_port_mappings is set to false.

  • staticfile_buildpack_name See below

  • java_buildpack_name See below

  • ruby_buildpack_name See below

  • nginx_buildpack_name See below

  • nodejs_buildpack_name See below

  • go_buildpack_name See below

  • r_buildpack_name See below

  • binary_buildpack_name See below

  • include_windows: Flag to include the tests that run against Windows cells.

  • use_windows_test_task: Flag to include the tasks tests on Windows cells. Default is false.

  • use_windows_context_path: Flag to include the Windows context path routing tests. Default is false.

  • windows_stack: Windows stack to run tests against. Must be windows.

  • include_service_discovery: Flag to include test for the service discovery. These tests use apps.internal domain, which is the default in cf-networking-release. The internal domain is currently not configurable.

  • stacks: An array of stacks to test against. Default is [cflinuxfs4].

  • include_volume_services: Flag to include the tests for volume services. The following requirements must be met to run this suite: tcp-routing must be deployed.

  • volume_service_name: The name of the volume service provided by the volume service broker.

  • volume_service_plan_name: The name of the plan of the service provided by the volume service broker.

  • volume_service_create_config: The JSON configuration that is used when volume service is created.

Buildpack Names

Many tests specify a buildpack when pushing an app, so that on diego the app staging process completes in less time. The default names for the buildpacks are as follows; if you have buildpacks with different names, you can override them by setting different names:

  • staticfile_buildpack_name: staticfile_buildpack
  • java_buildpack_name: java_buildpack
  • ruby_buildpack_name: ruby_buildpack
  • nginx_buildpack_name: nginx_buildpack
  • nodejs_buildpack_name: nodejs_buildpack
  • go_buildpack_name: go_buildpack
  • r_buildpack_name: r_buildpack
  • binary_buildpack_name: binary_buildpack
  • hwc_buildpack_name: hwc_buildpack

Route Services Test Group Setup

The route_services test group pushes applications which must be able to reach the load balancer of your Cloud Foundry deployment. This requires configuring application security groups to support this. Your deployment manifest should include the following data if you are running the route_services group:

...
properties:
  ...
  cc:
    ...
    security_group_definitions:
      - name: load_balancer
        rules:
        - protocol: all
          destination: IP_OF_YOUR_LOAD_BALANCER # (e.g. 10.244.0.34 for a standard deployment of Cloud Foundry on BOSH-Lite)
    default_running_security_groups: ["load_balancer"]

Container Networking and Application Security Groups

To run tests that exercise container networking and running application security groups, the include_security_groups flags must be true.

The Windows ASG tests require an unallocated IP on the private network used by the CF deployment, set with the unallocated_ip_for_security_group config value. Environments created by bbl on public clouds can use the default value of 10.0.244.255. vSphere and Openstack environments may require a custom IP.

Private Docker

To run tests that exercise the use of credentials to access a private docker registry, the include_private_docker_registry flag must be true, and the following config values must be provided:

  • private_docker_registry_image
  • private_docker_registry_username
  • private_docker_registry_password

These tests assume that the specified private docker image is a private version of the cloudfoundry/diego-docker-app:latest. To upload a private version to your DockerHub account, first create a private repository on DockerHub and log in to docker on the command line. Then run the following commands:

docker pull cloudfoundry/diego-docker-app:latest
docker tag cloudfoundry/diego-docker-app:latest <your-private-repo>:<some-tag>
docker push <your-private-repo>:<some-tag>

The value for the private_docker_registry_image config value in this case would be ":".

Routing Isolation Segments

To run tests that involve routing isolation segments, the following config values must be provided:

  • isolation_segment_name
  • isolation_segment_domain

Read the documentation here for further setup details.

Credhub Modes

  • non-assisted mode means that apps are responsible for resolving Credhub refs for credentials. When the user binds a service to an app, the service broker will store a credential in Credhub and pass the ref back to the Cloud Controller. When the user restages the app, the Cloud Controller will pass the Credhub ref to the app in the VCAP_SERVICES environment variable, at which point the app can make a request directly to Credhub to resolve the ref and obtain the credential. This mode is enabled when cc.credential_references.interpolate_service_bindings is false -- which is the non-default configuration.
  • assisted mode means that the Credhub ref will be resolved before the app starts running. As before, when the user binds a service to an app, the service broker will store a credential in Credhub and pass the ref back to the Cloud Controller. This time, when the user restages the app, the Cloud Controller will pass the Credhub ref to the Diego runtime, at which point the launcher (from the buildpackapplifecycle or the dockerapplifecycle components) will resolve the Credhub ref, and store the credential in VCAP_SERVICES for the app to consume. This mode is enabled when cc.credential_references.interpolate_service_bindings is true -- which is the default configuration.

Capturing Test Output

When a test fails, look for the test group name ([services] in the example below) in the test output:

• Failure in Spec Setup (BeforeEach) [34.662 seconds]
[services] Service Instance Lifecycle

If you set a value for artifacts_directory in your $CONFIG file, then you will be able to capture cf trace output from failed test runs, this output may be useful in cases where the normal test output is not enough to debug an issue. The cf trace output for the tests in these specs will be found in CF-TRACE-Applications-*.txt in the artifacts_directory.

Test Execution

To execute tests according to your configuration, run the bin/test script with $CONFIG set to your integration_config.json file path.

Parallel execution

It's possible to execute all test groups, and have tests run in parallel across multiple processes. This parallelization can significantly decrease CATs runtime.

However, be careful with this number, as it's effectively "how many apps to push at once", as nearly every example pushes an app.

Use the --procs flag to set the number of parallel processes, e.g.:

./bin/test --procs=12

For reference here's how many parallel processes the Release Integration team runs with:

Foundation Type # of Parallel Processes
Vanilla CF 12
BOSH Lite 4
Focusing Test Groups

If you are already familiar with CATs you probably know that there are many test groups. You may not wish to run all the tests in all contexts, and sometimes you may want to focus individual test groups to pinpoint a failure. To execute a specific group of acceptance tests, e.g. routing/, edit your integration_config.json file and set all include_* values to false except for include_routing then run the following:

./bin/test

To execute tests in a single file use an FDescribe block around the tests in that file:

var _ = AppsDescribe("Apps", func() {
  FDescribe("Focused tests", func() { // Add this line here
  // ... rest of file
  }) // Close here
})

The test group names correspond to directory names.

Verbose Output

To see verbose output from ginkgo, use the -v flag.

./bin/test -v

You can of course combine the -v flag with the --procs=N flag.

Overall Test Timeout Setting

From Ginkgo 2.0, the default timeout for the entire test has been changed to 1 hour (refer to: Ginkgo 2.0 Migration Guide - Timeout Behavior).

Tests may run longer than an hour depending on their environment and parallelism, with the possibility of failure.

Adjust the test timeout as needed with the --timeout flag:

./bin/test --timeout=24h

For individual timeouts, such as the timeout for cf push, refer to Test Configuration.

Explanation of Test Groups

Test Group Name Description
app_syslog_tcp Tests the ability to configure an app syslog drain listener.
apps Tests the core functionalities of Cloud Foundry: staging, running, logging, routing, buildpacks, etc. This test group should always pass against a sound Cloud Foundry deployment.
credhub Tests CredHub-delivered Secure Service credentials in the service binding. CredHub configuration is required to run these tests. In addition to selecting a credhub_mode, credhub_client and credhub_secret values are required for these tests.
detect Tests the ability of the platform to detect the correct buildpack for compiling an application if no buildpack is explicitly specified.
docker Tests our ability to run docker containers on Diego and that we handle docker metadata correctly.
internet_dependent Tests the feature of being able to specify a buildpack via a Github URL. As such, this depends on your Cloud Foundry application containers having access to the Internet. You should take into account the configuration of the network into which you've deployed your Cloud Foundry, as well as any security group settings applied to application containers.
isolation_segments This test group requires that Diego be deployed with a minimum of 2 cells. One of those cells must have been deployed with a placement_tag. If the deployment has been deployed with a routing isolation segment, isolation_segment_domain must also be set. For more information, please refer to the Isolation Segments documentation.
route_services Tests the Route Services feature of Cloud Foundry.
routing This package contains routing specific acceptance tests (context paths, wildcards, SSL termination, sticky sessions, and zipkin tracing).
routing_isolation_segments Tests that requests to isolated apps are only routed through isolated routers, and vice versa. It requires all of the setup for the isolation segments test suite. Additionally, a minimum of two Gorouter instances must be deployed. One instance must be configured with the property routing_table_sharding_mode: shared-and-segments. The other instance must have the properties routing_table_sharding_mode: segments and isolation_segments: [YOUR_PLACEMENT_TAG_HERE]. The isolation_segment_name in the CATs properties must match the placement_tag and isolation_segment.isolation_segment_domain must be set and traffic to that domain should go to the isolated router.
security_groups Tests the Security Groups feature of Cloud Foundry.
service_discovery Tests the Service Discovery feature for applications running on Cloud Foundry.
services Tests various features related to services, e.g. registering a service broker via the service broker API. Some of these tests exercise special integrations, such as Single Sign-On authentication; you may wish to run some tests in this package but selectively skip others if you haven't configured the required integrations (by setting include_sso parameter to falsein your configuration).
ssh Tests communication with Diego apps via ssh, scp, and sftp.
tasks Tests Cloud Foundry's Tasks feature.
tcp_routing Tests TCP Routing Feature of Cloud Foundry. You need to make sure you've set up a TCP domain tcp.<SYSTEM_DOMAIN> as described here. If you are using bbl (BOSH Bootloader), TCP domain is set up for you automatically.
user_provided_services Tests features related to creating and binding user-provided services for holding app credentials securely.
v3 This test group contains tests for the next-generation v3 Cloud Controller API.
volume_services Tests the Volume Services feature of Cloud Foundry.

Contributing

This repository uses go mod to manage go dependencies.

All go dependencies required by CATs are vendored in the vendor directory.

When making changes to the test suite that bring in additional go packages, you should use the following workflow:

If you can use the most recent version of a dependency use go mod tidy, otherwise use go get <dependency>@<version>. Both of these require go modules to be enabled via the envrc. Finally use go mod vendor to add the dependencies to the vendor directory.

For tools and assets, please use the helpers/assets/tools.go via the go mod tool workflow

For additional information refer to the official wiki and the official examples repo

Although the default branch for this repository is main, we ask that all pull requests be made against the develop branch. Please run the unit tests and make sure they are passing before submitting. Use ./bin/run_units to run these unit tests.

Note: it is necessary to run the tests from the root of the repo.

Code Conventions

There are a number of conventions we recommend developers of CF acceptance tests adopt:

  1. When pushing an app:
  • set the memory requirement, and use the suite's DEFAULT_MEMORY_LIMIT (DEFAULT_WINDOWS_MEMORY_LIMIT for tests in the windows directory) unless the test specifically needs to test a different value,
  • set the buildpack unless the test specifically needs to test the case where a buildpack is unspecified, and use one of Config.GetRubyBuildpackName(), Config.GetJavaBuildpackName(), etc. unless the test specifically needs to use a buildpack name or URL specific to the test,

For example:

Expect(cf.Cf("push", appName,
    "-b", buildpackName,                  // specify buildpack
    "-m", DEFAULT_MEMORY_LIMIT,           // specify memory limit
    "-d", Config.AppsDomain,              // specify app domain
).Wait(Config.CfPushTimeoutDuration())).To(Exit(0))
  1. Delete all resources that are created, e.g. apps, routes, quotas, etc. This is in order to leave the system in the same state it was found in. For example, to delete apps and their associated routes:

    	Expect(cf.Cf("delete", myAppName, "-f", "-r").Wait()).To(Exit(0))
    
  2. Specifically for apps, before tearing them down, print the app guid and recent application logs. There is a helper method AppReport provided in the app_helpers package for this purpose.

    AfterEach(func() {
      app_helpers.AppReport(appName)
    })
  3. Document the purpose of your test groups in this repo's README.md. This is especially important when changing the explicit behavior of existing test groups or adding new test groups.

  4. Document all changes to the config object in this repo's README.md.

  5. If you add a test that requires a new minimum cf CLI version, update the minCliVersion in cats_suite_test.go .

cf-acceptance-tests's People

Contributors

acosta11 avatar ameowlia avatar anexper avatar apshirley avatar birdrock avatar changdrew avatar chunyilyu avatar crhino avatar ctlong avatar davewalter avatar dependabot[bot] avatar dsabeti avatar emalm avatar ericpromislow avatar gerg avatar jamespollard8 avatar jaresty avatar jochenehret avatar jpalermo avatar luan avatar njbennett avatar rainmaker avatar robdimsdale avatar sphawley avatar staylor14 avatar tcdowney avatar vitreuz avatar weymanf avatar zaksoup avatar zrob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cf-acceptance-tests's Issues

loggregator endpoint not correctly detected in v3 test suite.

Issue

The loggregator endpoint is not being correctly detected in the v3 test suite. In our deployment we have disabled http API access (https only), and we have loggregator configured with a wss://loggregator.somedomain URL.

In helpers/v3_helpers/v3.go it seems that the loggregator endpoint is chosen by string replacing the name of the ApiEndpoint from api.somedomain to loggregator.somedomain

I think the offending line is line 165 of helpers/v3_helprs/v3.go
loggregatorEndpoint := strings.Replace(config.ApiEndpoint, "api", "loggregator", -1)

This does not correctly select the loggregator endpoint in our environment due to the use of websockets and https, and as such the v3 test suite fails.

Context

API access is https only
traffic_controller_url is set to wss://doppler.somedomain
Loggregator is configured for websockets with a wss://loggregator.somedomain URL

Steps to Reproduce

Disable http access at the load balancer level (We're using AWS ELBs as our load balancers)
Configure properties.acceptance_tests.api with a https:// URL
Configure dopper/loggregator to use Websocket wss:// URLs (again accessed through AWS ELBs)
Run the v3 test suite.

Expected result

v3 test suite should succeed.

Current result

Staging of applications fails as the curl step to read from the loggregator endpoint times out when trying to connect.

curl -s loggregator.somedomain/recent?app=d05e989a-8097-476a-b9f3-4f317d874495 -H Authorization:  

• Failure in Spec Teardown (AfterEach) [64.201 seconds]
process [AfterEach] terminating an instance /v3/processes/:guid/instances/:index restarts the instance 
/var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/v3/process_test.go:135

  Timed out after 30.000s.
  Expected process to exit.  It did not.

Possible Fix

Use the same getCfHomeConfig().LoggregatorEndpoint method which is used in apps/loggregator_test.go

gcf api api.10.244.0.34.xip.io --skip-ssl-validation Incorrect Usage.

Hi,
it seems the tests us 'gcf' incorrectly. I was also told that 'cf' should be used instead of 'gcf'. Here the log with the failures:

CB:cf-acceptance-tests christoph$ ./bin/test
++  ./bin/test :   5 > dirname ./bin/test
+  ./bin/test :   5 > . ./bin/goenv
++  ./bin/goenv :   3 > set -e -x
++  ./bin/goenv :   5 > which go
/usr/local/bin/go
++++  ./bin/goenv :   10 > dirname ./bin/test
+++  ./bin/goenv :   10 > cd ./bin/..
+++  ./bin/goenv :   10 > pwd
++  ./bin/goenv :   10 > cats_dir=/Users/christoph/go/src/github.com/cloudfoundry/cf-acceptance-tests
++  ./bin/goenv :   11 > local_gopath=/Users/christoph/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace
++  ./bin/goenv :   13 > mkdir -p /Users/christoph/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace/bin
++  ./bin/goenv :   15 > export GOPATH=/Users/christoph/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace:/Users/christoph/go
++  ./bin/goenv :   15 > GOPATH=/Users/christoph/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace:/Users/christoph/go

...

+  ./bin/test :   7 > go install -v github.com/onsi/ginkgo/ginkgo
+  ./bin/test :   8 > echo 'RUNNING LOCAL CODE'
RUNNING LOCAL CODE
+  ./bin/test :   9 > ginkgo -r -skipPackage=diego -slowSpecThreshold=120
Will skip diego
[1403722412] Applications - 29/30 specs 
> gcf api api.10.244.0.34.xip.io --skip-ssl-validation 
Incorrect Usage.

NAME:
   api - Set or view target api url

USAGE:
   gcf api [URL]


> gcf auth admin admin 
API endpoint: http://api.10.244.0.34.xip.io
Authenticating...
OK
Use 'gcf target' to view or set your target org and space

> gcf create-quota CATS-QUOTA-1-2014_06_25-11h53m33.992s -m 10G -r 1000 -s 100 --allow-paid-service-plans 
No help topic for 'create-quota'

> gcf create-user CATS-USER-1-2014_06_25-11h53m33.992s meow 
Creating user CATS-USER-1-2014_06_25-11h53m33.992s as admin...
OK

TIP: Assign roles with 'gcf set-org-role' and 'gcf set-space-role'

> gcf create-org CATS-ORG-1-2014_06_25-11h53m33.992s 
Creating org CATS-ORG-1-2014_06_25-11h53m33.992s as admin...
OK

TIP: Use 'gcf target -o CATS-ORG-1-2014_06_25-11h53m33.992s' to target new org

> gcf set-quota CATS-ORG-1-2014_06_25-11h53m33.992s CATS-QUOTA-1-2014_06_25-11h53m33.992s 
FAILED
Quota 'CATS-QUOTA-1-2014_06_25-11h53m33.992s' not found

> gcf logout 
Logging out...
OK

------------------------------
Failure [1.913 seconds]
[BeforeSuite] BeforeSuite 
/Users/christoph/go/src/github.com/cloudfoundry/cf-acceptance-tests/apps/init_test.go:30

  Expected
      <int>: 1
  to match exit code:
      <int>: 0

  /Users/christoph/go/src/github.com/cloudfoundry/cf-acceptance-tests/helpers/context.go:103
------------------------------

Ran 29 of 30 Specs in 12.591 seconds
FAIL! -- 0 Passed | 29 Failed | 1 Pending | 0 Skipped --- FAIL: TestApplications (12.59 seconds)
FAIL

Ginkgo ran in 13.96537023s
Test Suite Failed
CB:cf-acceptance-tests christoph$ 

Hardcoded timeout value in service_instance_lifecycle_test

Context

Our team needs to execute CATs on CF deployed in an environment very prone to DNS timeouts with current default values (azure in china). CATs allows to configure many different timeout values through its config file but this one is hardcoded and causes a problem:

https://github.com/cloudfoundry/cf-acceptance-tests/blob/master/services/service_instance_lifecycle_test.go#L40

We have the test passing when we manually increase the timeout value in the code.

A new configuration parameter or reusing an existing one (default_timeout? The readme seems to indicate it would be the exact use case for it) would be useful.

Example log of reaching the 2m hardcoded timeout:

• Failure in Spec Setup (BeforeEach) [236.165 seconds]
Service Instance Lifecycle
/var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/services/service_instance_lifecycle_test.go:424
  Asynchronous operations
  /var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/services/service_instance_lifecycle_test.go:423
    when there is an existing service instance
    /var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/services/service_instance_lifecycle_test.go:422
      when there is an app [BeforeEach]
      /var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/services/service_instance_lifecycle_test.go:421
        can bind a service instance
        /var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/services/service_instance_lifecycle_test.go:396

        Timed out after 120.000s.
        Got stuck at:

            Service instance: b665c82f-0a06-4335-5c9e-62265767a585
            Service: 4ba5b3a1-c737-4048-6de0-cbed6725c8fd
            Bound apps:
            Tags:
            Plan: 38268add-be1f-4d49-484d-2c99e28dcac2
            Description: fake service
            Documentation url:
            Dashboard:

            Last Operation
            Status: create in progress
            Message: not 100 percent done
            Started: 2016-08-25T14:49:15Z
            Updated: 2016-08-25T14:50:23Z

        Waiting for:
            succeeded

        /var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/services/service_instance_lifecycle_test.go:54

Several issues trying to run test by following updated instructions from a clean start

There's been a lot of work on the cats to make them easier to run so I decided to try it out on a relatively clean system. Simply following the instructions did not result in successful execution. First, if go get -u github.com/cloudfoundry/cf-acceptance-tests wasn't issued before attempting to run the tests, things don't compile.

$ bin/test 
+ which go
/usr/local/bin/go
+ local_gopath=/Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace
+ mkdir -p /Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace/bin
+ export GOPATH=/Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace:/Users/sykesm/go
+ GOPATH=/Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace:/Users/sykesm/go
+ export 'PATH=/Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin:/Users/sykesm/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/Users/sykesm/go/bin:/usr/local/sbin:/usr/X11/bin:/Applications/VMware Fusion.app/Contents/Library:/usr/X11R6/bin:/Users/sykesm/bin:/sbin:/usr/sbin'
+ PATH='/Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin:/Users/sykesm/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/Users/sykesm/go/bin:/usr/local/sbin:/usr/X11/bin:/Applications/VMware Fusion.app/Contents/Library:/usr/X11R6/bin:/Users/sykesm/bin:/sbin:/usr/sbin'
+ go install -v github.com/onsi/ginkgo/ginkgo
github.com/onsi/ginkgo/config
github.com/onsi/ginkgo/ginkgo/convert
github.com/onsi/ginkgo/types
github.com/onsi/ginkgo/ginkgo/support/fsnotify
github.com/onsi/ginkgo/stenographer
github.com/onsi/ginkgo/ginkgo/testsuite
github.com/onsi/ginkgo/ginkgo/aggregator
github.com/onsi/ginkgo/reporters
github.com/onsi/ginkgo/remote
github.com/onsi/ginkgo/ginkgo/testrunner
github.com/onsi/ginkgo/ginkgo
+ echo 'RUNNING LOCAL CODE'
RUNNING LOCAL CODE
+ ginkgo -r -v -slowSpecThreshold=120
Failed to compile apps:

can't load package: package github.com/cloudfoundry/cf-acceptance-tests/helpers: cannot find package "github.com/cloudfoundry/cf-acceptance-tests/helpers" in any of:
    /usr/local/Cellar/go/1.2.1/libexec/src/pkg/github.com/cloudfoundry/cf-acceptance-tests/helpers (from $GOROOT)
    /Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace/src/github.com/cloudfoundry/cf-acceptance-tests/helpers (from $GOPATH)
    /Users/sykesm/go/src/github.com/cloudfoundry/cf-acceptance-tests/helpers

Ginkgo ran in 369.506946ms
Test Suite Failed

The README says

Check out a copy of cf-acceptance-tests and make sure that it is added to your $GOPATH.

I did that by setting my GOPATH to ~/workspace/cf-acceptance-tests -- the place where I checked out a copy. If go get is needed, it shouldn't be a recommendation but a requirement.

After using go get instead of setting my GOPATH, the test suite compiled but failed. The message implied that I had not previously targeted the endpoint and logged in:

• Failure [0.657 seconds]
An application using an admin buildpack
(/Users/sykesm/workspace/cf-acceptance-tests/apps/admin_buildpack_lifecycle_test.go:162)
  when the buildpack is detected
  (/Users/sykesm/workspace/cf-acceptance-tests/apps/admin_buildpack_lifecycle_test.go:113)
    is used for the app
    (/Users/sykesm/workspace/cf-acceptance-tests/apps/admin_buildpack_lifecycle_test.go:112)

    Expected to see 'OK' or 'scim_resource_already_exists', got stuck at: "No API endpoint targeted. Use '\x1b[1;33mgcf login\x1b[0m' or '\x1b[1;33mgcf api\x1b[0m' to target an endpoint.\n".

    Full output:

    No API endpoint targeted. Use 'gcf login' or 'gcf api' to target an endpoint.


    /Users/sykesm/go/src/github.com/cloudfoundry/cf-acceptance-tests/helpers/ginkgo_bootstrap.go:43

Nothing in the README indicates that the admin user needs to have logged in prior to running the tests. This is unexpected given the admin user and password are both specified in the environment. It does imply that an org and space are needed but it doesn't say enough about them for the end user to create them. (Nothing in the environment calls out a space either.)

Nothing in the README describes what persistent-app-host is or what it's used for.

Even after explicitly logging in as admin, creating the appropriate org, and targeting it, the tests still fail:

$ echo $API_ENDPOINT
api.10.244.0.34.xip.io
$ echo $ADMIN_USER
admin
$ echo $ADMIN_PASSWORD
admin
$ echo $CF_ORG
CATS-org
$ gcf login
API endpoint: https://api.10.244.0.34.xip.io

Email> admin

Password> 
Authenticating...
OK

Select an org (or press enter to skip):
1. playground
2. CATS-org

Org> 2
Targeted org CATS-org

Targeted space test


API endpoint: https://api.10.244.0.34.xip.io (API version: 2.2.0)
User:         admin
Org:          CATS-org
Space:        test
$ bin/test
+ which go
/usr/local/bin/go
+ local_gopath=/Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace
+ mkdir -p /Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace/bin
+ export GOPATH=/Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace:/Users/sykesm/go
+ GOPATH=/Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace:/Users/sykesm/go
+ export 'PATH=/Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin:/Users/sykesm/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/Users/sykesm/go/bin:/usr/local/sbin:/usr/X11/bin:/Applications/VMware Fusion.app/Contents/Library:/usr/X11R6/bin:/Users/sykesm/bin:/sbin:/usr/sbin'
+ PATH='/Users/sykesm/workspace/cf-acceptance-tests/Godeps/_workspace/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin:/Users/sykesm/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/Users/sykesm/go/bin:/usr/local/sbin:/usr/X11/bin:/Applications/VMware Fusion.app/Contents/Library:/usr/X11R6/bin:/Users/sykesm/bin:/sbin:/usr/sbin'
+ go install -v github.com/onsi/ginkgo/ginkgo
+ echo 'RUNNING LOCAL CODE'
RUNNING LOCAL CODE
+ ginkgo -r -v -slowSpecThreshold=120
Running Suite: Applications
===========================
Random Seed: 1396821423
Will run 19 of 21 specs

An application printing a bunch of output 
  doesn't die when printing 32MB
  /Users/sykesm/workspace/cf-acceptance-tests/apps/output_volume_test.go:47

• Failure [0.839 seconds]
An application printing a bunch of output
(/Users/sykesm/workspace/cf-acceptance-tests/apps/output_volume_test.go:48)
  doesn't die when printing 32MB
  (/Users/sykesm/workspace/cf-acceptance-tests/apps/output_volume_test.go:47)

  Expected to see 'OK' or 'scim_resource_already_exists', got stuck at: "No API endpoint targeted. Use '\x1b[1;33mgcf login\x1b[0m' or '\x1b[1;33mgcf api\x1b[0m' to target an endpoint.\n".

  Full output:

  No API endpoint targeted. Use 'gcf login' or 'gcf api' to target an endpoint.


  /Users/sykesm/go/src/github.com/cloudfoundry/cf-acceptance-tests/helpers/ginkgo_bootstrap.go:43

And that's where I've stopped. The README does not document the requirements for running the CATS at the moment.

/cc @aramprice

Using multiple nodes causes Error refreshing auth token.

I've been experimenting with increasing the number of parallel nodes running the tests to decrease the end-end runtime, but intermittently causes a handful of errors like:

cf push c7c1c07e-bb69-4603-4f68-c2c1e69ac108 -p ../assets/dora
FAILED
Error refreshing auth token.
auth request failed: Invalid auth token: Invalid refresh token (password changed):

I'm guessing this is because multiple threads are making cf push calls with the same installation, causing race conditions when updating the "AccessToken" in the ~/.cf/config.json token?

I'm using CLI version "cf version 6.6.0-704d304-2014-09-05T20:45:22+00:00"

panic: Your test failed.

I git clone the latest code ,and I got a error:

root@test-ubunut-3:/home/share/cf-acceptance-tests# ./bin/test apps/

  • which go
    /home/share/go/bin/go
  • local_gopath=/home/share/cf-acceptance-tests/Godeps/_workspace
  • mkdir -p /home/share/cf-acceptance-tests/Godeps/_workspace/bin
  • export GOPATH=/home/share/cf-acceptance-tests/Godeps/_workspace:/home/share/cf-acceptance-tests
  • export PATH=/home/share/cf-acceptance-tests/Godeps/_workspace/bin:/home/share/go/bin:/home/share/cf-acceptance-tests/bin:/root/jdk1.7.0_45/bin:/root/jdk1.7.0_45/jre/bin:/home/share/go/bin:/home/share/go-yuki/bin:/root/jdk1.7.0_45/bin:/root/jdk1.7.0_45/jre/bin:/usr/local/rvm/gems/ruby-1.9.3-p448/bin:/usr/local/rvm/gems/ruby-1.9.3-p448@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p448/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/root/grails-2.3.7/bin:/usr/local/rvm/bin
  • go install github.com/onsi/ginkgo/ginkgo
  • echo RUNNING LOCAL CODE
    RUNNING LOCAL CODE
  • ginkgo -r -v -slowSpecThreshold=300 apps/
    --- FAIL: TestApplications (0.02 seconds)
    panic:
    Your test failed.
    Ginkgo panics to prevent subsequent assertions from running.
    Normally Ginkgo rescues this panic so you shouldn't see it.

But, if you make an assertion in a goroutine, Ginkgo can't capture the panic.
To circumvent this, you should call

defer GinkgoRecover()

at the top of the goroutine that caused this panic.
[recovered]
panic:
Your test failed.
Ginkgo panics to prevent subsequent assertions from running.
Normally Ginkgo rescues this panic so you shouldn't see it.

But, if you make an assertion in a goroutine, Ginkgo can't capture the panic.
To circumvent this, you should call

defer GinkgoRecover()

at the top of the goroutine that caused this panic.

goroutine 4 [running]:
runtime.panic(0x661ee0, 0xc2100c1970)
/usr/local/go/src/pkg/runtime/panic.c:266 +0xb6
testing.func路005()
/usr/local/go/src/pkg/testing/testing.go:385 +0xe8
runtime.panic(0x661ee0, 0xc2100c1970)
/usr/local/go/src/pkg/runtime/panic.c:248 +0x106
github.com/onsi/ginkgo.Fail(0xc21009f3f0, 0x20, 0xc2100008e8, 0x1, 0x1)
/home/share/cf-acceptance-tests/Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo.go:189 +0x9b
github.com/onsi/gomega.(_actual).match(0xc2100ab940, 0x7f2424be9630, 0xc2100008d0, 0x1, 0x0, ...)
/home/share/cf-acceptance-tests/Godeps/_workspace/src/github.com/onsi/gomega/actual.go:61 +0x323
github.com/onsi/gomega.(_actual).To(0xc2100ab940, 0x7f2424be9630, 0xc2100008d0, 0x0, 0x0, ...)
/home/share/cf-acceptance-tests/Godeps/_workspace/src/github.com/onsi/gomega/actual.go:33 +0x9a
github.com/pivotal-cf-experimental/cf-test-helpers/cf.InitiateUserContext(0x738540, 0x0, 0x738540, 0x0, 0x738540, ...)
/home/share/cf-acceptance-tests/Godeps/_workspace/src/github.com/pivotal-cf-experimental/cf-test-helpers/cf/as_user.go:34 +0x38f
github.com/pivotal-cf-experimental/cf-test-helpers/cf.AsUser(0x738540, 0x0, 0x738540, 0x0, 0x738540, ...)
/home/share/cf-acceptance-tests/Godeps/_workspace/src/github.com/pivotal-cf-experimental/cf-test-helpers/cf/as_user.go:14 +0x47
github.com/cloudfoundry/cf-acceptance-tests/helpers.GinkgoBootstrap(0xc2100e6ea0, 0x750270, 0xc)
/home/share/cf-acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/helpers/ginkgo_bootstrap.go:23 +0x8c
_/home/share/cf-acceptance-tests/apps.TestApplications(0xc2100e6ea0)
/home/share/cf-acceptance-tests/apps/init_test.go:10 +0x3b
testing.tRunner(0xc2100e6ea0, 0xa9d770)
/usr/local/go/src/pkg/testing/testing.go:391 +0x8b
created by testing.RunTests
/usr/local/go/src/pkg/testing/testing.go:471 +0x8b2

goroutine 1 [chan receive]:
testing.RunTests(0x7de200, 0xa9d770, 0x1, 0x1, 0x4b5001)
/usr/local/go/src/pkg/testing/testing.go:472 +0x8d5
testing.Main(0x7de200, 0xa9d770, 0x1, 0x1, 0xaa7240, ...)
/usr/local/go/src/pkg/testing/testing.go:403 +0x84
main.main()
_/home/share/cf-acceptance-tests/apps/_test/_testmain.go:47 +0x9c

Ginkgo ran in 3.075174938s
Test Suite Failed


my go version: go version go1.2.1 linux/amd64

What's the problem?

The ssh suite has implicit tests in a BeforeEach block

@ematpl,

All the tests in the ssh suite seem to be implicitly testing the functionality for checking whether you are connecting to the correct container. The before each block pushes an app with two instances and then waits for the correct instance index to be returned.

This feels to me like it should really be an explicit test of that functionality with an it block that says "it should ssh into the correct container" rather than a test that is implicit in every run of tests on other functionality. The tests then all try to connect to the second instance (index 1 instead of 0), this isn't really testing the instance is the correct one, since it really just relies on the cli correctly constructing the request to connect to some app.

Thanks,
Al

EDIT: creating the issue here since it is relevant to cf-acceptance-tests and not diego, however we should probably move the issue into the diego backlog as your team own the test suite implementation.

v3 Tasks Test Makes Assumption that CC Tasks Are Enabled

when running v3 test and using "IncludeTasks" you will run into the issue that Tasks are not enabled by default unless you flip the feature flag for cc.

Referencing these tests:

https://github.com/cloudfoundry/cf-acceptance-tests/blob/master/v3/task.go#L65

Error you are going to get from your test:

{
   "errors": [
      {
         "code": 330002,
         "detail": "Feature Disabled: task_creation",
         "title": "CF-FeatureDisabled"
      }
   ]
}

Of course you can then go use cf enable-feature-flag to fix this but why wouldn't the test hit the endpoint to enable this by default?

CATs v3 helpers introduce a Bash dependency

CATs run on windows in some cases, where there is no guarantee of having working bash. The v3 helpers use grep to pull in the bearer token from UAA.

According to "sources" (I didn't actually speak to them) on the uaa team, currently only Bearer type tokens are issued by this endpoint anyway so we may just be able to stop using bash -c and grep. If this is not the case, it still may be better to handle the output directly in go code so we can keep CATs OS agnostic.

@utako && @SocalNick what do you think about removing the bash code?

how to make the default running security groups block access

Hi.
I run the test SecurityGroups fail.Maybe it is because of the cloud foundry is not config default security groups.
Is there a security groups configuration document of Cloud foundry? I'm not sure that the security groups of Cloud foundry is the same as security groups of Openstack.

Thanks.

skip_ssl_validation not used in sso_helper.go

Hi All,

I am running the CF171 CATS tests against an install of CF171. The majority of the tests pass however I am seeing an issue in sso_lifecycle_test.go.

The test shown below uses the helper to curl a URL and expect a 0 return code. In the instance shown below it is returning 60 because a self signed certificate is in use:

Helper line which is causing the failure:

https://github.com/cloudfoundry/cf-acceptance-tests/blob/master/services/helpers/sso.go#L37

Curl docs detailing the error return code:

CURLE_SSL_CACERT (60)
Peer certificate cannot be authenticated with known CA certificates.

When calling the tests I am passing "skip_ssl_validation": true. With this flag set curl should also skip SSL validation or the 60 return code should be handled by the helper.

Log from test run:

[32m> gcf delete d258e916-6761-451d-5ee1-fa87f1290598 -f �[0m
Deleting app d258e916-6761-451d-5ee1-fa87f1290598 in org CATS-ORG-1-2014_06_05-09h53m32.849s / space CATS-SPACE-1-2014_06_05-09h53m32.849s as CATS-USER-1-2014_06_05-09h53m32.849s...
OK
�[91m�[1m• Failure [34.772 seconds]�[0m
�[90mSSO Lifecycle �[0m�[91m�[1m[BeforeEach] When a service broker is deleted �[0m�[90mcan no longer perform an operation on a user's behalf using sso �[0m
�[37m/var/vcap/store/jenkins_master/workspace/test-cf-cats/cf-release/src/acceptance-tests/services/sso_lifecycle_test.go:107�[0m

  �[91mExpected
      <int>: 60
  to match exit code:
      <int>: 0�[0m

  /var/vcap/store/jenkins_master/workspace/test-cf-cats/gopath/src/github.com/cloudfoundry/cf-acceptance-tests/services/helpers/sso.go:37
�[90m------------------------------�[0m
�[32m•�[0m
�[1m�[91mRan 5 of 5 Specs in 209.719 seconds�[0m
�[1m�[91mFAIL!�[0m -- �[32m�[1m2 Passed�[0m | �[91m�[1m3 Failed�[0m | �[33m�[1m0 Pending�[0m | �[36m�[1m0 Skipped�[0m --- FAIL: TestApplications (209.72 seconds)
FAIL

Acceptance tests does not install ginkgo for you anymore

Cf-acceptance-tests may be broken on a fresh install. By default we try to install ginkgo if it does not currently exist in your path. Before it was able to look into the godeps folder and build it for you, but now since it moved to vender that does not work.

/cc @DanLavine

Multiple app ports fails with `Requested route does not exist.`

Issue

The multiple app ports test that checks if app that listens on multiple ports can be accessed via alternative route has a race condition as it checks for route existence too quickly, before requested route becomes available.

Context

This change 7599345#diff-f4bbf55b096c3c1ba009d2212bd93596R46 has moved UpdatePorts method to be executed after application starts. Unfortunately UpdatePorts forces Lattice app to restart:

2016-05-23T15:48:26.57+0100 [API/0]      OUT Updated app with guid 1904a6cd-7d96-41ef-bfc9-e0be72213d4e ({"ports"=>[7777, 8888, 8080]})
2016-05-23T15:48:26.64+0100 [CELL/0]     OUT Creating container
2016-05-23T15:48:26.82+0100 [APP/0]      OUT Lattice-app. Says Hello. on index: 0
2016-05-23T15:48:26.90+0100 [APP/0]      OUT Lattice-app. Says Hello. on index: 0
2016-05-23T15:48:26.91+0100 [CELL/0]     OUT Successfully created container
2016-05-23T15:48:27.31+0100 [CELL/0]     OUT Starting health monitoring of container
2016-05-23T15:48:27.33+0100 [APP/0]      OUT {"timestamp":"1464014907.332120180","source":"lattice-app","message":"lattice-app.lattice-app.starting","log_level":1,"data":{"ports":["7777","8888","8080"]}}
2016-05-23T15:48:27.33+0100 [APP/0]      OUT {"timestamp":"1464014907.332395792","source":"lattice-app","message":"lattice-app.lattice-app.up","log_level":1,"data":{"port":"8080"}}
2016-05-23T15:48:27.33+0100 [APP/0]      OUT {"timestamp":"1464014907.332480431","source":"lattice-app","message":"lattice-app.lattice-app.up","log_level":1,"data":{"port":"7777"}}
2016-05-23T15:48:27.33+0100 [APP/0]      OUT {"timestamp":"1464014907.332562208","source":"lattice-app","message":"lattice-app.lattice-app.up","log_level":1,"data":{"port":"8888"}}
2016-05-23T15:48:27.82+0100 [APP/0]      OUT Lattice-app. Says Hello. on index: 0
2016-05-23T15:48:27.83+0100 [CELL/0]     OUT Container became healthy
2016-05-23T15:48:27.90+0100 [APP/0]      OUT Lattice-app. Says Hello. on index: 0
2016-05-23T15:48:27.93+0100 [APP/0]      OUT Exit status 2
2016-05-23T15:48:27.93+0100 [CELL/0]     OUT Exit status 0
2016-05-23T15:48:28.07+0100 [CELL/0]     OUT Exit status 0
2016-05-23T15:48:28.07+0100 [APP/0]      OUT Exit status 2
2016-05-23T15:48:28.33+0100 [APP/0]      OUT Lattice-app. Says Hello. on index: 0
2016-05-23T15:48:29.33+0100 [APP/0]      OUT Lattice-app. Says Hello. on index: 0

and makes new route not available immediately.

Steps to Reproduce

Push and start lattice app with:

cf push lattice  -b go_buildpack --no-start -m 256M  -c "lattice-app --ports=7777,8888,8080"
cf start lattice

And use this script:

#! /bin/bash
YOUR_DOMAIN_NAME="xxx"
AGUID=$(cf app lattice --guid)
cf curl /v2/apps/"${AGUID}" -X PUT -d '{"ports":[7777,8888,8080,6001]}' > /dev/null
cf create-route GDS "${YOUR_DOMAIN_NAME} --hostname lattice-two --path ""
RGUID=$(cf curl '/v2/routes?q=host:lattice-two&q=path:' | awk -F'"' '$2 ~ /^guid/ {print $4}')
cf curl /v2/route_mappings -X POST -d \{\"app_guid\":\"${AGUID}\",\"app_port\":7777,\"route_guid\":\"${RGUID}\"\} > /dev/null
cf curl /v2/apps/$AGUID -X PUT -d '{"ports":[7777,8888,8080]}' > /dev/null
curl -k -s https://lattice-two."${YOUR_DOMAIN_NAME}"/port

Expected result

7777

Current result

404 Not Found: Requested route ('lattice-two.xxx.digital') does not exist.

Possible Fix

Add sleep ( 20 seconds at least ) after cf curl /v2/apps/$AGUID -X PUT -d '{"ports":[7777,8888,8080]}' or retry request few times to allow lattice to restart.

routing suite doesn't do cleanup properly

Our integration tests are currently failing, and it is difficult to debug due to this code:

func PushApp(asset, buildpackName string) string {
app := PushAppNoStart(asset, buildpackName)
StartApp(app)
return app
}

Essentially what happens is that on teardown, we try to fetch the logs for the app in the test given the app's name, but the way the function above works, the app's name is never returned in the case that it fails to push in the first place. In particular, we're not able to see a time-stamped log of the apps staging and starting processes, to understand why it timed out after 120s. Here is a snippet of the build output:

[2016-02-06 04:45:20.00 (UTC)]> cf push RATS-APP-831035f3-ed92-40f2-562a-40e3a5907d24 -b ruby_buildpack --no-start -m 256M -p ../assets/hello-routing -d a1-app.cf-app.com 
Creating app RATS-APP-831035f3-ed92-40f2-562a-40e3a5907d24 in org CATS-ORG-5-2016_02_06-04h44m58.478s / space CATS-SPACE-5-2016_02_06-04h44m58.478s as CATS-USER-5-2016_02_06-04h44m58.478s...
OK

Creating route rats-app-831035f3-ed92-40f2-562a-40e3a5907d24.a1-app.cf-app.com...
OK

Binding rats-app-831035f3-ed92-40f2-562a-40e3a5907d24.a1-app.cf-app.com to RATS-APP-831035f3-ed92-40f2-562a-40e3a5907d24...
OK

Uploading RATS-APP-831035f3-ed92-40f2-562a-40e3a5907d24...
Uploading app files from: ../assets/hello-routing
Uploading 83.6K, 7 files
Done uploading               
OK


[2016-02-06 04:45:26.02 (UTC)]> cf start RATS-APP-831035f3-ed92-40f2-562a-40e3a5907d24 
Starting app RATS-APP-831035f3-ed92-40f2-562a-40e3a5907d24 in org CATS-ORG-5-2016_02_06-04h44m58.478s / space CATS-SPACE-5-2016_02_06-04h44m58.478s as CATS-USER-5-2016_02_06-04h44m58.478s...
-----> Downloaded app package (512K)
-------> Buildpack version 1.6.12
       Downloaded [file:///var/vcap/data/dea_next/admin_buildpacks/e5b14ee1-864b-40ea-82e4-be0e5b717ac3_754a93e6d57b7443d25e03f8862af7be481a42e7/dependencies/https___pivotal-buildpacks.s3.amazonaws.com_ruby_binaries_shared_bundler-1.9.7.tgz]
-----> Compiling Ruby/Rack
       Downloaded [file:///var/vcap/data/dea_next/admin_buildpacks/e5b14ee1-864b-40ea-82e4-be0e5b717ac3_754a93e6d57b7443d25e03f8862af7be481a42e7/dependencies/https___pivotal-buildpacks.s3.amazonaws.com_concourse-binaries_ruby_ruby-2.2.3-linux-x64.tgz]
-----> Using Ruby version: ruby-2.2.3
-----> Installing dependencies using bundler 1.9.7
       Downloaded [file:///var/vcap/data/dea_next/admin_buildpacks/e5b14ee1-864b-40ea-82e4-be0e5b717ac3_754a93e6d57b7443d25e03f8862af7be481a42e7/dependencies/https___pivotal-buildpacks.s3.amazonaws.com_ruby_binaries_cflinuxfs2_libyaml-0.1.6.tgz]
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       Installing daemons 1.2.3
       Using bundler 1.9.7
       Installing rack 1.5.2
       Installing eventmachine 1.0.7
       Installing thin 1.6.3
       Bundle complete! 2 Gemfile dependencies, 5 gems now installed.
       Gems in the groups development and test were not installed.
       Bundled gems are installed into ./vendor/bundle.
       Bundle completed (11.02s)
       Cleaning up the bundler cache.
###### WARNING:
       You have not declared a Ruby version in your Gemfile.
       To set your Ruby version add this line to your Gemfile:
       ruby '2.2.3'
       # See https://devcenter.heroku.com/articles/ruby-versions for more information.
###### WARNING:
       No Procfile detected, using the default web server (webrick)
       https://devcenter.heroku.com/articles/ruby-default-web-server

-----> Uploading droplet (18M)

0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting

[2016-02-06 04:47:26.02 (UTC)]> cf app  --guid 
FAILED
App  not found

[2016-02-06 04:47:26.19 (UTC)]> cf logs  --recent 
FAILED
App  not found

[2016-02-06 04:47:26.37 (UTC)]> cf delete  -f -r 
Deleting app  in org CATS-ORG-5-2016_02_06-04h44m58.478s / space CATS-SPACE-5-2016_02_06-04h44m58.478s as CATS-USER-5-2016_02_06-04h44m58.478s...
OK
App  does not exist.


• Failure in Spec Setup (BeforeEach) [126.535 seconds]
Session Affinity when an app sets a JSESSIONID cookie [BeforeEach] when an app has multiple instances when the client sends VCAP_ID and JSESSION cookies routes every request to the same instance 

It would be nice to see that fixed, and this also raises some other questions:

  • Is too much DRYness in tests undesirable, and is this suite too DRY?
  • Should the logic that was extracted from the tests into these helper functions itself be tested?
  • Should the extracted functions contain assertions, or would it be better to keep as many assertions as possible in the main body of the test specs?

/cc

  • cf-acceptance-tests maintainers: @cloudfoundry/cf-release-integration
  • some routing test suite contributors: @leochu @crhino

some routing tests don't have code to print logs in AfterEach

Similar to but different from the previous issue, we had another run of our acceptance tests fail, and again had some difficulties debugging due to missing cf logs output. This time, it was due to the AppReport function not being called in the AfterEach of a couple tests:

/cc

  • cf-acceptance-tests maintainers: @cloudfoundry/cf-release-integration
  • some committers to the routing suite: @crhino, @yuzhangcmu

cf-acceptance-tests - crashing_test.go

Issue

Found the following in the test for cf push -c /bin/false:

Eventually(cf.Cf("app", appName), DEFAULT_TIMEOUT).Should(Say("crashed"))

Context

Found the following in the output of the test:

     state      since                    cpu    memory   disk     details
#0   crashing   2016-04-26 11:06:10 PM   0.0%   0 of 0   0 of 0

Steps to Reproduce

Should it be expecting crash or crashing instead of crashed?

Expected result

Expect the test to be flagged as successful.

Current result

The start of the application returns state of crashing which is expected. The test is flagged as failure which is not expected.

Possible Fix

[not obligatory, but suggest fixes or reasons for the bug]

name of issue screenshot

[if relevant, include a screenshot]

ExistingUser doesn't appear to work in 245

I recently upgraded to cf-release 245 and it appears that the existing user config no longer works. acceptance tests will attempt to create a user regardless of this config value.

Validate cf version

It would be helpful if CATS validated the 'cf' version prior to running all the tests. When the incorrect version of cf is installed, it is very difficult to trace that down.

The buildpack zip file created in fly is incorrect

The buildpack zip file created in fly is incorrect, failed to unzip it:
/tmp/matching-buildpack435183005$ unzip buildpack.zip
Archive: buildpack.zip
warning: stripped absolute path spec from /tmp/matching-buildpack435183005/bin
extracting: tmp/matching-buildpack435183005/bin
warning: stripped absolute path spec from /tmp/matching-buildpack435183005/bin/compile
checkdir error: tmp/matching-buildpack435183005/bin exists but is not directory
unable to process tmp/matching-buildpack435183005/bin/compile.
warning: stripped absolute path spec from /tmp/matching-buildpack435183005/bin/detect
checkdir error: tmp/matching-buildpack435183005/bin exists but is not directory
unable to process tmp/matching-buildpack435183005/bin/detect.
warning: stripped absolute path spec from /tmp/matching-buildpack435183005/bin/release
checkdir error: tmp/matching-buildpack435183005/bin exists but is not directory
unable to process tmp/matching-buildpack435183005/bin/release.

This might be caused by below change: fe20e23#diff-91942070411bf778e2f7665838c09694L58

multiple_app_ports_test in routing suite fails when switching backends is disabled.

Issue

The multiple_app_ports test which was recently added to the 'routing' suite fails when user selection of backends is disabled.

Context

For our CF deployments we are deploying only Diego and not deploying DEA/HM9000 components.
As there is only the Diego backend available, we have set users_can_select_backend: false in our CF deployment manifest.

The multiple_app_ports test is failing for us as our deployment returns CF-BackendSelectionNotAuthorized instead of the expected CF-MultipleAppPortsMappedDiegoToDea and this causes the test to fail.

• Failure [111.468 seconds]
{NO_DEA_SUPPORT} Multiple App Ports when app has multiple ports mapped [It] returns an error when switching from Diego to DEA 
/var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/routing/multiple_app_ports_test.go:68

  Timed out after 60.000s.
  Expected
      <string>: {
         "code": 320005,
         "description": "You cannot select the backend on which to run this application",
         "error_code": "CF-BackendSelectionNotAuthorized"
      }


  to contain substring
      <string>: CF-MultipleAppPortsMappedDiegoToDea

Steps to Reproduce

Deploy CF with the users_can_select_backend: false option set
Run acceptance tests

Expected result

The test should not have been run as it uses both DEA and Diego backends, but we only have Diego backend deployed, and we have backed: diego set in our acceptance test options.

Current result

Test fails as it receives CF-BackendSelectionNotAuthorized instead of the expected CF-MultipleAppPortsMappedDiegoToDea result.

Possible Fix

Check that user selection of backends is allowed, and do not run the test if it is disabled.

Lack of app log output in cups test makes debugging hard

The test in question has no AppReport in the AfterEach:

https://github.com/cloudfoundry/cf-acceptance-tests/blob/e5e7b47/apps/cups_test.go#L42

Leads to unhelpful failure output such as:

[2016-04-05 23:40:42.89 (UTC)]> cf push CATS-APP-fbd5abf9-b816-4c33-4be8-e3480b493855 --no-start -b ruby_buildpack -m 256M -p ../assets/ruby_simple -d cat.wild.cf-app.com 
Creating app CATS-APP-fbd5abf9-b816-4c33-4be8-e3480b493855 in org CATS-ORG-2-2016_04_05-23h38m12.408s / space CATS-SPACE-2-2016_04_05-23h38m12.408s as CATS-USER-2-2016_04_05-23h38m12.408s...
OK

Creating route cats-app-fbd5abf9-b816-4c33-4be8-e3480b493855.cat.wild.cf-app.com...
OK

Binding cats-app-fbd5abf9-b816-4c33-4be8-e3480b493855.cat.wild.cf-app.com to CATS-APP-fbd5abf9-b816-4c33-4be8-e3480b493855...
OK

Uploading CATS-APP-fbd5abf9-b816-4c33-4be8-e3480b493855...
Uploading app files from: /var/vcap/data/packages/acceptance-tests/26e73e03bc77735a15e619e524e95054b5af7eef.1-3f7517744428c1dfca9c209d55eecd2e9ed55e6f/src/github.com/cloudfoundry/cf-acceptance-tests/assets/ruby_simple
Uploading 58.8K, 8 files
Done uploading               


• Failure in Spec Setup (BeforeEach) [30.004 seconds]
User services When a user-defined service is bound [BeforeEach] can be deleted 
/var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/apps/cups_test.go:52

  Timed out after 30.000s.
  Failed to push app
  Expected process to exit.  It did not.

  /var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/apps/cups_test.go:33

Without the cf logs dump from AppReport, it's hard to build a timeline to figure out why it took more then 30s.

(Core developers can see the full build output which prompted this issue here: https://runtime.ci.cf-app.com/pipelines/cf-release/jobs/vsphere-cf-cats/builds/44)

Lack of persistence tests to address more serious data loss concerns

Hello,

Issue

The current app persistence tests recreate the app if it doesn't exist, which won't cause a failure if the app disappears during an upgrade.

Context

We are hoping to offer guidance on performing database migration from postgresql to mysql for existing CF users who want to transfer their data between the 2 databases. We had hoped to use the existing app persistence tests to verify that an app could survive the migration, but realized that those tests are written for a slightly different scenario. The main reason we can't use these is that the test happily pushes the app again if it doesn't exist. We would like a test that would fail if an app (or several apps) are no longer existent after an upgrade. This may also be useful to get feedback on the impact if there is a risky database migration within CCDB or UAADB.

Expected result

We would like to pass the name of an app to CATs and experience a failure if it does not exist or respond to a restart.

Current result

When we wipe out the old database and bring up the new one without transferring data, the test recreates the persistent app and there is no failure.

Possible Fix

A possible fix would involve passing a list of app names, which have already been created out-of-band, after the upgrade. The test would try to locate each one, and perform an action to ensure each app's data has been preserved (a restage or restart would probably work)

Let us know if you need any more context on this issue. @Amit-PivotalLabs I was asked to tag you on this, since it may interest the release-integration team.

Thanks!
Raina Masand and Ryan Moran
PCF Release Engineering

Help with failing SSO test

I do not believe this is a bug in the tests. However I'd like to know where the failure is coming from.

I am trying to run the CATS tests and I am seeing the following failure when I hit the broker SSO tests. This test repeatably fails however I cannot see any negative impact on our Cloud Foundry install.

• Failure [41.292 seconds]
SSO Lifecycle
/var/vcap/store/jenkins_master/workspace/test-cf-cats/cf-release/src/acceptance-tests/services/sso_lifecycle_test.go:109
  When a service broker is updated
  /var/vcap/store/jenkins_master/workspace/test-cf-cats/cf-release/src/acceptance-tests/services/sso_lifecycle_test.go:92
    can perform an operation on a user's behalf using sso [It]
    /var/vcap/store/jenkins_master/workspace/test-cf-cats/cf-release/src/acceptance-tests/services/sso_lifecycle_test.go:91

    The provided access token was not valid.
    Expected
        <string>: 401
    to equal
        <string>: 200

Test pollution caused by `CATS-persistent-app`

We @ the garden team are running CATS in the very end of our pipeline and have been facing the following problem: The test in apps/one_push_many_restarts_test.go seems to be starting a CATS-persistent-app and keeping it running. It only starts it the first time you run the tests only if it is not already there. What we observed is that if for some reason the app goes to down or crashed state then the test fails:

[Fail] An application that's already been pushed [It] can be restarted and still come up 
/tmp/build/357ec5d1/go/src/github.com/cloudfoundry/cf-acceptance-tests/apps/one_push_many_restarts_test.go:73

The problem is that the app is already started, but not accessible. If we manually restart the app it is all fixed. There is already a check that starts it when it is stopped. Maybe you could add one that does the restart if the app entered some bad state.

Vendoring Path Mismatch

730bc2a
^^
This recent commit changed the import path
github.com/cloudfoundry-incubator/cf-routing-test-helpers/schema
to
code.cloudfoundry.org/cf-routing-test-helpers/schema
which is not vendored. Presumably, goimports "helped". This caused vendoring to not work.

Lack of test suite documentation

My immediate need is to functionally validate some pre-production CF deployments.

It would be very helpful if we can have a wiki page that

  • Summarize what each test suite intended for
  • Pre-requites for each test suite to pass
  • Recommendation as which sets of test suites should be run and pass for what kind of deployment, e.g. BOSH Lite on laptop or production-like deployment on multiple VMs

I can see that out of the box, we just run CfAcceptanceTests, Applications, InternetDependent, SecurityGroups, but skip others. There is no justification or context as why it was done this way. I see that wiki for this project is empty, maybe that is a place for this kinds of documentation.

Tests timeout on first run

Running the tests gives the following output:

++ dirname go/src/github.com/cloudfoundry/cf-acceptance-tests/bin/test
+ . go/src/github.com/cloudfoundry/cf-acceptance-tests/bin/goenv
++ set -e -x
++ which go
/usr/local/bin/go
++++ dirname go/src/github.com/cloudfoundry/cf-acceptance-tests/bin/test
+++ cd go/src/github.com/cloudfoundry/cf-acceptance-tests/bin/..
+++ pwd
++ cats_dir=/Users/samirahamadu/workspace/go/src/github.com/cloudfoundry/cf-acceptance-tests
++ local_gopath=/Users/samirahamadu/workspace/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace
++ mkdir -p /Users/samirahamadu/workspace/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace/bin
++ export GOPATH=/Users/samirahamadu/workspace/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace:/Users/samirahamadu/workspace/go
++ GOPATH=/Users/samirahamadu/workspace/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace:/Users/samirahamadu/workspace/go
++ export PATH=/Users/samirahamadu/workspace/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace/bin:/Users/samirahamadu/workspace/cf:/Users/samirahamadu/.rbenv/bin:/Users/samirahamadu/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/go/bin
++ PATH=/Users/samirahamadu/workspace/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace/bin:/Users/samirahamadu/workspace/cf:/Users/samirahamadu/.rbenv/bin:/Users/samirahamadu/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/go/bin
+ go install -v github.com/onsi/ginkgo/ginkgo
+ echo 'RUNNING LOCAL CODE'
RUNNING LOCAL CODE
+ ginkgo -r -skipPackage=diego -slowSpecThreshold=120
Will skip diego, diego
[1406131952] Applications - 30/30 specs 
> gcf api api.10.244.0.34.xip.io --skip-ssl-validation 
Setting api endpoint to api.10.244.0.34.xip.io...
OK


API endpoint:   https://api.10.244.0.34.xip.io (API version: 2.8.0)   
Not logged in. Use 'gcf login' to log in.

> gcf auth admin admin 

------------------------------
Failure [17.466 seconds]
[BeforeSuite] BeforeSuite 
/Users/samirahamadu/workspace/cf-release/src/acceptance-tests/apps/init_test.go:30

  Timed out after 10.000s.
  Expected process to exit.  It did not.

  /Users/samirahamadu/workspace/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace/src/github.com/onsi/gomega/gexec/session.go:130
------------------------------

> gcf logout 
Logging out...
OK

> gcf api api.10.244.0.34.xip.io --skip-ssl-validation 
Setting api endpoint to api.10.244.0.34.xip.io...
OK


API endpoint:   https://api.10.244.0.34.xip.io (API version: 2.8.0)   
Not logged in. Use 'gcf login' to log in.

> gcf auth admin admin 
Failure [18.166 seconds]
[AfterSuite] AfterSuite 
/Users/samirahamadu/workspace/cf-release/src/acceptance-tests/apps/init_test.go:34

  Timed out after 10.001s.
  Expected process to exit.  It did not.

  /Users/samirahamadu/workspace/go/src/github.com/cloudfoundry/cf-acceptance-tests/Godeps/_workspace/src/github.com/onsi/gomega/gexec/session.go:130
------------------------------

Ran 30 of 30 Specs in 35.633 seconds
FAIL! -- 0 Passed | 30 Failed | 0 Pending | 0 Skipped --- FAIL: TestApplications (36.52 seconds)
FAIL

Ginkgo ran in 56.349477134s
Test Suite Failed

If I run cf auth admin admin manually, it works fine - so I'm assuming it's not a problem with my CF instance.
Interestingly, I then ran ./bin/tests -v. Most of the tests passed:

Ran 30 of 30 Specs in 1459.146 seconds
FAIL! -- 28 Passed | 2 Failed | 0 Pending | 0 Skipped --- FAIL: TestApplications (1459.21 seconds)

I've tried to provision CF a few times now and the tests always seem to fail on the first run.

cf-acceptance-tests - healthcheck_test.go

Issue

There is test_default for DEA and diego_test_default for DIEGO.

Can you run healthcheck_test.go for both or just for DIEGO?

If you can also run it for DEA:

There are 2 tests in healthcheck_test.go, 1 uses option "-u port" and another uses option "-u none".

I found the test for option "-u port" succeeded but the one for option "-u none" failed.

Is that expected?

Context

cf start returns:

Starting app CATS-APP-722322e6-0ff3-47a3-717a-7e861bd07130 in org cats-org / space cats-space as admin...
-----> Downloaded app package (4.0K)
-----> Downloaded app buildpack cache (83M)
-------> Buildpack version 1.7.5
file:///var/vcap/data/dea_next/admin_buildpacks/092d6f83-00e4-4b0b-aba3-c034b084c57b_a25a466217b64d5e4d47a6796be8ab23e7b7eeaf/dependencies/https___pivotal-buildpacks.s3.amazonaws.com_concourse-binaries_godep_godep-v62-linux-x64.tgz
-----> Checking Godeps/Godeps.json file.
-----> Using go1.6.1
! Installing package '.' (default)
-----> Running: go install -v -tags cloudfoundry --buildmode=pie .
go-online
-----> Uploading droplet (840K)
0 of 1 instances running, 1 starting
etc...
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting
etc...
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting
etc...
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 failing
FAILED
Start unsuccessful
TIP: use 'cf logs CATS-APP-722322e6-0ff3-47a3-717a-7e861bd07130 --recent' for more information

Steps to Reproduce

cf logs returns:

etc...
2016-04-28T15:11:42.56-0400 [App/0] OUT I am working at 2016-04-28 19:11:42.567038672 +0000 UTC o'clock
2016-04-28T15:11:42.62-0400 [DEA/0] ERR Instance (index 0) failed to start accepting connections
2016-04-28T15:11:42.63-0400 [App/0] ERR
2016-04-28T15:11:42.63-0400 [API/0] OUT App instance exited with guid 84e0e391-b861-445e-b097-4dafd1819f63 payload: {"cc_partition"=>"default", "droplet"=>"84e0e391-b861-445e-b097-4dafd1819f63", "version"=>"e0fb64c9-668e-49d9-b12e-b14b83faba30", "instance"=>"c79fdead926442818443ec338050196a", "index"=>0, "reason"=>"CRASHED", "exit_status"=>-1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1461870702}
2016-04-28T15:11:48.82-0400 [DEA/0] OUT Removing crash for app with id 84e0e391-b861-445e-b097-4dafd1819f63
2016-04-28T15:11:48.82-0400 [DEA/0] OUT Stopping app instance (index 0) with guid 84e0e391-b861-445e-b097-4dafd1819f63
2016-04-28T15:11:48.82-0400 [DEA/0] OUT Stopped app instance (index 0) with guid 84e0e391-b861-445e-b097-4dafd1819f63
2016-04-28T15:12:40.88-0400 [DEA/0] OUT Starting app instance (index 0) with guid 84e0e391-b861-445e-b097-4dafd1819f63
2016-04-28T15:12:42.55-0400 [App/0] OUT I am working at 2016-04-28 19:12:42.519071969 +0000 UTC o'clock
2016-04-28T15:12:47.51-0400 [App/0] OUT I am working at 2016-04-28 19:12:47.519440068 +0000 UTC o'clock

Expected result

If this test is meant for DIEGO only then it should be excluded from the list for DEA.

Current result

The test with option "-u none" failed but not sure why?

Possible Fix

[not obligatory, but suggest fixes or reasons for the bug]

name of issue screenshot

[if relevant, include a screenshot]

Add ability to have CATS BOSH errand display what tests have run

As CATS changes, what is outputted changes as well. Output that used to indicate which test suites were run (ex. https://buildpacks.ci.cf-app.com/teams/main/pipelines/cf-release/jobs/cats/builds/19)

[1474400161] Backend Compatibility - 2/2 specs - 4 nodes SS SUCCESS! 24.966645341s 
[1474400161] Buildpack Detection - 8/8 specs - 4 nodes •••••••• SUCCESS! 1m49.936567118s 
[1474400161] Docker - 3/3 specs - 4 nodes ••• SUCCESS! 40.639250951s 
[1474400161] InternetDependent - 1/1 specs - 4 nodes • SUCCESS! 48.355208603s 
[1474400161] Route Services - 3/3 specs - 4 nodes SSS SUCCESS! 25.963822934s 
[1474400161] Routing - 7/7 specs - 4 nodes SSSSSSS SUCCESS! 21.251889141s 
[1474400161] SecurityGroups - 2/2 specs - 4 nodes •• SUCCESS! 2m3.613666856s 
[1474400161] Services - 36/36 specs - 4 nodes •••••••••

is no longer available in the output and it's difficult to determine which specs were actually run in your CATS run.

It'd be great to have config option to print not just the tests that are skipped over or errored/failed, but the tests that ran and succeeded as well.

For example, in our latest cf-release CATS build for the buildpacks team, we can't tell which tests were run at all: https://buildpacks.ci.cf-app.com/teams/main/pipelines/cf-release/jobs/cats/builds/25

config_test.go pollutes the environment of the node it runs on

Create a new file helpers/config/another_test.go:

package config_test

import (
    "os"

    . "github.com/onsi/ginkgo"
    . "github.com/onsi/gomega"
)

var _ = Describe("another test", func() {
    It("test", func() {
        Expect(os.Getenv("CONFIG")).To(Equal("test"))
    })
})

Run:

CONFIG=test ginkgo -untilItFails helpers/config/

This will eventually fail when the polluting test runs before the test that expects CONFIG to be set to test.

service_broker test does not work offline

It appears the service_broker test does not work without internet access. Is this by design?

Would you accept a PR that fixes this? I assume we just have to cache the bundles it uses?

droplet bits test cause unexpected error when run in a windows environment

The following line fails: https://github.com/cloudfoundry/cf-acceptance-tests/blob/master/apps/droplet_uploading_and_downloading.go#L62

The test "Users can manage droplet bits for an app" in the apps/droplet_uploading_and_downloading.go runs tar -z which in a windows environment will fail to uncompress with gzip, and cause the ginkgo tests to exist with status code 2.

Instead of invoking tar -ztf to extract the file and list the contents, this could be done in two separate steps (ie. first gzip then tar). This way it would work on both windows and non-windows environments.

Config option to point to a different CF binary.

This would simplify test setup. What I like about the config.json is that it's one decalarative place to describe all the external dependencies. That way if a cats fails in CI, i can grab the config and try again locally.

cf-accepatance test setup failed

Thanks for submitting an issue to cf-acceptance-tests. We are always trying to improve! To help us, please fill out the following template.

Issue

while executing CF acceptance test its failing due to not finding package github.com/cloudfoundry/noaa/events which is mentioned in loggregator.go

Context

For CF v238,
Rest of the test setup also fails by mentioning "no test files" for

Steps to Reproduce

This issue is occurring when i run ./bin/test_default

Expected result

Test should run successfully and give result. Also please confirm if below mention result is correct or some issue with my setup

Current result

src/github.com/cloudfoundry/cf-acceptance-tests/apps/loggregator_test.go:16:2: cannot find package "github.com/cloudfoundry/noaa/events" in any of:
        /usr/lib/go/src/pkg/github.com/cloudfoundry/noaa/events (from $GOROOT)
        /home/src/github.com/cloudfoundry/noaa/events (from $GOPATH)
        /home/ubuntu/cibaca/test-suites/cf-acceptance-tests/src/github.com/cloudfoundry/noaa/events
FAIL    github.com/cloudfoundry/cf-acceptance-tests/apps [setup failed]
?       github.com/cloudfoundry/cf-acceptance-tests/helpers/app_helpers [no test files]
?       github.com/cloudfoundry/cf-acceptance-tests/helpers/assets      [no test files]
?       github.com/cloudfoundry/cf-acceptance-tests/helpers/matchers    [no test files]
?       github.com/cloudfoundry/cf-acceptance-tests/helpers/services    [no test files]
?       github.com/cloudfoundry/cf-acceptance-tests/helpers/v3_helpers  [no test files]
# golang.org/x/crypto/ed25519
src/golang.org/x/crypto/ed25519/ed25519.go:54: undefined: crypto.SignerOpts

Possible Fix

[not obligatory, but suggest fixes or reasons for the bug]

name of issue screenshot

cf-acceptance error

security_groups suite - remove assumption of no existing security groups on deployment

Currently, we set a default security group when deploying our CF - this leads to problems as the initial part of the test assumes that the permissions are not wide open and there are no security groups to speak of.

The better approach would be to in a BeforeEach to list and then unbind the security group for staging. AfterEach you would then want to bind all of the security groups that were previously removed.

Does this sound reasonable?

CF push fail with Error uploading files

Command

cf push dora

CLI Version

cf version 6.16.1+924508c-2016-02-26

Error

Error uploading application.
An unknown error occurred.
FAILED

api vm has below error:

/var/vcap/sys/log/cloud_controller_worker_ctl.log:
[2016-04-08 03:00:00+0000] [Worker(cc_api_worker.api_z1.0.2)] Job VCAP::CloudController::Jobs::ExceptionCatchingJob (id=257) FAILED (0 prior attempts) with CloudController::Blobstore::BlobstoreError: Could not create object, 404/
[2016-04-08 03:00:00+0000] <title>404 Not Found</title>
[2016-04-08 03:00:00+0000]
[2016-04-08 03:00:00+0000]

404 Not Found


[2016-04-08 03:00:00+0000]
nginx
[2016-04-08 03:00:00+0000]
[2016-04-08 03:00:00+0000]
[2016-04-08 03:00:00+0000] [Worker(cc_api_worker.api_z1.0.2)] Job VCAP::CloudController::Jobs::ExceptionCatchingJob (id=257) REMOVED permanently because of 1 consecutive failures
[2016-04-08 03:00:00+0000] [Worker(cc_api_worker.api_z1.0.2)] 1 jobs processed at 4.4393 j/s, 1 failed

CC API Version

API version: 2.52.0

CF Trace

Attached
push-error.log.zip

Platform Details

amazon linux ami

[ec2-user@ip- micro-deployment]$ cf events dora
Getting events for app dora in org default_organization / space default_space as admin...

time event actor description
2016-04-08T03:03:09.00+0000 audit.app.update admin
2016-04-08T02:59:58.00+0000 audit.app.update admin
2016-04-08T02:19:19.00+0000 audit.app.update admin
2016-04-08T02:16:42.00+0000 audit.app.update admin
2016-04-08T02:14:54.00+0000 audit.app.update admin
2016-04-08T02:14:47.00+0000 audit.app.update admin
2016-04-08T02:14:20.00+0000 audit.app.update admin
2016-04-08T02:12:04.00+0000 audit.app.update admin
2016-04-08T02:12:04.00+0000 audit.app.map-route admin
2016-04-08T02:12:04.00+0000 audit.app.create admin instances: 1, state: STOPPED, environment_json: PRIVATE DATA HIDDEN

Just to add one more thing here.. blobstore_z1/0 VM's access log is complaining about 404's:

blobstore-username [08/Apr/2016:04:59:28 +0000] "PUT /admin/cc-resources/d3/9d/d39d0c7557642754a4641ff3a14aa8a7a9253260 HTTP/1.1" 404 162 "-" "HTTPClient/1.0 (2.7.1, ruby 2.2.4 (2015-12-16))" 0.000 - .

Please help

Can no longer focus describes

Now that there are specialized versions like AppDescribe

The work around is to make a new parent Describe and focus that.

Loggregator tests frequently failing

Issue

firehose data and shows container metrics tests within the apps test suite are frequently failing.

It seems that it is related to the noaa library (authorization/reconnection issues, although the user has sufficient rights)

The functionality itself is working.

Context

cf v237
Doppler endpoint: wss://doppler.domain
Same result with increased timeouts and master version of cf-acceptance-tests

Steps to Reproduce

Happens frequently (also when only these two tests are executed), but not reproducible.

Expected result

Tests should succeed.

Current result

loggregator firehose data [It] shows logs and metrics 
/var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/apps/loggregator_test.go:103

  Timed out after 10.000s.
  To enable the logging & metrics firehose feature, please ask your CF administrator to add the 'doppler.firehose' scope to your CF admin user.
  When passed a matcher, ReceiveMatcher's channel *must* receive something.
loggregator firehose data [It] shows container metrics 
/var/vcap/packages/acceptance-tests/src/github.com/cloudfoundry/cf-acceptance-tests/apps/loggregator_test.go:132

  Expected error:
      <*errors.UnauthorizedError | 0xc821675280>: {
          description: "You are not authorized. Error: Invalid authorization",
      }
      Unauthorized error: You are not authorized. Error: Invalid authorization
  not to have occurred

Possible Fix

Is it maybe related to #18 #14?!

I have seen similar issues with the firehose-plugin, which is also using the noaa library. Error: Invalid authorization although the token is still valid.

There are how many test cases in total?

I want to know there are about how many test cases in total,

and when I run the bin/test, if there is one test cases failed, next part( such as service broker) don't run at all. it is designed like this or I run it in wrong way?

thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.