Skip to content

Commit

Permalink
less port reconfiguration and unit restart in bbtest (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
jancajthaml authored Apr 22, 2019
1 parent 4eb523b commit f5f4c42
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
36 changes: 17 additions & 19 deletions bbtest/features/api.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,68 @@ Feature: REST

Scenario: Tenant API
Given vault is running
And vault is restarted

When I request curl GET https://127.0.0.1/tenant
When I request curl GET https://127.0.0.1:4400/tenant
Then curl responds with 200
"""
[]
"""

When I request curl POST https://127.0.0.1/tenant/APITESTA
When I request curl POST https://127.0.0.1:4400/tenant/APITESTA
Then curl responds with 200
"""
{}
"""

When I request curl POST https://127.0.0.1/tenant/APITESTB
When I request curl POST https://127.0.0.1:4400/tenant/APITESTB
Then curl responds with 200
"""
{}
"""

When I request curl GET https://127.0.0.1/tenant
When I request curl GET https://127.0.0.1:4400/tenant
Then curl responds with 200
"""
[
"APITESTB"
]
"""

When I request curl POST https://127.0.0.1/tenant/APITESTC
When I request curl POST https://127.0.0.1:4400/tenant/APITESTC
Then curl responds with 200
"""
{}
"""

When I request curl DELETE https://127.0.0.1/tenant/APITESTC
When I request curl DELETE https://127.0.0.1:4400/tenant/APITESTC
Then curl responds with 200
"""
{}
"""

Scenario: Account API
Given tenant API is onbdoarded
Given vault is running
And vault is restarted
Given tenant API is onbdoarded

When I request curl GET https://127.0.0.1/account/API
When I request curl GET https://127.0.0.1:4400/account/API
Then curl responds with 200
"""
[]
"""

When I request curl GET https://127.0.0.1/account/API/xxx
When I request curl GET https://127.0.0.1:4400/account/API/xxx
Then curl responds with 404
"""
{}
"""

When I request curl GET https://127.0.0.1/account/nothing/xxx
When I request curl GET https://127.0.0.1:4400/account/nothing/xxx
Then curl responds with 504
"""
{}
"""

When I request curl POST https://127.0.0.1/account/API
When I request curl POST https://127.0.0.1:4400/account/API
"""
{
"name": "A",
Expand All @@ -78,7 +76,7 @@ Feature: REST
{}
"""

When I request curl POST https://127.0.0.1/account/API
When I request curl POST https://127.0.0.1:4400/account/API
"""
{
"name": "yyy",
Expand All @@ -91,7 +89,7 @@ Feature: REST
{}
"""

When I request curl POST https://127.0.0.1/account/API
When I request curl POST https://127.0.0.1:4400/account/API
"""
{
"name": "yyy",
Expand All @@ -104,7 +102,7 @@ Feature: REST
{}
"""

When I request curl POST https://127.0.0.1/account/API
When I request curl POST https://127.0.0.1:4400/account/API
"""
{
"name": "B",
Expand All @@ -114,7 +112,7 @@ Feature: REST
"""
Then curl responds with 200

When I request curl GET https://127.0.0.1/account/API
When I request curl GET https://127.0.0.1:4400/account/API
Then curl responds with 200
"""
[
Expand All @@ -123,7 +121,7 @@ Feature: REST
]
"""

When I request curl POST https://127.0.0.1/account/API
When I request curl POST https://127.0.0.1:4400/account/API
"""
{
"name": "xxx",
Expand All @@ -133,7 +131,7 @@ Feature: REST
"""
Then curl responds with 200

When I request curl GET https://127.0.0.1/account/API/xxx
When I request curl GET https://127.0.0.1:4400/account/API/xxx
Then curl responds with 200
"""
{
Expand Down
1 change: 0 additions & 1 deletion bbtest/features/management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Feature: Properly behaving units
Scenario: offboard
Given tenant lorem is offboarded
And tenant ipsum is offboarded

Then systemctl does not contains following
"""
vault-unit@lorem.service
Expand Down
8 changes: 4 additions & 4 deletions bbtest/steps/account_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
isBalanceCheck: (snapshot[:activity] || false)
}.to_json

uri = "https://127.0.0.1/account/#{tenant}/#{account}"
uri = "https://127.0.0.1:4400/account/#{tenant}/#{account}"

send "I request curl :http_method :url", "GET", uri
send "curl responds with :http_status", 200, expected_response
Expand All @@ -37,7 +37,7 @@
isBalanceCheck: activity
}.to_json

uri = "https://127.0.0.1/account/#{tenant}"
uri = "https://127.0.0.1:4400/account/#{tenant}"

send "I request curl :http_method :url", "POST", uri, payload
send "curl responds with :http_status", 200
Expand All @@ -54,7 +54,7 @@
@accounts ||= {}
(tenant, account) = account.split('/')

uri = "https://127.0.0.1/account/#{tenant}/#{account}"
uri = "https://127.0.0.1:4400/account/#{tenant}/#{account}"

send "I request curl :http_method :url", "GET", uri
send "curl responds with :http_status", 200
Expand All @@ -65,7 +65,7 @@
(tenant, account) = account.split('/')
expect(@accounts).not_to have_key(account)

uri = "https://127.0.0.1/account/#{tenant}/#{account}"
uri = "https://127.0.0.1:4400/account/#{tenant}/#{account}"

send "I request curl :http_method :url", "GET", uri
send "curl responds with :http_status", [404, 504]
Expand Down
4 changes: 2 additions & 2 deletions bbtest/steps/orchestration_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"VAULT_METRICS_OUTPUT=/reports/metrics.json",
"VAULT_LAKE_HOSTNAME=127.0.0.1",
"VAULT_METRICS_REFRESHRATE=1h",
"VAULT_HTTP_PORT=443",
"VAULT_HTTP_PORT=4400",
"VAULT_SECRETS=/opt/vault/secrets",
].join("\n").inspect.delete('\"')

Expand All @@ -106,7 +106,7 @@
"METRICS_REFRESHRATE" => "1h",
"METRICS_OUTPUT" => "/reports/metrics.json",
"LAKE_HOSTNAME" => "127.0.0.1",
"HTTP_PORT" => "443",
"HTTP_PORT" => "4400",
"SECRETS" => "/opt/vault/secrets",
}

Expand Down

0 comments on commit f5f4c42

Please sign in to comment.