Giter VIP home page Giter VIP logo

cf-smoke-tests's Introduction

CF Smoke Tests

Overview

  1. Purpose
  2. Test Setup
    1. Dependencies
    2. Config
  3. Running Tests
  4. Contribution To Smoke Tests

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 to reveal fundamental problems with the system.

There are three tests in this suite, all of which are pretty simple:

  1. runtime: Pushes an app and validates that HTTP requests are properly routed to the app.
  2. logging: Pushes an app and validates that logs can be fetched for the app.
  3. 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 Foundry or to test administrator operations. The CF Acceptance Tests do perform this more extensive testing, although they are designed to be run as part of a development pipeline and not against production environments.

Test Setup

Dependencies

Make sure you have the following installed:

Check out a copy of cf-smoke-tests. The recommended way to do this is to clone the repo, if you don't have it: git clone [email protected]:cloudfoundry/cf-smoke-tests.git. Alternatively, you can simply cd into a pre-existing cf-smoke-tests directory and run git pull.

To run the CF Smoke tests, you will need:

  • a running CF instance
  • an environment variable $CONFIG which points to a .json file that contains the relevant configuration information.

Config

Below 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"                   : "windows",
  "isolation_segment_name"          : "is1",
  "isolation_segment_domain"        : "is1.bosh-lite.com",
  "enable_isolation_segment_tests"  : true,
  "linux_buildpack_name"            : "binary_buildpack",
  "windows_buildpack_name"          : "hwc_buildpack"
}

The following are special case configurations.

Credentials

Must supply one of the following login credentials.

  • User credentials
      "user":     "username",
      "password": "password"
  • Client credentials
      "client":        "client-name",
      "client_secret": "client-secret"

Skip SSL validation

If you are running the tests against bosh-lite or any other environment using self-signed certificates, add:

  "skip_ssl_validation": true

Org and space cleanup

If you would like to preserve the organization, space, and app created during the tests for debugging, add:

  "cleanup": false

Windows

If you have deployed Windows cells, add:

  "enable_windows_tests": true,
  "windows_stack":        "windows"

The valid options for windows_stack are windows2016 and windows.

Isolation segments

If you'd like to run isolation segment tests, add:

  "enable_isolation_segment_tests": true,
  "isolation_segment_name": "name",
  "isolation_segment_domain": "domain"

For more details on how to setup routing for isolation segments, read this document.

Artifacts directory

To store cf cli trace output, set

  "artifacts_directory": "/tmp/smoke-artifacts"

The following files may be created:

CF-TRACE-Smoke-1.txt
CF-TRACE-Smoke-2.txt
junit-Applications-1.xml
...

Admin vs. Regular User

Smoke tests can be configured with two types of users.

  1. Regular user: Smoke tests can be configured to run with a non-admin user. If you'd like to use a non-admin user, it must be able to assign user roles (either OrgManager or SpaceManager roles). Please refer to the Roles and Permissions for Active Orgs documentation for more information. In this configuration, organization and space must be created ahead of time and provided as org and space configuration properties, respectively. Also, use_existing_org and use_existing_space must be set to true. This configuration is recommended for tests run against environments run by humans, in particular, production deployments.

  2. 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 like to use a non-admin user, the existing organization provided as org configuration property must be entitled to the isolation segment provided by isolation_segment_name. In addition, you need to create a space inside org and provide it as isolation_segment_space. isolation_segment_space must be assigned the isolation segment isolation_segment_name.

NOTE: If the default identity provider for your deployment is not UAA, it is recommended that you set the origin configuration property to UAA, and ensure the user credentials that you provide are registered with UAA.

Running Tests

To execute the tests, run:

./bin/test

Internally the bin/test script runs tests using ginkgo.

Arguments, such as --keep-going, --flake-attempts [int], etc., that are passed to the test script are passed through to ginkgo. For example, to execute tests in parallel one would run:

./bin/test -p

Seeing command-line output

To see verbose output from cf, use ginkgo's -v flag:

./bin/test -v

Contributing to Smoke Tests

Guidelines

The goal of smoke tests is to provide a small, simple set of tests to verify basic deployment configuration. As such, we have some guidelines for contributing new tests to this suite.

Creating API resources in the test

One basic rule for good test design is not to mock the object under test. We can translate that idea to a suite like smoke tests in the following way: If smoke tests exist to validate deployment configuration, then smoke tests should not itself mutate deployment configuration.

