Example #1
0
func getTasksByState(client bbs.InternalClient, state models.Task_State) []*models.Task {
	tasks, err := client.Tasks(logger)
	Expect(err).NotTo(HaveOccurred())

	filteredTasks := make([]*models.Task, 0)
	for _, task := range tasks {
		if task.State == state {
			filteredTasks = append(filteredTasks, task)
		}
	}
	return filteredTasks
}
Example #2
0
func createDesiredLRPsInDomains(client bbs.InternalClient, domainCounts map[string]int) map[string][]*models.DesiredLRP {
	createdDesiredLRPs := map[string][]*models.DesiredLRP{}

	for domain, count := range domainCounts {
		createdDesiredLRPs[domain] = []*models.DesiredLRP{}

		for i := 0; i < count; i++ {
			guid := fmt.Sprintf("guid-%d-for-%s", i, domain)
			desiredLRP := model_helpers.NewValidDesiredLRP(guid)
			desiredLRP.Domain = domain
			err := client.DesireLRP(logger, desiredLRP)
			Expect(err).NotTo(HaveOccurred())

			createdDesiredLRPs[domain] = append(createdDesiredLRPs[domain], desiredLRP)
		}
	}

	return createdDesiredLRPs
}
var (
	bbsAddress    string
	bbsClientCert string
	bbsClientKey  string

	etcdFlags *ETCDFlags

	dataDogAPIKey string
	dataDogAppKey string

	awsAccessKeyID     string
	awsSecretAccessKey string
	awsBucketName      string
	awsRegion          string

	desiredLRPs     int
	encryptionFlags *encryption.EncryptionFlags
	metricPrefix    string

	numTrials          int
	numReps            int
	numPopulateWorkers int
	percentWrites      float64

	expectedLRPCount     int
	expectedLRPVariation float64

	expectedActualLRPCounts     map[string]int
	expectedActualLRPVariations map[string]float64

	errorTolerance float64

	logLevel    string
	logFilename string

	databaseConnectionString string
	databaseDriver           string

	logger               lager.Logger
	etcdClient           *etcd.Client
	etcdDB               *etcddb.ETCDDB
	sqlDB                *sqldb.SQLDB
	activeDB             db.DB
	bbsClient            bbs.InternalClient
	bbsClientHTTPTimeout time.Duration
	dataDogClient        *datadog.Client
	dataDogReporter      reporter.DataDogReporter
	reporters            []Reporter
)
Example #4
0
	"code.cloudfoundry.org/bbs"
	"code.cloudfoundry.org/bbs/cmd/bbs/testrunner"
	"code.cloudfoundry.org/bbs/models/test/model_helpers"
	"code.cloudfoundry.org/cfhttp"
	"github.com/tedsuo/ifrit"
	"github.com/tedsuo/ifrit/ginkgomon"

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

var _ = Describe("Secure", func() {
	var (
		client bbs.InternalClient
		err    error

		basePath string
	)

	BeforeEach(func() {
		basePath = path.Join(os.Getenv("GOPATH"), "src/code.cloudfoundry.org/bbs/cmd/bbs/fixtures")
		bbsURL.Scheme = "https"
	})

	Context("when configuring the BBS server for mutual SSL", func() {
		JustBeforeEach(func() {
			client = bbs.NewClient(bbsURL.String())
			bbsRunner = testrunner.New(bbsBinPath, bbsArgs)
			bbsProcess = ginkgomon.Invoke(bbsRunner)
		})
Example #5
0
import (
	"os"
	"path"

	"code.cloudfoundry.org/bbs"
	"code.cloudfoundry.org/bbs/cmd/bbs/testrunner"
	"github.com/tedsuo/ifrit/ginkgomon"

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

var _ = Describe("Secure", func() {
	var (
		client bbs.InternalClient
		err    error

		basePath string
	)

	BeforeEach(func() {
		basePath = path.Join(os.Getenv("GOPATH"), "src/code.cloudfoundry.org/bbs/cmd/bbs/fixtures")
		bbsURL.Scheme = "https"
	})

	JustBeforeEach(func() {
		client = bbs.NewClient(bbsURL.String())
		bbsRunner = testrunner.New(bbsBinPath, bbsArgs)
		bbsProcess = ginkgomon.Invoke(bbsRunner)
	})

	Context("when configuring mutual SSL", func() {