Limit the undo on failures to only stop or scale down

Refactor undo
Make sure we are going to delete the same blob that was requested
some time in the past.

Compare the cache headers so we can detect if the blob is still the same
since the key may be reused across blob entries.
Stop double encoding recent_errors

The recent_errors hash is double-encoded to json in /varz which makes it
difficult to read for humans and requires double-decoding in code.  This
commit stops encoding the error hash to json before adding it to the varz
hash.
Do not allow private domains that overlap with shared domains
Organization summary respects visibility permissions
Remove unused creation_req and update_req code from controller specs

Signed-off-by: Joseph Palermo <jpalermo@pivotallabs.com>
User visibility for app security groups

[#72119904]

Signed-off-by: Joseph Palermo <jpalermo@pivotallabs.com>
Avoid pollution between examples by using separate models

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Use conventional class syntax

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Spec was subtly reliant on test-pollution

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Avoid accidentally relying on test pollution

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Always use truncation instead of recreating tables

truncation is usually faster

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Extract non-bootstrap code from SpecEnvironment

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Make fixture path a global constant

Since it never changes and always has the same value

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Delete unused code

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Replace global mixin GlobalHelper

- Extract its parts into TestZip and TestConfig
- Explicit receivers make it much easier to find method usage and definition

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Avoid more widely-scoped mixins

- Also organize files in spec/support since there are getting to be quite a few things in here
- We are trying to avoid mixins in favor of explicit receivers to make usage more transparent

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Seed data consistently

- App seeds quota definitions, stacks, domains & organizations
- SpecEnvironment used to only seed quota definitions
- DatabaseIsolation::TruncateTables would seed quota defs and stacks
- Now all 3 places uses Seeds.write_seed_data
- Particular domains and orgs depend on the config used

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Added service discovery for tps.

- listens for announce messages over NATS
- maintains a cache of tps servers

Signed-off-by: Zach Robinson <zrobinson@pivotallabs.com>
improve loggin

Signed-off-by: Zach Robinson <zrobinson@pivotallabs.com>