There are, however, several resources that can be defined as either deployment configuration or as API resources. For example, shared app domains and isolation segments are both resources that can be created via the API, so it might be tempting to have a test create them in a BeforeSuite. However, shared app domains and isolation segments really represent deployment configurations. Accordingly, smoke tests should not create those resources as part of the test; instead, it should validate (either implicitly or explicitly) that those resources have already been created, and configured correctly.

Other API resources, like orgs and spaces that exist simply to be able to push an app, can absolutely be created as part of a test.

Admin vs. Regular User workflows

Please refer to the Regular vs admin user section to understand the difference between these two workflows.

Dependency Management

cf-smoke-tests use modules to manage go dependencies. These dependencies, together with the version of go itself, are automatically bumped by the CI pipeline defined in the cf-smoke-tests-release repo.

All go packages required to run smoke tests are vendored into the vendor/ directory.

cf-smoke-tests's People

Contributors

acosta11 avatar anexper avatar apshirley avatar cf-rabbit-bot avatar changdrew avatar chunyilyu avatar clhynfield avatar ctlong avatar davewalter avatar dennisdenuto avatar dependabot[bot] avatar dlapiduz avatar dsabeti avatar ericpromislow avatar geapi avatar heyjcollins avatar iaftab-alam avatar ishustava avatar jamespollard8 avatar jaresty avatar jfmyers9 avatar mdelillo avatar mhoran avatar njbennett avatar robdimsdale avatar selzoc avatar sergueif avatar staylor14 avatar vitreuz avatar zaksoup 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

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-smoke-tests's Issues

Empty logging application name

Hello,

When running smoke tests with pre-defined logging app name in configuration, the configuration entry is not used and tests are ran with an empty app name.

I'm afraid that the variable appName is never assigned in that use-case. It should take the value of testConfig.LoggingApp

var useExistingApp = testConfig.LoggingApp != ""
var appName string
Describe("cf logs", func() {
AfterEach(func() {
defer func() {
if testConfig.Cleanup && !useExistingApp {
Expect(cf.Cf("delete", appName, "-f", "-r").Wait(testConfig.GetDefaultTimeout())).To(Exit(0))
}
}()
smoke.AppReport(appName, testConfig.GetDefaultTimeout())
})
Context("linux", func() {
BeforeEach(func() {
if !useExistingApp {
appName = generator.PrefixedRandomName("SMOKES", "APP")
Expect(cf.Cf("push", appName, "-b", "ruby_buildpack", "-p", smoke.SimpleRubyAppBitsPath, "-d", testConfig.AppsDomain).Wait(testConfig.GetPushTimeout())).To(Exit(0))
}
})

Remove note about Godeps from README.md

The README has the following note about running the tests:

All go dependencies required by the smoke tests are vendored in cf-smoke-tests/Godeps. The test script itself, bin/test, ensures that the vendored dependencies are available when executing the tests by prepending this directory to $GOPATH.

However, Godeps is no longer used to vendor cf-smoke-tests dependencies. Perhaps this should be updated to a note about the vendor directory?

Moving to GVT breaks production smoke tests

this commit here breaks the pivotal production smoke tests. I'm interested in what advantages we get from using GVT and how we can make this a world we all want to live in.

I have reverted this commit so we can see if production is dead or not in the interim

thanks!

-- Topher

License/Notice file missing

This repository has no LICENSE/NOTICE file. The other submodules in cf-release all (that I've seen) have one and are all making their dependencies' licenses visible in such a file. Notably the "COPYING" file from gouuid is missing.

CodeQL scanning fails due to autobuild not supporting go1.21

Error log from GH action:

  2023/09/05 15:47:49 Autobuilder was built with go1.20.7, environment has go1.20.7
...
  2023/09/05 15:47:49 Error running go tooling: err: exit status 1: stderr: go: errors parsing go.mod:
  /home/runner/work/cf-smoke-tests/cf-smoke-tests/go.mod:5: unknown directive: toolchain
  
  2023/09/05 15:47:49 Extraction failed: exit status 1
  Error: We were unable to automatically build your code. Please replace the call to the autobuild action with your custom build steps. Encountered a fatal error while running "/opt/hostedtoolcache/CodeQL/2.14.3/x64/codeql/go/tools/autobuild.sh". Exit code was 1 and error was: 2023/09/05 15:47:49 Autobuilder was built with go1.20.7, environment has go1.20.7

We could replace autobuild with our own buildstep, or let it fail until CodeQL supports go1.21.

Help troubleshooting exit code 137

Hi there,

We've seen a rise in the number of errors of the following type. What does this mean in terms of what part of the system failed? Is this a case where the system is having trouble, or is this a trouble with the test? I ask because usually a re-run then succeeds.

/go/src/github.com/cloudfoundry/cf-smoke-tests/smoke/etcd_cluster_check/init_test.go:88

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

  /go/src/github.com/cloudfoundry/cf-smoke-tests/smoke/etcd_cluster_check/init_test.go:79

  Full Stack Trace
  	/go/src/github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:69 +0x1ed
  github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/onsi/gomega/internal/assertion.(*Assertion).To(0xc4202ee3c0, 0x8d91e0, 0xc4201b3fa0, 0x0, 0x0, 0x0, 0xc4202ee3c0)
  	/go/src/github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:35 +0xae
  github.com/cloudfoundry/cf-smoke-tests/smoke/etcd_cluster_check.TestSmokeTests.func4()
  	/go/src/github.com/cloudfoundry/cf-smoke-tests/smoke/etcd_cluster_check/init_test.go:79 +0x7df
  github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc42000d080, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
  	/go/src/github.com/cloudfoundry/cf-smoke-tests/smoke/etcd_cluster_check/init_test.go:97 +0x4b9
  testing.tRunner(0xc42008a240, 0x793ce8)
  	/usr/local/go/src/testing/testing.go:610 +0x81
  created by testing.(*T).Run
  	/usr/local/go/src/testing/testing.go:646 +0x2ec

Missing method in smoke.config

After the latest commit, the following error is encountered when running ./bin/test

# github.com/cloudfoundry/cf-smoke-tests/smoke/isolation_segments [github.com/cloudfoundry/cf-smoke-tests/smoke/isolation_segments.test] smoke/isolation_segments/init_test.go:22:52: cannot use testConfig (type *smoke.Config) as type workflowhelpers.testSuiteConfig in argument to workflowhelpers.NewSmokeTestSuiteSetup: *smoke.Config does not implement workflowhelpers.testSuiteConfig (missing GetAddExistingUserToExistingSpace method)

Turn off cf-gitbot for this repo

We don't have a tracker project setup to track this repo anymore, and are planning to use GH projects into the future. Therefore, we don't need cf-gitbot setup.

We could leave it laying around, but it's messages are pretty annoying and it messes with the issue labels.

Bump cf-test-helpers

Please bump to cf-test-helpers commit 1a8c223f1cc4110cc866f7298ff622b83e274173 or later.

The version of cf-test-helpers that is currently referenced has a bug where even though an existing user is specified it still creates a user. If UAA is backed by LDAP, then this results in two users with the same username but with different origins. The commit of cf-test-helpers that resolves this issue is --> cloudfoundry/cf-test-helpers@1a8c223

Panic! missing configuration 'admin_user' running smoke tests

We are running this test suite as part of our ops health check for a PCF instance. Since yesterday 2016-08-30 22:02:11.21 (UTC), we started getting consistent failures due to missing configuration 'admin_user'.

It might be our platform, although it seems to work well. We realised some recent commits involved refactoring in the related files e.g. cloudfoundry-incubator/cf-test-helpers/config/config.go.

Our current $CONFIG file looks like this:

{  
  "suite_name"           : "CF_SMOKE_TESTS",
  "api"                  : "someapi.net",
  "apps_domain"          : "someappdomain.net",
  "user"                 : "admin",
  "password"             : "somesupersecurepassword",
  "org"                  : "CF-SMOKE-ORG",
  "space"                : "CF-SMOKE-SPACE",
  "cleanup"              : true,
  "use_existing_org"     : false,
  "use_existing_space"   : false,
  "logging_app"          : "",
  "runtime_app"          : "",
  "enable_windows_tests" : false,
  "backend"              : "diego",
  "skip_ssl_validation"  : true
}

The error trace we are experiencing looks like the following bit:

[2016-08-31 08:44:59.74 (UTC)]> cf logs SMOKES-1-APP-d88a2a20-fb73-44e7-5897-3197298e45da --recent 
Connected, dumping recent logs for app SMOKES-1-APP-d88a2a20-fb73-44e7-5897-3197298e45da in org CF-SMOKE-ORG / space CF-SMOKE-SPACE as admin...

2016-08-31T08:44:11.45+0000 [API/0]      OUT Created app with guid f1520ebe-f5ff-40e7-8993-ac37c656ebc1
2016-08-31T08:44:11.68+0000 [API/0]      OUT Updated app with guid f1520ebe-f5ff-40e7-8993-ac37c656ebc1 ({"route"=>"70a930d9-98a3-42c6-88c7-19d3a178f2cb"})
2016-08-31T08:44:17.37+0000 [API/0]      OUT Updated app with guid f1520ebe-f5ff-40e7-8993-ac37c656ebc1 ({"diego"=>true})
2016-08-31T08:44:18.95+0000 [STG/0]      OUT Downloading binary_buildpack...
2016-08-31T08:44:18.95+0000 [STG/0]      OUT Downloading java_buildpack_offline...
2016-08-31T08:44:18.95+0000 [STG/0]      OUT Downloading ruby_buildpack...
2016-08-31T08:44:18.95+0000 [STG/0]      OUT Downloading go_buildpack...
2016-08-31T08:44:18.95+0000 [STG/0]      OUT Downloading staticfile_buildpack...
2016-08-31T08:44:18.95+0000 [STG/0]      OUT Downloading php_buildpack...
2016-08-31T08:44:18.95+0000 [STG/0]      OUT Downloading python_buildpack...
2016-08-31T08:44:18.95+0000 [STG/0]      OUT Downloading nodejs_buildpack...
2016-08-31T08:44:18.97+0000 [API/0]      OUT Updated app with guid f1520ebe-f5ff-40e7-8993-ac37c656ebc1 ({"state"=>"STARTED"})
2016-08-31T08:44:18.97+0000 [STG/0]      OUT Downloaded staticfile_buildpack
2016-08-31T08:44:18.99+0000 [STG/0]      OUT Downloaded java_buildpack_offline
2016-08-31T08:44:18.99+0000 [STG/0]      OUT Downloaded go_buildpack
2016-08-31T08:44:18.99+0000 [STG/0]      OUT Downloaded php_buildpack
2016-08-31T08:44:18.99+0000 [STG/0]      OUT Downloaded binary_buildpack
2016-08-31T08:44:18.99+0000 [STG/0]      OUT Downloaded python_buildpack
2016-08-31T08:44:19.00+0000 [STG/0]      OUT Downloaded ruby_buildpack
2016-08-31T08:44:19.05+0000 [STG/0]      OUT Downloaded nodejs_buildpack
2016-08-31T08:44:19.05+0000 [STG/0]      OUT Creating container
2016-08-31T08:44:19.49+0000 [STG/0]      OUT Successfully created container
2016-08-31T08:44:19.49+0000 [STG/0]      OUT Downloading app package...
2016-08-31T08:44:19.56+0000 [STG/0]      OUT Downloaded app package (586K)
2016-08-31T08:44:19.56+0000 [STG/0]      OUT Staging...
2016-08-31T08:44:20.13+0000 [STG/0]      OUT -------> Buildpack version 1.6.16
2016-08-31T08:44:20.19+0000 [STG/0]      OUT        Downloaded [file:///tmp/buildpacks/136d128dbd7abeecc4d682aecb849e0c/dependencies/https___pivotal-buildpacks.s3.amazonaws.com_ruby_binaries_shared_bundler-1.11.2.tgz]
2016-08-31T08:44:20.28+0000 [STG/0]      OUT -----> Compiling Ruby/Rack
2016-08-31T08:44:20.54+0000 [STG/0]      OUT        Downloaded [file:///tmp/buildpacks/136d128dbd7abeecc4d682aecb849e0c/dependencies/https___pivotal-buildpacks.s3.amazonaws.com_concourse-binaries_ruby_ruby-2.2.4-linux-x64.tgz]
2016-08-31T08:44:21.03+0000 [STG/0]      OUT -----> Using Ruby version: ruby-2.2.4
2016-08-31T08:44:21.10+0000 [STG/0]      OUT -----> Installing dependencies using bundler 1.11.2
2016-08-31T08:44:21.24+0000 [STG/0]      OUT        Downloaded [file:///tmp/buildpacks/136d128dbd7abeecc4d682aecb849e0c/dependencies/https___pivotal-buildpacks.s3.amazonaws.com_ruby_binaries_cflinuxfs2_libyaml-0.1.6.tgz]
2016-08-31T08:44:21.29+0000 [STG/0]      OUT        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
2016-08-31T08:44:21.63+0000 [STG/0]      OUT        Using bundler 1.11.2
2016-08-31T08:44:21.63+0000 [STG/0]      OUT        Installing tilt 1.4.1
2016-08-31T08:44:21.63+0000 [STG/0]      OUT        Installing rack 1.5.2
2016-08-31T08:44:21.73+0000 [STG/0]      OUT        Installing rack-protection 1.5.0
2016-08-31T08:44:21.75+0000 [STG/0]      OUT        Installing sinatra 1.4.3
2016-08-31T08:44:21.81+0000 [STG/0]      OUT        Bundle complete! 1 Gemfile dependency, 5 gems now installed.
2016-08-31T08:44:21.81+0000 [STG/0]      OUT        Gems in the groups development and test were not installed.
2016-08-31T08:44:21.81+0000 [STG/0]      OUT        Bundled gems are installed into ./vendor/bundle.
2016-08-31T08:44:21.82+0000 [STG/0]      OUT        Bundle completed (0.52s)
2016-08-31T08:44:21.82+0000 [STG/0]      OUT        Cleaning up the bundler cache.
2016-08-31T08:44:22.17+0000 [STG/0]      OUT ###### WARNING:
2016-08-31T08:44:22.17+0000 [STG/0]      OUT        You have not declared a Ruby version in your Gemfile.
2016-08-31T08:44:22.17+0000 [STG/0]      OUT        To set your Ruby version add this line to your Gemfile:
2016-08-31T08:44:22.17+0000 [STG/0]      OUT        ruby '2.2.4'
2016-08-31T08:44:22.17+0000 [STG/0]      OUT        # See https://devcenter.heroku.com/articles/ruby-versions for more information.
2016-08-31T08:44:25.51+0000 [STG/0]      OUT Exit status 0
2016-08-31T08:44:25.51+0000 [STG/0]      OUT Staging complete
2016-08-31T08:44:25.51+0000 [STG/0]      OUT Uploading droplet, build artifacts cache...
2016-08-31T08:44:25.51+0000 [STG/0]      OUT Uploading build artifacts cache...
2016-08-31T08:44:25.51+0000 [STG/0]      OUT Uploading droplet...
2016-08-31T08:44:25.57+0000 [STG/0]      OUT Uploaded build artifacts cache (1.4M)
2016-08-31T08:44:50.81+0000 [STG/0]      OUT Uploaded droplet (17.3M)
2016-08-31T08:44:50.82+0000 [STG/0]      OUT Uploading complete
2016-08-31T08:44:51.05+0000 [CELL/0]     OUT Creating container
2016-08-31T08:44:51.34+0000 [CELL/0]     OUT Successfully created container
2016-08-31T08:44:52.61+0000 [CELL/0]     OUT Starting health monitoring of container
2016-08-31T08:44:53.07+0000 [APP/0]      OUT Tick: 1472633093
2016-08-31T08:44:53.10+0000 [APP/0]      ERR [2016-08-31 08:44:53] INFO  WEBrick 1.3.1
2016-08-31T08:44:53.10+0000 [APP/0]      ERR [2016-08-31 08:44:53] INFO  ruby 2.2.4 (2015-12-16) [x86_64-linux]
2016-08-31T08:44:53.10+0000 [APP/0]      ERR [2016-08-31 08:44:53] INFO  WEBrick::HTTPServer#start: pid=20 port=8080
2016-08-31T08:44:53.13+0000 [CELL/0]     OUT Container became healthy
2016-08-31T08:44:54.07+0000 [APP/0]      OUT Tick: 1472633094
2016-08-31T08:44:55.07+0000 [APP/0]      OUT Tick: 1472633095
2016-08-31T08:44:56.07+0000 [APP/0]      OUT Tick: 1472633096
2016-08-31T08:44:57.07+0000 [APP/0]      OUT Tick: 1472633097
2016-08-31T08:44:58.07+0000 [APP/0]      OUT Tick: 1472633098
2016-08-31T08:44:59.07+0000 [APP/0]      OUT Tick: 1472633099
2016-08-31T08:45:00.07+0000 [APP/0]      OUT Tick: 1472633100

[2016-08-31 08:44:59.96 (UTC)]> cf delete SMOKES-1-APP-d88a2a20-fb73-44e7-5897-3197298e45da -f -r 
Deleting app SMOKES-1-APP-d88a2a20-fb73-44e7-5897-3197298e45da in org CF-SMOKE-ORG / space CF-SMOKE-SPACE as admin...
OK

•! Panic [54.627 seconds]
Runtime:
/tmp/build/b815761c/cf-smoke-tests/smoke/runtime/runtime_test.go:63
  linux apps
  /tmp/build/b815761c/cf-smoke-tests/smoke/runtime/runtime_test.go:50
    can be pushed, scaled and deleted [It]
    /tmp/build/b815761c/cf-smoke-tests/smoke/runtime/runtime_test.go:49

    Test Panicked
    missing configuration 'admin_user'
    /usr/local/go/src/runtime/panic.go:458

    Full Stack Trace
        /usr/local/go/src/runtime/panic.go:458 +0x243
    github.com/cloudfoundry-incubator/cf-test-helpers/config.LoadConfig(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /tmp/build/b815761c/cf-smoke-tests/Godeps/_workspace/src/github.com/cloudfoundry-incubator/cf-test-helpers/config/config.go:163 +0x146
    github.com/cloudfoundry-incubator/cf-test-helpers/helpers.Curl(0xc42039b240, 0x2, 0x2, 0x7f6752c524c8)
        /tmp/build/b815761c/cf-smoke-tests/Godeps/_workspace/src/github.com/cloudfoundry-incubator/cf-test-helpers/helpers/curl.go:11 +0x37
    _/tmp/build/b815761c/cf-smoke-tests/smoke/runtime.runPushTests(0xc420242480, 0x31, 0xc42000dd10, 0x4d, 0xc420102000)
        /tmp/build/b815761c/cf-smoke-tests/smoke/runtime/runtime_test.go:67 +0xd6
    _/tmp/build/b815761c/cf-smoke-tests/smoke/runtime.glob..func1.3.1()
        /tmp/build/b815761c/cf-smoke-tests/smoke/runtime/runtime_test.go:48 +0x484
    github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc420018780, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /tmp/build/b815761c/cf-smoke-tests/smoke/runtime/init_test.go:97 +0x4b9
    testing.tRunner(0xc42007a240, 0x7920d0)
        /usr/local/go/src/testing/testing.go:610 +0x81
    created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:646 +0x2ec

------------------------------
Runtime: windows apps 
  can be pushed, scaled and deleted
  /tmp/build/b815761c/cf-smoke-tests/smoke/runtime/runtime_test.go:61

[2016-08-31 08:45:05.34 (UTC)]> cf app SMOKES-1-APP-5c971254-fb08-4c87-4934-de2eafb5fb9b --guid 
FAILED
App SMOKES-1-APP-5c971254-fb08-4c87-4934-de2eafb5fb9b not found

[2016-08-31 08:45:05.49 (UTC)]> cf logs SMOKES-1-APP-5c971254-fb08-4c87-4934-de2eafb5fb9b --recent 
FAILED
App SMOKES-1-APP-5c971254-fb08-4c87-4934-de2eafb5fb9b not found

Versioned Binaries of Smoke Test

We would love some versioned binaries that can be run idempotently.

This would reduce the toil of our customers needing to configure go in environments that don't necessarily call for it.

Also allows the tests to more easily be run at scale or in pipelines.

Ala ginkgo build -r /test/directory/

smoke tests should honor apps_domain for app creation

Currently, when the smoke tests create apps, they appear to be getting created in the default domain for CF. When the tests go to query + make sure the app was created successfully, it uses the smoke_tests.apps_domain property. If this does not match the default CF domain, the tests will fail.

Tests should be updated so that app creation specifies the domain as well.

smoke test timing out

Hi we see a lot of timeouts in our large foundations hitting 300 seconds due to the smoke/runtime test taking a long time to download the buildpacks and are still at the staging phase when they are deleted; could you look to add in the buildpack into the cf push command?

This would help reduce the instance of failed smoke tests in our environments and make the tests run quicker.

i.e. in smoke/runtime/runtime_test.go
Expect(cf.Cf("push", appName, "-p", SIMPLE_RUBY_APP_BITS_PATH, "-d", testConfig.AppsDomain, "--no-start").Wait(CF_PUSH_TIMEOUT_IN_SECONDS)).To(Exit(0))

add in "-b", "ruby_buildpack",

The same as is in the smoke/logging command... example form smoke/logging/loggregator_test.go

Expect(cf.Cf("push", appName, "-b", "ruby_buildpack", "-p", SIMPLE_RUBY_APP_BITS_PATH, "-d", testConfig.AppsDomain, "--no-start").Wait(CF_PUSH_TIMEOUT_IN_SECONDS)).To(Exit(0))

CodeQL should scan C# (dotnet app)

tldr; CodeQL scanning should include the C# code in assets/dotnet_simple.

When I setup the CodeQL scan for the first time it failed with the following error:

Error: Could not auto-detect a suitable build method
  Error: We were unable to automatically build your code. Please replace the call to the autobuild action with your custom build steps.  Failure invoking /opt/hostedtoolcache/CodeQL/0.0.0-20220623/x64/codeql/csharp/tools/autobuild.sh with arguments .

I'm not sure what the build steps are to get this scan working, so I decided to make an issue and come back to it later. In the meantime, I've updated the scan to not include C#.

cf auth command exited with 1

when we ran smoke test , it got failed during cf auth command and please find below exception message

_Authenticating...
Error Code: 500
Raw Response: {}
FAILED
Failure [0.000 seconds]
[AfterSuite] AfterSuite
/tmp/build/b815761c/cf-smoke-tests-master/smoke/logging/init_test.go:28

Expected error:
<*errors.errorString | 0xc42028a670>: {
s: "cf auth command exited with 1",
}
cf auth command exited with 1
not to have occurred

/go/src/github.com/cloudfoundry-incubator/cf-test-helpers/workflowhelpers/user_context.go:99_

Please let me know root cause and resolution.

ETCD Cluster Check for PCF v1.12

Hi Team,
I am having PCF v1.12 and ETCD is no longer available from PCF V1.12.
so can you please confirm whether ETCD Cluster check is required for PCF v1.12?

smoke tests failures when http is disabled

Hi,

I'm running into some failures after disabling http listener on gorouters (router.disable_http set to true for routing-release).

The errors occurs on RoutingIsolationSegments tests.

From my understanding, the following function has http scheme hard-coded which leads the test to a failure since port 80 is not reachable.

func SendRequestWithSpoofedHeader(host, domain string) *http.Response {
req, _ := http.NewRequest("GET", fmt.Sprintf("http://wildcard-path.%s", domain), nil)
req.Host = host
resp, err := http.DefaultClient.Do(req)
Expect(err).NotTo(HaveOccurred())
return resp
}

  • Q: is there another way to run smoke-tests with a disabled http port ?
  • Q: if not, would you accept a PR that allows such a use-case ?
  • Q: if yes, what would be the best approach ?
    1. forcing https scheme in the function as it already is in runtime_test.go
    2. adding a configuration key disable_http in integration_config.json and creating the url accordingly ? This will require to add a new spec entry in cloudfoundry/cf-smoke-tests-release

cf smoketest failure on every 2-3 success attempts.

Smoketest test failed after every 2-3 success attempts. Failure may be due to one of the below reasons.

The app space could not be found.
The app org could not be found.

But it will be succeeded on next attempts.

Please let us know what cause this to failure. Attached the logs for further troubleshooting.
SMoketestError_Output.txt

prerequisites

I've been trying to get the smoke tests running locally. I struggled with this a bit until it became clear that the value of the "syslog_ip_address" property in the config.yml needs to be the public IP of the system on which the test is being executed, and that that IP needs to be reachable from the running CF environment for the loggregator_test to work as designed.

I would think that adding those criteria to the README.md where it describes what is needed would be a good thing(tm).

List of the test cases

Hello,

I would be great to have a list of test cases as part of the documentation in order to see at glance what tests are being executed.

Thanks!

Running on bosh-lite errors when checking space guid

We are running into a failure while deploying CF using the cf-smoke-tests-release#17.

Error output:

[2017-04-05 14:41:58.57 (UTC)]> cf space cf_smoke_tests_space --guid
FAILED
No org targeted, use 'cf target -o ORG' to target an org.

The stack trace references to the following files:

https://github.com/cloudfoundry/cf-smoke-tests/blob/master/smoke/helpers.go#L56
https://github.com/cloudfoundry/cf-smoke-tests/blob/master/smoke/etcd_cluster_check/init_test.go#L76

@bonzofenix && @cloud-dude

Error flag redefined: ginkgo.seed

Hi

I am trying to run the smoke tests under go 1.8 but I get this error:

  • ./bin/test
  • command -v go
  • [[ -z /go:/tmp/build/158c3bf0/smokeTests ]]
  • export PATH=/go:/tmp/build/158c3bf0/smokeTests/bin:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  • PATH=/go:/tmp/build/158c3bf0/smokeTests/bin:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  • command -v ginkgo
  • mkdir -p /go:/tmp/build/158c3bf0/smokeTests/src/github.com/onsi
  • cp -R vendor/github.com/onsi/ginkgo /go:/tmp/build/158c3bf0/smokeTests/src/github.com/onsi/ginkgo
  • go install -v github.com/onsi/ginkgo/ginkgo
    github.com/onsi/ginkgo/ginkgo/interrupthandler
    github.com/onsi/ginkgo/ginkgo/convert
    github.com/onsi/ginkgo/ginkgo/nodot
    github.com/onsi/ginkgo/ginkgo/testsuite
    github.com/onsi/ginkgo/ginkgo/testrunner
    github.com/onsi/ginkgo/ginkgo/watch
    github.com/onsi/ginkgo/ginkgo
  • export CF_DIAL_TIMEOUT=11
  • CF_DIAL_TIMEOUT=11
  • ginkgo -r --succinct -slowSpecThreshold=300
    /tmp/ginkgo227198536/etcd_cluster_check.test flag redefined: ginkgo.seed
    panic: /tmp/ginkgo227198536/etcd_cluster_check.test flag redefined: ginkgo.seed

goroutine 1 [running]:
flag.(*FlagSet).Var(0xc42001a0c0, 0x9fbb40, 0xacac80, 0xc42012c1f0, 0xb, 0x83ed4e, 0x2a)
/usr/local/go/src/flag/flag.go:793 +0x420
flag.(*FlagSet).Int64Var(0xc42001a0c0, 0xacac80, 0xc42012c1f0, 0xb, 0x5953c6ed, 0x83ed4e, 0x2a)
/usr/local/go/src/flag/flag.go:618 +0x7https://github.com/onsi/ginkgo/issues/2341
github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/onsi/ginkgo/config.Flags(0xc42001a0c0, 0xc420049de0, 0x7, 0xc420049e01)
/go/src/github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/onsi/ginkgo/config/config.go:66 +0xee
github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/onsi/ginkgo.init.1()
/go/src/github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:54 +0x59
github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/onsi/ginkgo.init()
/go/src/github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:570 +0x9d
github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/cloudfoundry-incubator/cf-test-helpers/commandreporter.init()
/go/src/github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/cloudfoundry-incubator/cf-test-helpers/commandreporter/command_reporter.go:53 +0x5d
github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/cloudfoundry-incubator/cf-test-helpers/internal.init()
/go/src/github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/cloudfoundry-incubator/cf-test-helpers/internal/starter.go:8 +0x44
github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/cloudfoundry-incubator/cf-test-helpers/commandstarter.init()
/go/src/github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/cloudfoundry-incubator/cf-test-helpers/commandstarter/command_starter.go:25 +0x4e
github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/cloudfoundry-incubator/cf-test-helpers/cf.init()
/go/src/github.com/cloudfoundry/cf-smoke-tests/vendor/github.com/cloudfoundry-incubator/cf-test-helpers/cf/cf.go:13 +0x44
github.com/cloudfoundry/cf-smoke-tests/smoke.init()
/go/src/github.com/cloudfoundry/cf-smoke-tests/smoke/helpers.go:58 +0x5d
_/tmp/build/158c3bf0/smokeTests/smoke/etcd_cluster_check.init()
/tmp/build/158c3bf0/smokeTests/smoke/etcd_cluster_check/init_test.go:79 +0x64
main.init()
_/tmp/build/158c3bf0/smokeTests/smoke/etcd_cluster_check/_test/_testmain.go:46 +0x53

Ginkgo ran 1 suite in 1.390824715s
Test Suite Failed

What could it be?
Is it related to onsi/ginkgo#285? or onsi/ginkgo#234?

cf push in runtime_tests uses random domain and can fail

Hi everyone,

with this change you've made the cf-smoke-tests compliant with CF CLI v7: 746b4a1#diff-86a47d06f5bb2981fa07be2b09b571df

For the "isolation_segments" test there is now an app manifest with a route. But for the "runtime_test" there is no manifest and the "-d" option has been removed. In our landscapes, the runtime test now fails because it picks the first domain from the "cf domains" list which is not usable. Instead, the test should use a manifest which specifies a route that points to the "apps_domain".

Can you please fix that?

Thanks and Best Regards,

Jochen.

Support for go modules in cf smoke tests

It looks like cf-smoke-tests does not use go modules and instead uses module management using a legacy GOPATH mode.
FYI this will prevent future versions of go from working with cf-smoke-tests. We noticed this problem when bumping go to 1.16 and worked around the issue by setting :
go env -w GO111MODULE=auto but this will not work once go 1.17 is out.

Are there plans to update cf-smoke-tests? I also notice alot of the dependencies have older versions that need updating?

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.