From 41566fe72fbe30945511fd2e85f44551cb112451 Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Fri, 2 Jun 2017 17:52:22 +0100 Subject: [PATCH 01/34] changed definition syntax to match docker-compose schema --- definition.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/definition.yml b/definition.yml index 0161f51..a799703 100644 --- a/definition.yml +++ b/definition.yml @@ -19,7 +19,7 @@ repos: - nats ports: - 8080:8080 - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -33,7 +33,7 @@ repos: - nats ports: - 22000:22000 - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -45,7 +45,7 @@ repos: branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -56,7 +56,7 @@ repos: branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -67,7 +67,7 @@ repos: branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -78,7 +78,7 @@ repos: branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -90,7 +90,7 @@ repos: branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -102,7 +102,7 @@ repos: links: - nats - postgres - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -114,7 +114,7 @@ repos: links: - nats - postgres - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -125,7 +125,7 @@ repos: branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -137,7 +137,7 @@ repos: branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -148,7 +148,7 @@ repos: branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -159,7 +159,7 @@ repos: branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -173,7 +173,7 @@ repos: - nats ports: - 22001:22001 - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' From bc7cb4c1a4e082d86cf31aff425f0138d2a2f744 Mon Sep 17 00:00:00 2001 From: Mark Newman Date: Fri, 14 Jul 2017 12:07:34 +0100 Subject: [PATCH 02/34] Add tests for CLI info version --- internal/features/cli/info.feature | 20 +++++++++++++------- internal/features/steps/step_definitions.go | 14 ++++++++++++++ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/internal/features/cli/info.feature b/internal/features/cli/info.feature index da7d298..3d0a39e 100644 --- a/internal/features/cli/info.feature +++ b/internal/features/cli/info.feature @@ -1,13 +1,19 @@ @info Feature: Ernest info - Scenario: A user gets info about current ernest instance + Scenario: An authenticated user gets info about the ernest instance Given I setup ernest with target "http://ernest.local" And I'm logged in as "usr" / "secret123" When I run ernest with "info" - Then The output should contain regex "http://ernest.local|http(s?)://127.0.0.1" - And The output should contain "Current user : usr" - When I logout - And I run ernest with "info" - Then The output should contain regex "http://ernest.local|http(s?)://127.0.0.1" - And The output should not contain "Current user : usr" + Then The output should contain regex "Target: http://ernest.local|http(s?)://127.0.0.1" + And The output should contain "User: usr" + And The output should contain regex "Version: \d*\.\d*\.\d*" + + Scenario: An unauthenticated user gets info about the ernest instance + Given I setup ernest with target "http://ernest.local" +# And I'm logged in as "usr" / "secret123" + And I logout + When I run ernest with "info" + Then The output should contain regex "Target: http://ernest.local|http(s?)://127.0.0.1" + And The output should not contain "User: usr" + And The output should contain regex "Version: \d*\.\d*\.\d*" diff --git a/internal/features/steps/step_definitions.go b/internal/features/steps/step_definitions.go index 1eb6054..bbbc43b 100644 --- a/internal/features/steps/step_definitions.go +++ b/internal/features/steps/step_definitions.go @@ -94,6 +94,13 @@ func init() { } }) + And(`^The output should contain regex "(.*)"$`, func(needle string) { + r := regexp.MustCompile(needle) + if r.MatchString(lastOutput) == false { + T.Errorf(`Last output string does not contain regex "` + needle + `": ` + "\n" + lastOutput) + } + }) + Then(`^The output should not contain regex "(.*)"$`, func(needle string) { r := regexp.MustCompile(needle) if r.MatchString(lastOutput) == true { @@ -101,6 +108,13 @@ func init() { } }) + And(`^The output should not contain regex "(.*)"$`, func(needle string) { + r := regexp.MustCompile(needle) + if r.MatchString(lastOutput) == true { + T.Errorf(`Last output string does contain regex "` + needle + `" but it shouldn't: ` + "\n" + lastOutput) + } + }) + When(`^I logout$`, func() { ernest("logout") }) From 6d5a9bfe710d1101a3dce1fd3d5f61cd3cdbc546 Mon Sep 17 00:00:00 2001 From: Mark Newman Date: Mon, 24 Jul 2017 13:54:12 +0100 Subject: [PATCH 03/34] Fix version output on info subcommand --- internal/features/cli/info.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/features/cli/info.feature b/internal/features/cli/info.feature index 3d0a39e..47c3d17 100644 --- a/internal/features/cli/info.feature +++ b/internal/features/cli/info.feature @@ -7,7 +7,7 @@ Feature: Ernest info When I run ernest with "info" Then The output should contain regex "Target: http://ernest.local|http(s?)://127.0.0.1" And The output should contain "User: usr" - And The output should contain regex "Version: \d*\.\d*\.\d*" + And The output should contain regex "CLI Version: \d*\.\d*\.\d*" Scenario: An unauthenticated user gets info about the ernest instance Given I setup ernest with target "http://ernest.local" @@ -16,4 +16,4 @@ Feature: Ernest info When I run ernest with "info" Then The output should contain regex "Target: http://ernest.local|http(s?)://127.0.0.1" And The output should not contain "User: usr" - And The output should contain regex "Version: \d*\.\d*\.\d*" + And The output should contain regex "CLI Version: \d*\.\d*\.\d*" From 997bee9a56c179c23bfe2953109cf87078b15fbe Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Wed, 16 Aug 2017 15:41:19 +0100 Subject: [PATCH 04/34] correcting service reset steps --- internal/features/steps/step_definitions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/features/steps/step_definitions.go b/internal/features/steps/step_definitions.go index bbbc43b..dcf9d78 100644 --- a/internal/features/steps/step_definitions.go +++ b/internal/features/steps/step_definitions.go @@ -209,7 +209,7 @@ func init() { }) And(`^I force "(.+?)" to be on status "(.+?)"$`, func(service string, status string) { - _, _ = n.Request("service.set", []byte(`{"name":"`+service+`","status":"`+status+`"}`), time.Second*3) + _, _ = n.Request("build.set.status", []byte(`{"name":"`+service+`","status":"`+status+`"}`), time.Second*3) }) And(`^File "(.+?)" exists$`, func(filename string) { From f6aff6810c9da58019c5f5585276dd2baff02dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Thu, 27 Jul 2017 11:24:20 +0200 Subject: [PATCH 05/34] Introducing authorization --- definition.yml | 11 +++++++++++ internal/features/cli/roles.feature | 28 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 internal/features/cli/roles.feature diff --git a/definition.yml b/definition.yml index 26f4fad..658cca7 100644 --- a/definition.yml +++ b/definition.yml @@ -84,6 +84,16 @@ repos: NATS_URI: 'nats://nats:4222' ERNEST_CRYPTO_KEY: CRYPTO_KEY_TEMPLATE + - name: authorization-store + path: git@github.com:ernestio/authorization-store.git + branch: master + links: + - nats + depends: + - config-store + environment: + NATS_URI: 'nats://nats:4222' + ERNEST_CRYPTO_KEY: CRYPTO_KEY_TEMPLATE - name: usage-store path: git@github.com:ernestio/usage-store.git @@ -184,3 +194,4 @@ repos: volumes: - ./logs/:/var/logs/ - ./config/:/etc/ernest/ + diff --git a/internal/features/cli/roles.feature b/internal/features/cli/roles.feature new file mode 100644 index 0000000..531de3f --- /dev/null +++ b/internal/features/cli/roles.feature @@ -0,0 +1,28 @@ +@roles +Feature: Ernest role management + + Scenario: Non logged role creation + Given I setup ernest with target "https://ernest.local" + And I logout + When I run ernest with "role set" + Then The output should contain "You should provide role parameters, please run --help for help" + When I run ernest with "role set --role owner" + Then The output should contain "You should provide role parameters, please run --help for help" + When I run ernest with "role set --role owner --user roler" + Then The output should contain "You should specify at least a project name with (--project)" + When I run ernest with "role set --role owner --user roler --project test_project" + Then The output should contain "You're not allowed to perform this action, please log in" + When I run ernest with "role set --role owner --user roler --project test_project --environment test_environment" + Then The output should contain "You're not allowed to perform this action, please log in" + + Scenario: Plain user role creation + Given I setup ernest with target "https://ernest.local" + And I'm logged in as "usr" / "secret123" + And I run ernest with "project create tmp_project --type aws" + When I run ernest with "role set --role reader --user roler --project tmp_project" + Then The output should contain "User 'roler' has been authorized to read project tmp_projecte" + When I'm logged in as "roler" / "secret123" + And I run ernest with "project info tmp_project" + Then The output should contain "usr" + And The output should contain "roler" + From 75a8d673c1c7762f5280373284efa6effa6bacd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Thu, 27 Jul 2017 15:30:01 +0200 Subject: [PATCH 06/34] Datacenter and service renaming --- internal/ci_setup.sh | 8 +- ...ter_aws_1.yml => update_project_aws_1.yml} | 2 +- ...ter_aws_2.yml => update_project_aws_2.yml} | 2 +- .../aws/add_and_attach_network.feature | 4 +- .../aws/add_egress_security_group.feature | 4 +- internal/features/aws/add_elb_and_s3.feature | 4 +- .../aws/add_ingress_security_group.feature | 4 +- .../aws/add_nat_and_attach_a_network.feature | 4 +- internal/features/aws/add_network.feature | 4 +- .../features/aws/add_rds_clusters.feature | 4 +- .../features/aws/add_rds_instances.feature | 4 +- .../append_instance_security_group.feature | 4 +- internal/features/aws/base.feature | 6 +- .../features/aws/datacenter_update.feature | 16 ++-- .../aws/decrease_instances_count.feature | 4 +- .../features/aws/delete_rds_clusters.feature | 4 +- .../features/aws/delete_rds_instances.feature | 4 +- .../aws/increment_instances_count.feature | 4 +- .../aws/remove_and_dettach_network.feature | 4 +- .../features/aws/remove_elb_and_s3.feature | 4 +- internal/features/aws/remove_network.feature | 4 +- .../aws/remove_security_groups.feature | 4 +- .../features/aws/update_elb_and_s3.feature | 4 +- .../features/aws/update_rds_clusters.feature | 4 +- .../features/aws/update_rds_instances.feature | 4 +- internal/features/azure/base.feature | 6 +- internal/features/azure/creator.feature | 4 +- internal/features/cli/datacenter.feature | 12 +-- .../cli/datacenter_create_aws.feature | 40 +++++----- .../cli/datacenter_create_azure.feature | 46 +++++------ .../cli/datacenter_create_vcloud.feature | 40 +++++----- .../features/cli/datacenter_delete.feature | 52 ++++++------- internal/features/cli/datacenter_list.feature | 16 ++-- .../cli/datacenter_update_aws.feature | 32 ++++---- .../cli/datacenter_update_azure.feature | 32 ++++---- .../cli/datacenter_update_vcloud.feature | 30 ++++---- .../cli/datacenters_to_groups.feature | 76 ------------------- .../features/cli/datacenters_to_groups.old | 76 +++++++++++++++++++ internal/features/cli/dry.feature | 4 +- internal/features/cli/group.feature | 27 ------- internal/features/cli/group_create.feature | 37 --------- internal/features/cli/group_delete.feature | 35 --------- internal/features/cli/group_list.feature | 24 ------ internal/features/cli/logout.feature | 2 +- internal/features/cli/service.feature | 12 +-- internal/features/cli/service_apply.feature | 24 +++--- .../features/cli/service_definition.feature | 18 ++--- internal/features/cli/service_destroy.feature | 32 ++++---- internal/features/cli/service_history.feature | 26 +++---- internal/features/cli/service_import.feature | 26 +++---- internal/features/cli/service_info.feature | 10 +-- internal/features/cli/service_list.feature | 10 +-- internal/features/cli/service_reset.feature | 24 +++--- internal/features/cli/service_revert.feature | 24 +++--- internal/features/cli/usage_report.feature | 4 +- internal/features/cli/users_to_groups.feature | 76 ------------------- internal/features/steps/step_definitions.go | 44 +++++------ .../vcloud/add_and_attach_network.feature | 4 +- internal/features/vcloud/base.feature | 6 +- .../vcloud/decrease_instances_count.feature | 4 +- .../vcloud/increase_instances_count.feature | 4 +- .../features/vcloud/instance_only.feature | 6 +- .../vcloud/remove_and_dettach_network.feature | 4 +- .../vcloud/update_firewall_rules.feature | 4 +- .../vcloud/update_instances_resource.feature | 4 +- .../features/vcloud/update_nat_rules.feature | 4 +- template.yml | 2 +- 67 files changed, 438 insertions(+), 639 deletions(-) rename internal/definitions/{update_datacenter_aws_1.yml => update_project_aws_1.yml} (95%) rename internal/definitions/{update_datacenter_aws_2.yml => update_project_aws_2.yml} (95%) delete mode 100644 internal/features/cli/datacenters_to_groups.feature create mode 100644 internal/features/cli/datacenters_to_groups.old delete mode 100644 internal/features/cli/group.feature delete mode 100644 internal/features/cli/group_create.feature delete mode 100644 internal/features/cli/group_delete.feature delete mode 100644 internal/features/cli/group_list.feature delete mode 100644 internal/features/cli/users_to_groups.feature diff --git a/internal/ci_setup.sh b/internal/ci_setup.sh index 8f0620d..a722dc0 100755 --- a/internal/ci_setup.sh +++ b/internal/ci_setup.sh @@ -3,9 +3,7 @@ $GOBIN/natsc request -s $NATS_URI -t 5 -r 99 'user.set' '{"group_id": 1, "userna ernest-cli target $CURRENT_INSTANCE ernest-cli login --user ci_admin --password secret123 ernest-cli user create usr secret123 -ernest-cli group create test -ernest-cli group add-user usr test ernest-cli login --user usr --password secret123 -ernest-cli datacenter create aws fakeaws --region fake --secret_access_key fake_up_to_16_characters --access_key_id up_to_16_characters_secret --fake -ernest-cli datacenter create vcloud fakevcloud -org test -user fakeuser -password test123 -public-network test-nw -vcloud-url https://vcloud.net --fake -ernest-cli datacenter create azure --subscription_id subid --client_id cliid --client_secret clisec --region westus --tenant_id tenid --environment public --fake fakeazure +ernest-cli project create aws fakeaws --region fake --secret_access_key fake_up_to_16_characters --access_key_id up_to_16_characters_secret --fake +ernest-cli project create vcloud fakevcloud -org test -user fakeuser -password test123 -public-network test-nw -vcloud-url https://vcloud.net --fake +ernest-cli project create azure --subscription_id subid --client_id cliid --client_secret clisec --region westus --tenant_id tenid --environment public --fake fakeazure diff --git a/internal/definitions/update_datacenter_aws_1.yml b/internal/definitions/update_project_aws_1.yml similarity index 95% rename from internal/definitions/update_datacenter_aws_1.yml rename to internal/definitions/update_project_aws_1.yml index 5764e1e..1b04e14 100644 --- a/internal/definitions/update_datacenter_aws_1.yml +++ b/internal/definitions/update_project_aws_1.yml @@ -1,7 +1,7 @@ # Basic aws example --- name: aws_test_update_dc -datacenter: update_datacenter +datacenter: update_project vpcs: - name: test-vpc diff --git a/internal/definitions/update_datacenter_aws_2.yml b/internal/definitions/update_project_aws_2.yml similarity index 95% rename from internal/definitions/update_datacenter_aws_2.yml rename to internal/definitions/update_project_aws_2.yml index dbb3912..8ae6b06 100644 --- a/internal/definitions/update_datacenter_aws_2.yml +++ b/internal/definitions/update_project_aws_2.yml @@ -1,7 +1,7 @@ # Basic aws example --- name: aws_test_update_dc -datacenter: update_datacenter +datacenter: update_project vpcs: - name: test-vpc diff --git a/internal/features/aws/add_and_attach_network.feature b/internal/features/aws/add_and_attach_network.feature index 421a816..07c165a 100644 --- a/internal/features/aws/add_and_attach_network.feature +++ b/internal/features/aws/add_and_attach_network.feature @@ -1,9 +1,9 @@ @aws @add_and_attach_network -Feature: Service apply +Feature: Environment apply Scenario: Add a network and attach a new instance Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws9.yml" And I start recording diff --git a/internal/features/aws/add_egress_security_group.feature b/internal/features/aws/add_egress_security_group.feature index 69745cb..fdc824d 100644 --- a/internal/features/aws/add_egress_security_group.feature +++ b/internal/features/aws/add_egress_security_group.feature @@ -1,9 +1,9 @@ @aws @add_egress_security_group -Feature: Service apply +Feature: Environment apply Scenario: Add engress security group to a instance Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws5.yml" And I start recording diff --git a/internal/features/aws/add_elb_and_s3.feature b/internal/features/aws/add_elb_and_s3.feature index 6f0d643..8a5478d 100644 --- a/internal/features/aws/add_elb_and_s3.feature +++ b/internal/features/aws/add_elb_and_s3.feature @@ -1,9 +1,9 @@ @aws @add_elb_and_s3 -Feature: Service apply +Feature: Environment apply Scenario: Add an elb and an s3 Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws12.yml" And I start recording diff --git a/internal/features/aws/add_ingress_security_group.feature b/internal/features/aws/add_ingress_security_group.feature index 6f77393..0c51332 100644 --- a/internal/features/aws/add_ingress_security_group.feature +++ b/internal/features/aws/add_ingress_security_group.feature @@ -1,9 +1,9 @@ @aws @add_ingress_security_group -Feature: Service apply +Feature: Environment apply Scenario: Add an ingress security group to an instance Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws4.yml" And I start recording diff --git a/internal/features/aws/add_nat_and_attach_a_network.feature b/internal/features/aws/add_nat_and_attach_a_network.feature index aba287b..63cb39c 100644 --- a/internal/features/aws/add_nat_and_attach_a_network.feature +++ b/internal/features/aws/add_nat_and_attach_a_network.feature @@ -1,9 +1,9 @@ @aws @add_nat_and_attach_a_network -Feature: Service apply +Feature: Environment apply Scenario: Add a nat gateway and attach a private network to it Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws11.yml" And I start recording diff --git a/internal/features/aws/add_network.feature b/internal/features/aws/add_network.feature index 82b8661..2b74347 100644 --- a/internal/features/aws/add_network.feature +++ b/internal/features/aws/add_network.feature @@ -1,9 +1,9 @@ @aws @add_network -Feature: Service apply +Feature: Environment apply Scenario: Add a new network Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws7.yml" And I start recording diff --git a/internal/features/aws/add_rds_clusters.feature b/internal/features/aws/add_rds_clusters.feature index c7bd8a6..650044a 100644 --- a/internal/features/aws/add_rds_clusters.feature +++ b/internal/features/aws/add_rds_clusters.feature @@ -1,9 +1,9 @@ @aws @add_rds_clusters -Feature: Service apply +Feature: Environment apply Scenario: Adding rds clusters Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws15.yml" And I start recording diff --git a/internal/features/aws/add_rds_instances.feature b/internal/features/aws/add_rds_instances.feature index c514a5c..6b6e815 100644 --- a/internal/features/aws/add_rds_instances.feature +++ b/internal/features/aws/add_rds_instances.feature @@ -1,9 +1,9 @@ @aws @add_rds_instances -Feature: Service apply +Feature: Environment apply Scenario: Adding rds instances Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws17.yml" And I start recording diff --git a/internal/features/aws/append_instance_security_group.feature b/internal/features/aws/append_instance_security_group.feature index 214a268..2467b0f 100644 --- a/internal/features/aws/append_instance_security_group.feature +++ b/internal/features/aws/append_instance_security_group.feature @@ -1,9 +1,9 @@ @aws @append_instance_security_group -Feature: Service apply +Feature: Environment apply Scenario: Append security group to an instance Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws3.yml" And I start recording diff --git a/internal/features/aws/base.feature b/internal/features/aws/base.feature index 95cd73d..33ac411 100644 --- a/internal/features/aws/base.feature +++ b/internal/features/aws/base.feature @@ -1,9 +1,9 @@ @aws @aws_base -Feature: Service apply +Feature: Environment apply - Scenario: Applying a basic service + Scenario: Applying a basic environment Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I start recording And I apply the definition "aws1.yml" diff --git a/internal/features/aws/datacenter_update.feature b/internal/features/aws/datacenter_update.feature index 526be9c..e377a58 100644 --- a/internal/features/aws/datacenter_update.feature +++ b/internal/features/aws/datacenter_update.feature @@ -1,20 +1,20 @@ -@datacenter @datacenter_update -Feature: Update service with changed datacenter credentials +@project @project_update +Feature: Update environment with changed project credentials Scenario: Non logged user listing Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The datacenter "update_datacenter" does not exist - And The service "aws_test_update_dc" does not exist - And I run ernest with "datacenter create aws --secret_access_key tmp_secret_access_key --access_key_id tmp_secret_up_to_16_chars --region tmp_region --fake update_datacenter" + And The project "update_project" does not exist + And The environment "aws_test_update_dc" does not exist + And I run ernest with "project create aws --secret_access_key tmp_secret_access_key --access_key_id tmp_secret_up_to_16_chars --region tmp_region --fake update_project" And I start recording - And I run ernest with "service apply internal/definitions/update_datacenter_aws_1.yml" + And I run ernest with "environment apply internal/definitions/update_project_aws_1.yml" And I stop recording And all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "tmp_secret_access_key" - And I run ernest with "datacenter update aws --secret_access_key tmp_secret_access_key_2 --access_key_id tmp_secret_up_to_16_chars_2 update_datacenter" + And I run ernest with "project update aws --secret_access_key tmp_secret_access_key_2 --access_key_id tmp_secret_up_to_16_chars_2 update_project" And I start recording - When I run ernest with "service apply internal/definitions/update_datacenter_aws_2.yml" + When I run ernest with "environment apply internal/definitions/update_project_aws_2.yml" And I stop recording Then all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars_2" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "tmp_secret_access_key_2" diff --git a/internal/features/aws/decrease_instances_count.feature b/internal/features/aws/decrease_instances_count.feature index e21e605..e3c30af 100644 --- a/internal/features/aws/decrease_instances_count.feature +++ b/internal/features/aws/decrease_instances_count.feature @@ -1,9 +1,9 @@ @aws @aws_decrease_instances_count -Feature: Service apply +Feature: Environment apply Scenario: Decreasing the instances count Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws2.yml" And I start recording diff --git a/internal/features/aws/delete_rds_clusters.feature b/internal/features/aws/delete_rds_clusters.feature index fb9a2c6..3a67494 100644 --- a/internal/features/aws/delete_rds_clusters.feature +++ b/internal/features/aws/delete_rds_clusters.feature @@ -1,9 +1,9 @@ @aws @delete_rds_clusters -Feature: Service apply +Feature: Environment apply Scenario: Updating rds clusters Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws20.yml" And I start recording diff --git a/internal/features/aws/delete_rds_instances.feature b/internal/features/aws/delete_rds_instances.feature index c7372bf..ebee527 100644 --- a/internal/features/aws/delete_rds_instances.feature +++ b/internal/features/aws/delete_rds_instances.feature @@ -1,9 +1,9 @@ @aws @delete_rds_instances -Feature: Service apply +Feature: Environment apply Scenario: Updating rds instances Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws19.yml" And I start recording diff --git a/internal/features/aws/increment_instances_count.feature b/internal/features/aws/increment_instances_count.feature index 1dddc36..af30a82 100644 --- a/internal/features/aws/increment_instances_count.feature +++ b/internal/features/aws/increment_instances_count.feature @@ -1,9 +1,9 @@ @aws @aws_increment_instances_count -Feature: Service apply +Feature: Environment apply Scenario: Incrementing instances count Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws1.yml" And I start recording diff --git a/internal/features/aws/remove_and_dettach_network.feature b/internal/features/aws/remove_and_dettach_network.feature index 9f78fcd..b1954fa 100644 --- a/internal/features/aws/remove_and_dettach_network.feature +++ b/internal/features/aws/remove_and_dettach_network.feature @@ -1,9 +1,9 @@ @aws @remove_and_dettach_network -Feature: Service apply +Feature: Environment apply Scenario: Removing a network and its asociated instances Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws10.yml" And I start recording diff --git a/internal/features/aws/remove_elb_and_s3.feature b/internal/features/aws/remove_elb_and_s3.feature index 41ad75b..5bc9af2 100644 --- a/internal/features/aws/remove_elb_and_s3.feature +++ b/internal/features/aws/remove_elb_and_s3.feature @@ -1,9 +1,9 @@ @aws @delete_elb_and_s3 -Feature: Service apply +Feature: Environment apply Scenario: delete an elb and an s3 Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws14.yml" And I start recording diff --git a/internal/features/aws/remove_network.feature b/internal/features/aws/remove_network.feature index 0da58d2..0d1034d 100644 --- a/internal/features/aws/remove_network.feature +++ b/internal/features/aws/remove_network.feature @@ -1,9 +1,9 @@ @aws @remove_network -Feature: Service apply +Feature: Environment apply Scenario: Remove a network Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws8.yml" And I start recording diff --git a/internal/features/aws/remove_security_groups.feature b/internal/features/aws/remove_security_groups.feature index d6e8ec6..6ac7b55 100644 --- a/internal/features/aws/remove_security_groups.feature +++ b/internal/features/aws/remove_security_groups.feature @@ -1,9 +1,9 @@ @aws @remove_security_groups -Feature: Service apply +Feature: Environment apply Scenario: Remove security groups Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws6.yml" And I start recording diff --git a/internal/features/aws/update_elb_and_s3.feature b/internal/features/aws/update_elb_and_s3.feature index cb80b86..5db1ebf 100644 --- a/internal/features/aws/update_elb_and_s3.feature +++ b/internal/features/aws/update_elb_and_s3.feature @@ -1,9 +1,9 @@ @aws @update_elb_and_s3 -Feature: Service apply +Feature: Environment apply Scenario: Update an elb and an s3 Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws13.yml" And I start recording diff --git a/internal/features/aws/update_rds_clusters.feature b/internal/features/aws/update_rds_clusters.feature index d69ea62..f15fe79 100644 --- a/internal/features/aws/update_rds_clusters.feature +++ b/internal/features/aws/update_rds_clusters.feature @@ -1,9 +1,9 @@ @aws @update_rds_clusters -Feature: Service apply +Feature: Environment apply Scenario: Updating rds clusters Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws16.yml" And I start recording diff --git a/internal/features/aws/update_rds_instances.feature b/internal/features/aws/update_rds_instances.feature index 8ef2763..1808cd5 100644 --- a/internal/features/aws/update_rds_instances.feature +++ b/internal/features/aws/update_rds_instances.feature @@ -1,9 +1,9 @@ @aws @update_rds_instances -Feature: Service apply +Feature: Environment apply Scenario: Updating rds instances Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "aws18.yml" And I start recording diff --git a/internal/features/azure/base.feature b/internal/features/azure/base.feature index 483ee32..324bd7e 100644 --- a/internal/features/azure/base.feature +++ b/internal/features/azure/base.feature @@ -1,9 +1,9 @@ @azure @azure_base -Feature: Applying an azure based service +Feature: Applying an azure based environment - Scenario: Applying a basic azure service + Scenario: Applying a basic azure environment Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "pwd" And I start recording And I apply the definition "azure1.yml" diff --git a/internal/features/azure/creator.feature b/internal/features/azure/creator.feature index b1c7fcc..c96cc26 100644 --- a/internal/features/azure/creator.feature +++ b/internal/features/azure/creator.feature @@ -1,9 +1,9 @@ @azure @azure_creator Feature: Creator - Scenario: Applying a basic azure service + Scenario: Applying a basic azure environment Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "pwd" And I start recording And I apply the definition "azure2.yml" diff --git a/internal/features/cli/datacenter.feature b/internal/features/cli/datacenter.feature index 78197d4..934f35e 100644 --- a/internal/features/cli/datacenter.feature +++ b/internal/features/cli/datacenter.feature @@ -1,17 +1,17 @@ -@datacenter -Feature: Ernest datacenter +@project +Feature: Ernest project - Scenario: running "datacenter" command as logged in user + Scenario: running "project" command as logged in user Given I setup ernest with target "https://ernest.local" When I'm logged in as "usr" / "secret123" - And I run ernest with "datacenter" + And I run ernest with "project" And The output should contain "list" And The output should contain "create" - Scenario: running "datacenter" command as non logged in user + Scenario: running "project" command as non logged in user Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "group" + When I run ernest with "project" And The output should contain "list" And The output should contain "create" diff --git a/internal/features/cli/datacenter_create_aws.feature b/internal/features/cli/datacenter_create_aws.feature index 1d4063b..8f573bb 100644 --- a/internal/features/cli/datacenter_create_aws.feature +++ b/internal/features/cli/datacenter_create_aws.feature @@ -1,36 +1,36 @@ -@datacenter @datacenter_create @datacenter_create_aws -Feature: Ernest datacenter create +@project @project_create @project_create_aws +Feature: Ernest project create - Scenario: Non logged aws datacenter creation + Scenario: Non logged aws project creation Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "datacenter create aws" - Then The output should contain "You should specify the datacenter name" - When I run ernest with "datacenter create aws tmp_datacenter" + When I run ernest with "project create aws" + Then The output should contain "You should specify the project name" + When I run ernest with "project create aws tmp_project" Then The output should contain "You're not allowed to perform this action, please log in" - Scenario: Logged user aws datacenter creation + Scenario: Logged user aws project creation Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - When I run ernest with "datacenter create aws" - Then The output should contain "You should specify the datacenter name" - When I run ernest with "datacenter create aws tmp_datacenter" + When I run ernest with "project create aws" + Then The output should contain "You should specify the project name" + When I run ernest with "project create aws tmp_project" Then The output should contain "Please, fix the error shown below to continue" And The output should contain "- Specify a valid secret access key with --secret_access_key flag" - When I run ernest with "datacenter create aws --secret_access_key tmp_secret_access_key --access_key_id tmp_secret_up_to_16_chars --region tmp_region tmp_datacenter" - Then The output should contain "Datacenter 'tmp_datacenter' successfully created" - When I run ernest with "datacenter list" - Then The output should contain "tmp_datacenter" + When I run ernest with "project create aws --secret_access_key tmp_secret_access_key --access_key_id tmp_secret_up_to_16_chars --region tmp_region tmp_project" + Then The output should contain "Project 'tmp_project' successfully created" + When I run ernest with "project list" + Then The output should contain "tmp_project" Then The output should contain "tmp_region" Then The output should contain "aws" - Scenario: Adding an already existing aws datacenter + Scenario: Adding an already existing aws project Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - When I run ernest with "datacenter create aws --secret_access_key tmp_secret_access_key --access_key_id tmp_secret_up_to_16_chars --region tmp_region tmp_datacenter" - And I run ernest with "datacenter create aws --secret_access_key tmp_secret_access_key --access_key_id tmp_secret_up_to_16_chars --region tmp_region tmp_datacenter" - Then The output should contain "Datacenter 'tmp_datacenter' already exists, please specify a different name" + When I run ernest with "project create aws --secret_access_key tmp_secret_access_key --access_key_id tmp_secret_up_to_16_chars --region tmp_region tmp_project" + And I run ernest with "project create aws --secret_access_key tmp_secret_access_key --access_key_id tmp_secret_up_to_16_chars --region tmp_region tmp_project" + Then The output should contain "Project 'tmp_project' already exists, please specify a different name" diff --git a/internal/features/cli/datacenter_create_azure.feature b/internal/features/cli/datacenter_create_azure.feature index f1ebb92..19e87e7 100644 --- a/internal/features/cli/datacenter_create_azure.feature +++ b/internal/features/cli/datacenter_create_azure.feature @@ -1,43 +1,43 @@ -@datacenter @datacenter_create @datacenter_create_azure -Feature: Ernest datacenter create +@project @project_create @project_create_azure +Feature: Ernest project create - Scenario: Non logged azure datacenter creation + Scenario: Non logged azure project creation Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "datacenter create azure" - Then The output should contain "You should specify the datacenter name" - When I run ernest with "datacenter create azure tmp_datacenter" + When I run ernest with "project create azure" + Then The output should contain "You should specify the project name" + When I run ernest with "project create azure tmp_project" Then The output should contain "You're not allowed to perform this action, please log in" - Scenario: Logged user azure datacenter creation + Scenario: Logged user azure project creation Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - When I run ernest with "datacenter create azure" - Then The output should contain "You should specify the datacenter name" - When I run ernest with "datacenter create azure tmp_datacenter" + When I run ernest with "project create azure" + Then The output should contain "You should specify the project name" + When I run ernest with "project create azure tmp_project" Then The output should contain "Please, fix the error shown below to continue" And The output should contain "- Specify a valid subscription id with --subscription_id flag" - When I run ernest with "datacenter create azure --subscription_id subid tmp_datacenter" + When I run ernest with "project create azure --subscription_id subid tmp_project" Then The output should contain "Please, fix the error shown below to continue" And The output should contain "- Specify a valid client id with --client_id flag" - When I run ernest with "datacenter create azure --subscription_id subid --client_id cliid tmp_datacenter" + When I run ernest with "project create azure --subscription_id subid --client_id cliid tmp_project" Then The output should contain "Please, fix the error shown below to continue" And The output should contain "- Specify a valid region with --region flag" - When I run ernest with "datacenter create azure --subscription_id subid --client_id cliid --region westus tmp_datacenter" + When I run ernest with "project create azure --subscription_id subid --client_id cliid --region westus tmp_project" Then The output should contain "Please, fix the error shown below to continue" And The output should contain "- Specify a valid tenant id with --tenant_id flag" - When I run ernest with "datacenter create azure --subscription_id subid --client_id cliid --region westus --tenant_id tenid tmp_datacenter" - Then The output should contain "Datacenter 'tmp_datacenter' successfully created" - When I run ernest with "datacenter list" - Then The output should contain "tmp_datacenter" + When I run ernest with "project create azure --subscription_id subid --client_id cliid --region westus --tenant_id tenid tmp_project" + Then The output should contain "Project 'tmp_project' successfully created" + When I run ernest with "project list" + Then The output should contain "tmp_project" Then The output should contain "tmp_region" Then The output should contain "azure" - Scenario: Adding an already existing azure datacenter + Scenario: Adding an already existing azure project Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - When I run ernest with "datacenter create azure --subscription_id subid --client_id cliid --region westus --tenant_id tenid tmp_datacenter" - And I run ernest with "datacenter create azure --subscription_id subid --client_id cliid --region westus --tenant_id tenid tmp_datacenter" - Then The output should contain "Datacenter 'tmp_datacenter' already exists, please specify a different name" + When I run ernest with "project create azure --subscription_id subid --client_id cliid --region westus --tenant_id tenid tmp_project" + And I run ernest with "project create azure --subscription_id subid --client_id cliid --region westus --tenant_id tenid tmp_project" + Then The output should contain "Project 'tmp_project' already exists, please specify a different name" diff --git a/internal/features/cli/datacenter_create_vcloud.feature b/internal/features/cli/datacenter_create_vcloud.feature index 8e63422..3b9b5c3 100644 --- a/internal/features/cli/datacenter_create_vcloud.feature +++ b/internal/features/cli/datacenter_create_vcloud.feature @@ -1,43 +1,43 @@ -@datacenter @datacenter_create @datacenter_create_vcloud -Feature: Ernest datacenter create +@project @project_create @project_create_vcloud +Feature: Ernest project create - Scenario: Non logged vcloud datacenter creation + Scenario: Non logged vcloud project creation Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "datacenter create vcloud" - Then The output should contain "You should specify the datacenter name" - When I run ernest with "datacenter create vcloud tmp_datacenter" + When I run ernest with "project create vcloud" + Then The output should contain "You should specify the project name" + When I run ernest with "project create vcloud tmp_project" Then The output should contain "You're not allowed to perform this action, please log in" - Scenario: Logged user vcloud datacenter creation + Scenario: Logged user vcloud project creation Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - When I run ernest with "datacenter create vcloud" - Then The output should contain "You should specify the datacenter name" - When I run ernest with "datacenter create vcloud tmp_datacenter" + When I run ernest with "project create vcloud" + Then The output should contain "You should specify the project name" + When I run ernest with "project create vcloud tmp_project" Then The output should contain "Please, fix the error shown below to continue" And The output should contain "- Specify a valid VCloud URL with --vcloud-url flag" And The output should contain "- Specify a valid public network with --public-network flag" And The output should contain "- Specify a valid user name with --user" And The output should contain "- Specify a valid organization with --org" And The output should contain "- Specify a valid password with --password" - When I run ernest with "datacenter create vcloud --user usr --password xxxx --org MY-ORG-NAME --vse-url http://vse.url --vcloud-url https://myernest.com --public-network MY-PUBLIC-NETWORK tmp_datacenter" - Then The output should contain "Datacenter 'tmp_datacenter' successfully created" - When I run ernest with "datacenter list" - Then The output should contain "tmp_datacenter" + When I run ernest with "project create vcloud --user usr --password xxxx --org MY-ORG-NAME --vse-url http://vse.url --vcloud-url https://myernest.com --public-network MY-PUBLIC-NETWORK tmp_project" + Then The output should contain "Project 'tmp_project' successfully created" + When I run ernest with "project list" + Then The output should contain "tmp_project" Then The output should contain "test" Then The output should contain "vcloud" Then The output should contain "https://myernest.com" Then The output should contain "MY-PUBLIC-NETWORK" Then The output should contain "MY-ORG-NAME" - Scenario: Adding an already existing vcloud datacenter + Scenario: Adding an already existing vcloud project Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - When I run ernest with "datacenter create vcloud --user usr --password xxxx --org MY-ORG-NAME --vse-url http://vse.url --vcloud-url https://myernest.com --public-network MY-PUBLIC-NETWORK tmp_datacenter" - And I run ernest with "datacenter create vcloud --user usr --password xxxx --org MY-ORG-NAME --vse-url http://vse.url --vcloud-url https://myernest.com --public-network MY-PUBLIC-NETWORK tmp_datacenter" - Then The output should contain "Datacenter 'tmp_datacenter' already exists, please specify a different name" + When I run ernest with "project create vcloud --user usr --password xxxx --org MY-ORG-NAME --vse-url http://vse.url --vcloud-url https://myernest.com --public-network MY-PUBLIC-NETWORK tmp_project" + And I run ernest with "project create vcloud --user usr --password xxxx --org MY-ORG-NAME --vse-url http://vse.url --vcloud-url https://myernest.com --public-network MY-PUBLIC-NETWORK tmp_project" + Then The output should contain "Project 'tmp_project' already exists, please specify a different name" diff --git a/internal/features/cli/datacenter_delete.feature b/internal/features/cli/datacenter_delete.feature index 8ae2d0c..57c02dd 100644 --- a/internal/features/cli/datacenter_delete.feature +++ b/internal/features/cli/datacenter_delete.feature @@ -1,41 +1,41 @@ -@datacenter @datacenter_delete -Feature: Ernest datacenter create +@project @project_delete +Feature: Ernest project create - Scenario: Non logged vcloud datacenter creation + Scenario: Non logged vcloud project creation Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "datacenter delete" + When I run ernest with "project delete" Then The output should contain "You're not allowed to perform this action, please log in" - Scenario: Deleting an existing datacenter + Scenario: Deleting an existing project Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - And I run ernest with "datacenter create vcloud --user usr --password xxxx --org MY-ORG-NAME --vse-url http://vse.url --vcloud-url https://myernest.com --public-network MY-PUBLIC-NETWORK tmp_datacenter" - And I run ernest with "datacenter list" - And The output should contain "tmp_datacenter" - When I run ernest with "datacenter delete tmp_datacenter" - Then The output should contain "Datacenter tmp_datacenter successfully removed" - And I run ernest with "datacenter list" - And The output should not contain "tmp_datacenter" + And I run ernest with "project create vcloud --user usr --password xxxx --org MY-ORG-NAME --vse-url http://vse.url --vcloud-url https://myernest.com --public-network MY-PUBLIC-NETWORK tmp_project" + And I run ernest with "project list" + And The output should contain "tmp_project" + When I run ernest with "project delete tmp_project" + Then The output should contain "Project tmp_project successfully removed" + And I run ernest with "project list" + And The output should not contain "tmp_project" - Scenario: Deleting an unexisting datacenter + Scenario: Deleting an unexisting project Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - When I run ernest with "datacenter delete tmp_datacenter" - Then The output should contain "Datacenter 'tmp_datacenter' does not exist, please specify a different datacenter name" + When I run ernest with "project delete tmp_project" + Then The output should contain "Project 'tmp_project' does not exist, please specify a different project name" - Scenario: Deleting an existing datacenter with related services + Scenario: Deleting an existing project with related environments Given I setup ernest with target "https://ernest.local" - And I setup a new service name - And the datacenter "test_dc" does not exist + And I setup a new environment name + And the project "test_dc" does not exist And I'm logged in as "usr" / "secret123" - And I run ernest with "datacenter create aws --secret_access_key tmp_secret_access_key --access_key_id tmp_secret_up_to_16_chars --region tmp_region --fake test_dc" - Then The output should contain "Datacenter 'test_dc' successfully created" - And The service "aws_test_service" does not exist + And I run ernest with "project create aws --secret_access_key tmp_secret_access_key --access_key_id tmp_secret_up_to_16_chars --region tmp_region --fake test_dc" + Then The output should contain "Project 'test_dc' successfully created" + And The environment "aws_test_environment" does not exist When I apply the definition "referenced.yml" - And I run ernest with "datacenter list" + And I run ernest with "project list" And The output should contain "test_dc" - And I run ernest with "datacenter delete test_dc" - Then The output should contain "Existing services are referring to this datacenter." + And I run ernest with "project delete test_dc" + Then The output should contain "Existing environments are referring to this project." diff --git a/internal/features/cli/datacenter_list.feature b/internal/features/cli/datacenter_list.feature index cb3dc41..7f20eea 100644 --- a/internal/features/cli/datacenter_list.feature +++ b/internal/features/cli/datacenter_list.feature @@ -1,23 +1,23 @@ -@datacenter @datacenter_list -Feature: Ernest datacenter list +@project @project_list +Feature: Ernest project list Scenario: Non logged user listing Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "datacenter list" + When I run ernest with "project list" Then The output should contain "You're not allowed to perform this action, please log in" Scenario: Logged user listing Given I setup ernest with target "https://ernest.local" When I'm logged in as "usr" / "secret123" - And I run ernest with "datacenter list" + And I run ernest with "project list" Then The output should contain "fake" And The output should contain "fakeaws" Scenario: Admin user listing Given I setup ernest with target "https://ernest.local" When I'm logged in as "ci_admin" / "secret123" - And I run ernest with "datacenter list" + And I run ernest with "project list" Then The output should contain "fake" Then The output should contain "test" And The output should contain "fakeaws" @@ -25,9 +25,9 @@ Feature: Ernest datacenter list Scenario: Listing fields Given I setup ernest with target "https://ernest.local" When I'm logged in as "usr" / "secret123" - And I run ernest with "datacenter list" - Then The output should contain "VCloud Datacenters" - Then The output should contain "AWS Datacenters" + And I run ernest with "project list" + Then The output should contain "VCloud Projects" + Then The output should contain "AWS Projects" And The output should contain "fake" And The output should contain "fakeaws" And The output should contain "NAME" diff --git a/internal/features/cli/datacenter_update_aws.feature b/internal/features/cli/datacenter_update_aws.feature index d2171ec..d3c935a 100644 --- a/internal/features/cli/datacenter_update_aws.feature +++ b/internal/features/cli/datacenter_update_aws.feature @@ -1,26 +1,26 @@ -@datacenter @datacenter_update @datacenter_update_aws -Feature: Ernest aws datacenter update +@project @project_update @project_update_aws +Feature: Ernest aws project update - Scenario: Non logged aws datacenter creation + Scenario: Non logged aws project creation Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "datacenter update aws" + When I run ernest with "project update aws" Then The output should contain "You're not allowed to perform this action, please log in" - Scenario: Updating an existing aws datacenter + Scenario: Updating an existing aws project Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - And I run ernest with "datacenter create aws --secret_access_key tmp_secret_access_key_up_to_16_chars --access_key_id tmp_secret_up_to_16_chars --region tmp_region tmp_datacenter" - And I run ernest with "datacenter list" - And The output should contain "tmp_datacenter" - When I run ernest with "datacenter update aws tmp_datacenter --secret_access_key tmp_secret_access_key_up_to_16_chars --access_key_id tmp_secret_up_to_16_chars" - Then The output should contain "Datacenter tmp_datacenter successfully updated" - And The aws datacenter "tmp_datacenter" credentials should be "tmp_secret_up_to_16_chars" and "tmp_secret_access_key_up_to_16_chars" + And I run ernest with "project create aws --secret_access_key tmp_secret_access_key_up_to_16_chars --access_key_id tmp_secret_up_to_16_chars --region tmp_region tmp_project" + And I run ernest with "project list" + And The output should contain "tmp_project" + When I run ernest with "project update aws tmp_project --secret_access_key tmp_secret_access_key_up_to_16_chars --access_key_id tmp_secret_up_to_16_chars" + Then The output should contain "Project tmp_project successfully updated" + And The aws project "tmp_project" credentials should be "tmp_secret_up_to_16_chars" and "tmp_secret_access_key_up_to_16_chars" - Scenario: Updating an unexisting aws datacenter + Scenario: Updating an unexisting aws project Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - When I run ernest with "datacenter update aws tmp_datacenter --secret_access_key very_large_aws_token_string --access_key_id secret" - Then The output should contain "Datacenter 'tmp_datacenter' does not exist, please specify a different datacenter name" + When I run ernest with "project update aws tmp_project --secret_access_key very_large_aws_token_string --access_key_id secret" + Then The output should contain "Project 'tmp_project' does not exist, please specify a different project name" diff --git a/internal/features/cli/datacenter_update_azure.feature b/internal/features/cli/datacenter_update_azure.feature index c59f8b0..b79bd31 100644 --- a/internal/features/cli/datacenter_update_azure.feature +++ b/internal/features/cli/datacenter_update_azure.feature @@ -1,26 +1,26 @@ -@datacenter @datacenter_update @datacenter_update_azure -Feature: Ernest azure datacenter update +@project @project_update @project_update_azure +Feature: Ernest azure project update - Scenario: Non logged azure datacenter creation + Scenario: Non logged azure project creation Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "datacenter update azure" + When I run ernest with "project update azure" Then The output should contain "You're not allowed to perform this action, please log in" - Scenario: Updating an existing azure datacenter + Scenario: Updating an existing azure project Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - When I run ernest with "datacenter create azure --subscription_id subid --client_id cliid --client_secret secret --region westus --tenant_id tenid --environment public tmp_datacenter" - And I run ernest with "datacenter list" - And The output should contain "tmp_datacenter" - When I run ernest with "datacenter update azure --subscription_id u_subid --client_id u_cliid --client_secret secret --tenant_id u_tenid --environment u_public tmp_datacenter" - Then The output should contain "Datacenter tmp_datacenter successfully updated" - And The azure datacenter "tmp_datacenter" credentials should be "u_subid", "u_cliid", "secret", "u_tenid" and "u_public" + When I run ernest with "project create azure --subscription_id subid --client_id cliid --client_secret secret --region westus --tenant_id tenid --environment public tmp_project" + And I run ernest with "project list" + And The output should contain "tmp_project" + When I run ernest with "project update azure --subscription_id u_subid --client_id u_cliid --client_secret secret --tenant_id u_tenid --environment u_public tmp_project" + Then The output should contain "Project tmp_project successfully updated" + And The azure project "tmp_project" credentials should be "u_subid", "u_cliid", "secret", "u_tenid" and "u_public" - Scenario: Updating an unexisting azure datacenter + Scenario: Updating an unexisting azure project Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - When I run ernest with "datacenter update azure --subscription_id u_subid --client_id u_cliid --client_secret secret --tenant_id u_tenid --environment u_public tmp_datacenter" - Then The output should contain "Datacenter 'tmp_datacenter' does not exist, please specify a different datacenter name" + When I run ernest with "project update azure --subscription_id u_subid --client_id u_cliid --client_secret secret --tenant_id u_tenid --environment u_public tmp_project" + Then The output should contain "Project 'tmp_project' does not exist, please specify a different project name" diff --git a/internal/features/cli/datacenter_update_vcloud.feature b/internal/features/cli/datacenter_update_vcloud.feature index 5a0ecf9..f12c00d 100644 --- a/internal/features/cli/datacenter_update_vcloud.feature +++ b/internal/features/cli/datacenter_update_vcloud.feature @@ -1,25 +1,25 @@ -@datacenter @datacenter_update @datacenter_update_vcloud -Feature: Ernest vcloud datacenter update +@project @project_update @project_update_vcloud +Feature: Ernest vcloud project update - Scenario: Non logged vcloud datacenter creation + Scenario: Non logged vcloud project creation Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "datacenter update vcloud" + When I run ernest with "project update vcloud" Then The output should contain "You're not allowed to perform this action, please log in" - Scenario: Updating an existing vcloud datacenter + Scenario: Updating an existing vcloud project Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - And I run ernest with "datacenter create vcloud --user usr --password xxxx --org MY-ORG-NAME --vse-url http://vse.url --vcloud-url https://myernest.com --public-network MY-PUBLIC-NETWORK tmp_datacenter" - And I run ernest with "datacenter list" - And The output should contain "tmp_datacenter" - When I run ernest with "datacenter update vcloud tmp_datacenter --user me --org MY-NEW-ORG --password secret" - Then The output should contain "Datacenter tmp_datacenter successfully updated" + And I run ernest with "project create vcloud --user usr --password xxxx --org MY-ORG-NAME --vse-url http://vse.url --vcloud-url https://myernest.com --public-network MY-PUBLIC-NETWORK tmp_project" + And I run ernest with "project list" + And The output should contain "tmp_project" + When I run ernest with "project update vcloud tmp_project --user me --org MY-NEW-ORG --password secret" + Then The output should contain "Project tmp_project successfully updated" - Scenario: Updating an unexisting vcloud datacenter + Scenario: Updating an unexisting vcloud project Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist + And the project "tmp_project" does not exist And I'm logged in as "usr" / "secret123" - When I run ernest with "datacenter update vcloud tmp_datacenter --user me --org MY-NEW-ORG --password secret" - Then The output should contain "Datacenter 'tmp_datacenter' does not exist, please specify a different datacenter name" + When I run ernest with "project update vcloud tmp_project --user me --org MY-NEW-ORG --password secret" + Then The output should contain "Project 'tmp_project' does not exist, please specify a different project name" diff --git a/internal/features/cli/datacenters_to_groups.feature b/internal/features/cli/datacenters_to_groups.feature deleted file mode 100644 index 279250b..0000000 --- a/internal/features/cli/datacenters_to_groups.feature +++ /dev/null @@ -1,76 +0,0 @@ -@group @datacenters_to_groups -Feature: Ernest datacenters to groups - - Scenario: Non logged - datacenter to group - Given I setup ernest with target "https://ernest.local" - And I logout - When I run ernest with "group add-datacenter" - Then The output should contain "You should specify the datacenter name and group name" - When I run ernest with "group add-datacenter tmp_datacenter" - Then The output should contain "You should specify the group name" - When I run ernest with "group add-datacenter tmp_datacenter tmp_group" - Then The output should contain "You're not allowed to perform this action, please log in" - - Scenario: Plain datacenter - datacenter to group - Given I setup ernest with target "https://ernest.local" - And I'm logged in as "usr" / "secret123" - When I run ernest with "group add-datacenter" - Then The output should contain "You should specify the datacenter name and group name" - When I run ernest with "group add-datacenter tmp_datacenter" - Then The output should contain "You should specify the group name" - When I run ernest with "group add-datacenter tmp_datacenter tmp_group" - Then The output should contain "You don't have permissions to perform this action" - - Scenario: Admin datacenter - datacenter to group - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" exists - And the datacenter "tmp_datacenter" exists - And I'm logged in as "ci_admin" / "secret123" - When I run ernest with "group add-datacenter" - Then The output should contain "You should specify the datacenter name and group name" - When I run ernest with "group add-datacenter tmp_datacenter" - Then The output should contain "You should specify the group name" - When I run ernest with "group add-datacenter tmp_datacenter tmp_group" - Then The output should contain "Datacenter 'tmp_datacenter' is now assigned to group 'tmp_group'" - When I run ernest with "datacenter list" - Then The output datacenters table should contain "tmp_datacenter" assigned to "tmp_group" group - - Scenario: Already assigned datacenter - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" exists - And the datacenter "tmp_datacenter" exists - And I'm logged in as "ci_admin" / "secret123" - And I run ernest with "group add-datacenter tmp_datacenter tmp_group" - When I run ernest with "group add-datacenter tmp_datacenter tmp_group" - Then The output should contain "Datacenter 'tmp_datacenter' already belongs to 'tmp_group' group" - - Scenario: Unexisting group - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" does not exist - And the datacenter "tmp_datacenter" exists - And I'm logged in as "ci_admin" / "secret123" - When I run ernest with "group add-datacenter tmp_datacenter tmp_group" - Then The output should contain "Group 'tmp_group' does not exist" - - Scenario: Unexisting datacenter - Given I setup ernest with target "https://ernest.local" - And the datacenter "tmp_datacenter" does not exist - And the group "tmp_group" exists - And I'm logged in as "ci_admin" / "secret123" - When I run ernest with "group add-datacenter tmp_datacenter tmp_group" - Then The output should contain "Datacenter 'tmp_datacenter' does not exist" - - Scenario: Admin datacenter - remove datacenter from group - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" exists - And the datacenter "tmp_datacenter" exists - And I'm logged in as "ci_admin" / "secret123" - And I run ernest with "group add-datacenter tmp_datacenter tmp_group" - When I run ernest with "group remove-datacenter" - Then The output should contain "You should specify the datacenter name and group name" - When I run ernest with "group remove-datacenter tmp_datacenter" - Then The output should contain "You should specify the group name" - When I run ernest with "group remove-datacenter tmp_datacenter tmp_group" - Then The output should contain "Datacenter 'tmp_datacenter' is not assigned anymore to group 'tmp_group'" - When I run ernest with "datacenter list" - Then The output datacenters table should contain "tmp_datacenter" assigned to " " group diff --git a/internal/features/cli/datacenters_to_groups.old b/internal/features/cli/datacenters_to_groups.old new file mode 100644 index 0000000..a96bd4e --- /dev/null +++ b/internal/features/cli/datacenters_to_groups.old @@ -0,0 +1,76 @@ +@group @projects_to_groups +Feature: Ernest projects to groups + + Scenario: Non logged - project to group + Given I setup ernest with target "https://ernest.local" + And I logout + When I run ernest with "group add-project" + Then The output should contain "You should specify the project name and group name" + When I run ernest with "group add-project tmp_project" + Then The output should contain "You should specify the group name" + When I run ernest with "group add-project tmp_project tmp_group" + Then The output should contain "You're not allowed to perform this action, please log in" + + Scenario: Plain project - project to group + Given I setup ernest with target "https://ernest.local" + And I'm logged in as "usr" / "secret123" + When I run ernest with "group add-project" + Then The output should contain "You should specify the project name and group name" + When I run ernest with "group add-project tmp_project" + Then The output should contain "You should specify the group name" + When I run ernest with "group add-project tmp_project tmp_group" + Then The output should contain "You don't have permissions to perform this action" + + Scenario: Admin project - project to group + Given I setup ernest with target "https://ernest.local" + And the group "tmp_group" exists + And the project "tmp_project" exists + And I'm logged in as "ci_admin" / "secret123" + When I run ernest with "group add-project" + Then The output should contain "You should specify the project name and group name" + When I run ernest with "group add-project tmp_project" + Then The output should contain "You should specify the group name" + When I run ernest with "group add-project tmp_project tmp_group" + Then The output should contain "Project 'tmp_project' is now assigned to group 'tmp_group'" + When I run ernest with "project list" + Then The output projects table should contain "tmp_project" assigned to "tmp_group" group + + Scenario: Already assigned project + Given I setup ernest with target "https://ernest.local" + And the group "tmp_group" exists + And the project "tmp_project" exists + And I'm logged in as "ci_admin" / "secret123" + And I run ernest with "group add-project tmp_project tmp_group" + When I run ernest with "group add-project tmp_project tmp_group" + Then The output should contain "Project 'tmp_project' already belongs to 'tmp_group' group" + + Scenario: Unexisting group + Given I setup ernest with target "https://ernest.local" + And the group "tmp_group" does not exist + And the project "tmp_project" exists + And I'm logged in as "ci_admin" / "secret123" + When I run ernest with "group add-project tmp_project tmp_group" + Then The output should contain "Group 'tmp_group' does not exist" + + Scenario: Unexisting project + Given I setup ernest with target "https://ernest.local" + And the project "tmp_project" does not exist + And the group "tmp_group" exists + And I'm logged in as "ci_admin" / "secret123" + When I run ernest with "group add-project tmp_project tmp_group" + Then The output should contain "Project 'tmp_project' does not exist" + + Scenario: Admin project - remove project from group + Given I setup ernest with target "https://ernest.local" + And the group "tmp_group" exists + And the project "tmp_project" exists + And I'm logged in as "ci_admin" / "secret123" + And I run ernest with "group add-project tmp_project tmp_group" + When I run ernest with "group remove-project" + Then The output should contain "You should specify the project name and group name" + When I run ernest with "group remove-project tmp_project" + Then The output should contain "You should specify the group name" + When I run ernest with "group remove-project tmp_project tmp_group" + Then The output should contain "Project 'tmp_project' is not assigned anymore to group 'tmp_group'" + When I run ernest with "project list" + Then The output projects table should contain "tmp_project" assigned to " " group diff --git a/internal/features/cli/dry.feature b/internal/features/cli/dry.feature index 85b744a..3fa9aaa 100644 --- a/internal/features/cli/dry.feature +++ b/internal/features/cli/dry.feature @@ -1,9 +1,9 @@ @cli @apply_dry Feature: Applying with dry option - Scenario: Applying a basic azure service + Scenario: Applying a basic azure environment Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "azure1.yml" with dry option Then The output should contain "Applying this definition will:" diff --git a/internal/features/cli/group.feature b/internal/features/cli/group.feature deleted file mode 100644 index 4c7d84a..0000000 --- a/internal/features/cli/group.feature +++ /dev/null @@ -1,27 +0,0 @@ -@group -Feature: Ernest group - - Scenario: running "group" command as logged in user - Given I setup ernest with target "https://ernest.local" - When I'm logged in as "usr" / "secret123" - And I run ernest with "group" - Then The output should contain "delete" - And The output should contain "list" - And The output should contain "create" - And The output should contain "add-user" - And The output should contain "remove-user" - And The output should contain "add-datacenter" - And The output should contain "remove-datacenter" - - Scenario: running "group" command as non logged in user - Given I setup ernest with target "https://ernest.local" - And I logout - When I run ernest with "group" - Then The output should contain "delete" - And The output should contain "list" - And The output should contain "create" - And The output should contain "add-user" - And The output should contain "remove-user" - And The output should contain "add-datacenter" - And The output should contain "remove-datacenter" - diff --git a/internal/features/cli/group_create.feature b/internal/features/cli/group_create.feature deleted file mode 100644 index 58761ea..0000000 --- a/internal/features/cli/group_create.feature +++ /dev/null @@ -1,37 +0,0 @@ -@group @group_create -Feature: Ernest group create - - Scenario: Non logged group creation - Given I setup ernest with target "https://ernest.local" - And I logout - When I run ernest with "group create" - Then The output should contain "You should specify the group name" - When I run ernest with "group create tmp_group" - Then The output should contain "You're not allowed to perform this action, please log in" - - Scenario: Plain user group creation - Given I setup ernest with target "https://ernest.local" - And I'm logged in as "usr" / "secret123" - When I run ernest with "group create" - Then The output should contain "You should specify the group name" - When I run ernest with "group create tmp_group" - Then The output should contain "You don't have permissions to perform this action" - - Scenario: Admin user group creation - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" does not exist - And I'm logged in as "ci_admin" / "secret123" - When I run ernest with "group create" - Then The output should contain "You should specify the group name" - When I run ernest with "group create tmp_group" - Then The output should contain "Group 'tmp_group' successfully created, you can add users with 'ernest group add-user username tmp_group'" - - Scenario: Adding an already existing group - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" does not exist - And I'm logged in as "ci_admin" / "secret123" - And I run ernest with "group create tmp_group" - When I run ernest with "group create tmp_group" - Then The output should contain "Group 'tmp_group' already exists, please specify a different group name" - - diff --git a/internal/features/cli/group_delete.feature b/internal/features/cli/group_delete.feature deleted file mode 100644 index 06c3973..0000000 --- a/internal/features/cli/group_delete.feature +++ /dev/null @@ -1,35 +0,0 @@ -@group @group_delete -Feature: Ernest group delete - - Scenario: Non logged group deletion - Given I setup ernest with target "https://ernest.local" - And I logout - When I run ernest with "group delete" - Then The output should contain "You should specify the group name" - When I run ernest with "group delete tmp_group" - Then The output should contain "You're not allowed to perform this action, please log in" - - Scenario: Plain user group deletion - Given I setup ernest with target "https://ernest.local" - When I'm logged in as "usr" / "secret123" - When I run ernest with "group delete" - Then The output should contain "You should specify the group name" - When I run ernest with "group delete tmp_group" - Then The output should contain "You don't have permissions to perform this action" - - Scenario: Admin user group deletion - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" does not exist - And I'm logged in as "ci_admin" / "secret123" - And I run ernest with "group create tmp_group" - When I run ernest with "group delete tmp_group" - Then The output should contain "Group 'tmp_group' successfully deleted" - - Scenario: Deleting a non existing group - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" does not exist - And I'm logged in as "ci_admin" / "secret123" - When I run ernest with "group delete tmp_group" - Then The output should contain "Group 'tmp_group' does not exist, please specify a different group name" - - diff --git a/internal/features/cli/group_list.feature b/internal/features/cli/group_list.feature deleted file mode 100644 index 0046163..0000000 --- a/internal/features/cli/group_list.feature +++ /dev/null @@ -1,24 +0,0 @@ -@group -Feature: Ernest group list - - Scenario: Non logged user listing - Given I setup ernest with target "https://ernest.local" - And I logout - When I run ernest with "group list" - Then The output should contain "You're not allowed to perform this action, please log in" - - Scenario: Logged user listing - Given I setup ernest with target "https://ernest.local" - When I'm logged in as "usr" / "secret123" - And I run ernest with "group list" - Then The output should contain "test" - And The output should not contain "ci_admin" - - Scenario: Admin user listing - Given I setup ernest with target "https://ernest.local" - When I'm logged in as "ci_admin" / "secret123" - And I run ernest with "group list" - Then The output should contain "test" - And The output should contain "ci_admin" - - diff --git a/internal/features/cli/logout.feature b/internal/features/cli/logout.feature index 0ed2ab2..3244816 100644 --- a/internal/features/cli/logout.feature +++ b/internal/features/cli/logout.feature @@ -8,7 +8,7 @@ Feature: Ernest logout Then The output should contain "Bye." When I run ernest with "info" Then The output should not contain "usr" - When I run ernest with "group list" + When I run ernest with "user list" Then The output should contain "You're not allowed to perform this action, please log in" Scenario: Logout non logged in user diff --git a/internal/features/cli/service.feature b/internal/features/cli/service.feature index 673b134..9e79b10 100644 --- a/internal/features/cli/service.feature +++ b/internal/features/cli/service.feature @@ -1,10 +1,10 @@ -@service -Feature: Ernest service +@environment +Feature: Ernest environment - Scenario: running "service" command as logged in user + Scenario: running "environment" command as logged in user Given I setup ernest with target "https://ernest.local" When I'm logged in as "usr" / "secret123" - And I run ernest with "service" + And I run ernest with "environment" And The output should contain "list" And The output should contain "apply" And The output should contain "destroy" @@ -14,10 +14,10 @@ Feature: Ernest service And The output should contain "info" And The output should contain "monitor" - Scenario: running "service" command as non logged in user + Scenario: running "environment" command as non logged in user Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "service" + When I run ernest with "environment" And The output should contain "list" And The output should contain "list" And The output should contain "apply" diff --git a/internal/features/cli/service_apply.feature b/internal/features/cli/service_apply.feature index be42ab5..4d15b56 100644 --- a/internal/features/cli/service_apply.feature +++ b/internal/features/cli/service_apply.feature @@ -1,32 +1,32 @@ -@service @service_apply -Feature: Service apply +@environment @environment_apply +Feature: Environment apply - Scenario: Non logged service apply + Scenario: Non logged environment apply Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "service apply" + When I run ernest with "environment apply" Then The output should contain "You're not allowed to perform this action, please log in" - When I run ernest with "service apply definitions/aws1.yml" + When I run ernest with "environment apply definitions/aws1.yml" Then The output should contain "You're not allowed to perform this action, please log in" - Scenario: Logged service apply errors + Scenario: Logged environment apply errors Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - When I run ernest with "service apply" + When I run ernest with "environment apply" Then The output should contain "You should specify a valid template path or store an ernest.yml on the current folder" - When I run ernest with "service apply internal/definitions/unexisting_dc.yml" + When I run ernest with "environment apply internal/definitions/unexisting_dc.yml" Then The output should contain "Specified datacenter does not exist" - Scenario: Logged service apply + Scenario: Logged environment apply Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The service "aws_test_service" does not exist + And The environment "aws_test_environment" does not exist When I apply the definition "aws1.yml" Then The output should contain "Status: Applied" - Scenario: Logged service apply with internal file references + Scenario: Logged environment apply with internal file references Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The service "aws_test_service" does not exist + And The environment "aws_test_environment" does not exist When I apply the definition "aws-template1-unexisting.yml" Then The output should contain "Can't access referenced file" diff --git a/internal/features/cli/service_definition.feature b/internal/features/cli/service_definition.feature index 34fd97f..53c5880 100644 --- a/internal/features/cli/service_definition.feature +++ b/internal/features/cli/service_definition.feature @@ -1,29 +1,29 @@ -@service @service_definition -Feature: Ernest service definition +@environment @environment_definition +Feature: Ernest environment definition Scenario: Non logged user definition Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "service definition" + When I run ernest with "environment definition" Then The output should contain "You're not allowed to perform this action, please log in" Scenario: Logged user definition Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The service "destroyable" does not exist + And The environment "destroyable" does not exist And I apply the definition "destroyable.yml" - When I run ernest with "service definition" - Then The output should contain "You should specify the service name" - When I run ernest with "service definition destroyable" + When I run ernest with "environment definition" + Then The output should contain "You should specify the env name" + When I run ernest with "environment definition destroyable" Then The output should contain "name: destroyable" And The output should contain "datacenter: fakeaws" Scenario: Logged user definition for a specific build Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The service "destroyable" does not exist + And The environment "destroyable" does not exist And I apply the definition "destroyable.yml" - When I run ernest with "service definition destroyable" + When I run ernest with "environment definition destroyable" Then The output should contain "name: destroyable" And The output should contain "datacenter: fakeaws" diff --git a/internal/features/cli/service_destroy.feature b/internal/features/cli/service_destroy.feature index ef7e28b..9521fd1 100644 --- a/internal/features/cli/service_destroy.feature +++ b/internal/features/cli/service_destroy.feature @@ -1,29 +1,29 @@ -@service @service_destroy -Feature: Service destroy +@environment @environment_destroy +Feature: Environment destroy - Scenario: Non logged service destroy + Scenario: Non logged environment destroy Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "service destroy" + When I run ernest with "environment destroy" Then The output should contain "You're not allowed to perform this action, please log in" - When I run ernest with "service destroy destroyable" + When I run ernest with "environment destroy destroyable" Then The output should contain "You're not allowed to perform this action, please log in" - Scenario: Logged service destroy unexisting + Scenario: Logged environment destroy unexisting Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - When I run ernest with "service destroy" - Then The output should contain "You should specify an existing service name" - When I run ernest with "service destroy unexisting --yes" - Then The output should contain "Specified service name does not exist" + When I run ernest with "environment destroy" + Then The output should contain "You should specify an existing environment name" + When I run ernest with "environment destroy unexisting --yes" + Then The output should contain "Specified environment name does not exist" - Scenario: Logged service destroy + Scenario: Logged environment destroy Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The service "destroyable" does not exist + And The environment "destroyable" does not exist And I apply the definition "destroyable.yml" - When I run ernest with "service destroy destroyable --yes" - Then The output should not contain "Specified service name does not exist" + When I run ernest with "environment destroy destroyable --yes" + Then The output should not contain "Specified environment name does not exist" And I wait for "1" seconds - When I run ernest with "service destroy destroyable --yes" - Then The output should contain "Specified service name does not exist" + When I run ernest with "environment destroy destroyable --yes" + Then The output should contain "Specified environment name does not exist" diff --git a/internal/features/cli/service_history.feature b/internal/features/cli/service_history.feature index be0570e..42e83d9 100644 --- a/internal/features/cli/service_history.feature +++ b/internal/features/cli/service_history.feature @@ -1,31 +1,31 @@ -@service @service_history -Feature: Service history +@environment @environment_history +Feature: Environment history - Scenario: Non logged service history + Scenario: Non logged environment history Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "service history" + When I run ernest with "environment history" Then The output should contain "You're not allowed to perform this action, please log in" - When I run ernest with "service destroy destroyable" + When I run ernest with "environment destroy destroyable" Then The output should contain "You're not allowed to perform this action, please log in" - Scenario: Logged service history unexisting + Scenario: Logged environment history unexisting Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - When I run ernest with "service history" - Then The output should contain "You should specify an existing service name" - When I run ernest with "service history unexisting" - Then The output should contain "There are no registered builds for this service" + When I run ernest with "environment history" + Then The output should contain "You should specify an existing environment name" + When I run ernest with "environment history unexisting" + Then The output should contain "There are no registered builds for this environment" - Scenario: Logged service history + Scenario: Logged environment history Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The service "destroyable" does not exist + And The environment "destroyable" does not exist And I apply the definition "destroyable.yml" And I wait for "5" seconds And I apply the definition "destroyable2.yml" And I wait for "5" seconds - When I run ernest with "service history destroyable" + When I run ernest with "environment history destroyable" Then The output line number "3" should contain "destroyable" And The output line number "3" should contain "done" And The output line number "3" should contain "usr" diff --git a/internal/features/cli/service_import.feature b/internal/features/cli/service_import.feature index cda5345..efa21a7 100644 --- a/internal/features/cli/service_import.feature +++ b/internal/features/cli/service_import.feature @@ -1,27 +1,27 @@ -@service @service_import -Feature: Service import +@environment @environment_import +Feature: Environment import - Scenario: Non logged service import + Scenario: Non logged environment import Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "service import" + When I run ernest with "environment import" Then The output should contain "You're not allowed to perform this action, please log in" - When I run ernest with "service import imported" + When I run ernest with "environment import imported" Then The output should contain "You're not allowed to perform this action, please log in" - Scenario: Logged service import errors + Scenario: Logged environment import errors Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - When I run ernest with "service import" - Then The output should contain "You should specify an existing datacenter name" - When I run ernest with "service import unexisting" - Then The output should contain "You should specify a valid service name" + When I run ernest with "environment import" + Then The output should contain "You should specify an existing project name" + When I run ernest with "environment import unexisting" + Then The output should contain "You should specify a valid environment name" - Scenario: Logged service non existing import + Scenario: Logged environment non existing import Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The service "imported" does not exist - When I run ernest with "service import fakeaws imported" + And The environment "imported" does not exist + When I run ernest with "environment import fakeaws imported" Then The output should contain regex "Ebs Volumes\s*2/2\s*Found" And The output should contain regex "Elbs\s*1/1\s*Found" And The output should contain regex "Firewalls\s*2/2\s*Found" diff --git a/internal/features/cli/service_info.feature b/internal/features/cli/service_info.feature index 233cb8b..9874b3f 100644 --- a/internal/features/cli/service_info.feature +++ b/internal/features/cli/service_info.feature @@ -1,18 +1,18 @@ -@service @service_info -Feature: Ernest service info +@environment @environment_info +Feature: Ernest environment info Scenario: Non logged user info Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "service info" + When I run ernest with "environment info" Then The output should contain "You're not allowed to perform this action, please log in" Scenario: Logged user info Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The service "destroyable" does not exist + And The environment "destroyable" does not exist And I apply the definition "destroyable.yml" - When I run ernest with "service info destroyable" + When I run ernest with "environment info destroyable" Then The output should contain "Name : destroyable" And The output should contain "VPCs:" And The output should contain "| test-vpc | fakeaws |" diff --git a/internal/features/cli/service_list.feature b/internal/features/cli/service_list.feature index bb1203f..7482918 100644 --- a/internal/features/cli/service_list.feature +++ b/internal/features/cli/service_list.feature @@ -1,18 +1,18 @@ -@service @service_list -Feature: Ernest service list +@environment @environment_list +Feature: Ernest environment list Scenario: Non logged user listing Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "service list" + When I run ernest with "environment list" Then The output should contain "You're not allowed to perform this action, please log in" Scenario: Logged user listing Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The service "destroyable" does not exist + And The environment "destroyable" does not exist And I apply the definition "destroyable.yml" - When I run ernest with "service list" + When I run ernest with "environment list" Then The output should contain "destroyable" And The output should not contain "errored" And The output should contain "usr" diff --git a/internal/features/cli/service_reset.feature b/internal/features/cli/service_reset.feature index f07f3a4..3148820 100644 --- a/internal/features/cli/service_reset.feature +++ b/internal/features/cli/service_reset.feature @@ -1,29 +1,29 @@ -@service @service_reset -Feature: Ernest service reset +@environment @environment_reset +Feature: Ernest environment reset Scenario: Non logged user reset Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "service reset" + When I run ernest with "environment reset" Then The output should contain "You're not allowed to perform this action, please log in" Scenario: Logged user reset Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The service "destroyable" does not exist + And The environment "destroyable" does not exist And I apply the definition "destroyable.yml" - When I run ernest with "service reset destroyable" - Then The output should contain "The service 'destroyable' cannot be reset as its status is 'done'" + When I run ernest with "environment reset destroyable" + Then The output should contain "The environment 'destroyable' cannot be reset as its status is 'done'" And I force "destroyable" to be on status "in_progress" - When I run ernest with "service list" + When I run ernest with "environment list" And The output line number "3" should contain "destroyable" And The output line number "3" should contain "in_progress" And The output line number "3" should contain "usr" - When I run ernest with "service reset destroyable" - Then The output should contain "You've successfully resetted the service 'destroyable'" - When I run ernest with "service list" + When I run ernest with "environment reset destroyable" + Then The output should contain "You've successfully resetted the environment 'destroyable'" + When I run ernest with "environment list" And The output line number "3" should contain "destroyable" And The output line number "3" should contain "errored" And The output line number "3" should contain "usr" - When I run ernest with "service reset destroyable" - Then The output should contain "The service 'destroyable' cannot be reset as its status is 'errored'" + When I run ernest with "environment reset destroyable" + Then The output should contain "The environment 'destroyable' cannot be reset as its status is 'errored'" diff --git a/internal/features/cli/service_revert.feature b/internal/features/cli/service_revert.feature index cce8abc..9b90f0a 100644 --- a/internal/features/cli/service_revert.feature +++ b/internal/features/cli/service_revert.feature @@ -1,31 +1,31 @@ -@service @service_revert -Feature: Service revert +@environment @environment_revert +Feature: Environment revert Background: Given I setup ernest with target "https://ernest.local" - Scenario: User reverts a service + Scenario: User reverts a environment Given I'm logged in as "usr" / "secret123" And I apply the definition "service-revert.yml" And I apply the definition "service-revert2.yml" - And I run ernest with "service revert myService 1" - When I run ernest with "service definition myService" + And I run ernest with "environment revert myService 1" + When I run ernest with "environment definition myService" Then The output should contain "net-1" And The output should not contain "net-2" - Scenario: User reverts a service wihout providing a service name or build ID + Scenario: User reverts a environment wihout providing a environment name or build ID Given I'm logged in as "usr" / "secret123" And I apply the definition "service-revert.yml" - When I run ernest with "service revert myService" - Then The output should contain "Please specify a service name and build ID" + When I run ernest with "environment revert myService" + Then The output should contain "Please specify an environment name and build ID" - Scenario: User reverts a service providing an invalid build ID + Scenario: User reverts a environment providing an invalid build ID Given I'm logged in as "usr" / "secret123" And I apply the definition "service-revert.yml" - When I run ernest with "service revert myService 99" + When I run ernest with "environment revert myService 99" Then The output should contain "Invalid build ID" - Scenario: Unauthenticated user reverts a service + Scenario: Unauthenticated user reverts a environment Given I logout - When I run ernest with "service revert" + When I run ernest with "environment revert" Then The output should contain "You're not allowed to perform this action, please log in" diff --git a/internal/features/cli/usage_report.feature b/internal/features/cli/usage_report.feature index 04e7ec9..ed3e0d0 100644 --- a/internal/features/cli/usage_report.feature +++ b/internal/features/cli/usage_report.feature @@ -1,8 +1,8 @@ -@service @usage_report +@environment @usage_report Feature: Usage report Scenario: Usage report - Given I setup a new service name + Given I setup a new environment name And I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" And I apply the definition "aws1.yml" diff --git a/internal/features/cli/users_to_groups.feature b/internal/features/cli/users_to_groups.feature deleted file mode 100644 index dc373da..0000000 --- a/internal/features/cli/users_to_groups.feature +++ /dev/null @@ -1,76 +0,0 @@ -@group @users_to_groups -Feature: Ernest users to groups - - Scenario: Non logged - user to group - Given I setup ernest with target "https://ernest.local" - And I logout - When I run ernest with "group add-user" - Then The output should contain "You should specify the username and group name" - When I run ernest with "group add-user tmp_user" - Then The output should contain "You should specify the group name" - When I run ernest with "group add-user tmp_user tmp_group" - Then The output should contain "You're not allowed to perform this action, please log in" - - Scenario: Plain user - user to group - Given I setup ernest with target "https://ernest.local" - And I'm logged in as "usr" / "secret123" - When I run ernest with "group add-user" - Then The output should contain "You should specify the username and group name" - When I run ernest with "group add-user tmp_user" - Then The output should contain "You should specify the group name" - When I run ernest with "group add-user tmp_user tmp_group" - Then The output should contain "You don't have permissions to perform this action" - - Scenario: Admin user - user to group - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" exists - And the user "tmp_user" exists - And I'm logged in as "ci_admin" / "secret123" - When I run ernest with "group add-user" - Then The output should contain "You should specify the username and group name" - When I run ernest with "group add-user tmp_user" - Then The output should contain "You should specify the group name" - When I run ernest with "group add-user tmp_user tmp_group" - Then The output should contain "User 'tmp_user' is now assigned to group 'tmp_group'" - When I run ernest with "user list" - Then The output users table should contain "tmp_user" assigned to "tmp_group" group - - Scenario: Already assigned user - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" exists - And the user "tmp_user" exists - And I'm logged in as "ci_admin" / "secret123" - And I run ernest with "group add-user tmp_user tmp_group" - When I run ernest with "group add-user tmp_user tmp_group" - Then The output should contain "User 'tmp_user' already belongs to 'tmp_group' group" - - Scenario: Unexisting group - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" does not exist - And the user "tmp_user" exists - And I'm logged in as "ci_admin" / "secret123" - When I run ernest with "group add-user tmp_user tmp_group" - Then The output should contain "Group 'tmp_group' does not exist" - - Scenario: Unexisting user - Given I setup ernest with target "https://ernest.local" - And the user "tmp_user" does not exist - And the group "tmp_group" exists - And I'm logged in as "ci_admin" / "secret123" - When I run ernest with "group add-user tmp_user tmp_group" - Then The output should contain "User 'tmp_user' does not exist" - - Scenario: Admin user - remove user from group - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" exists - And the user "tmp_user" exists - And I'm logged in as "ci_admin" / "secret123" - And I run ernest with "group add-user tmp_user tmp_group" - When I run ernest with "group remove-user" - Then The output should contain "You should specify the username and group name" - When I run ernest with "group remove-user tmp_user" - Then The output should contain "You should specify the group name" - When I run ernest with "group remove-user tmp_user tmp_group" - Then The output should contain "User 'tmp_user' is not assigned anymore to group 'tmp_group'" - When I run ernest with "user list" - Then The output users table should contain "tmp_user" assigned to " " group diff --git a/internal/features/steps/step_definitions.go b/internal/features/steps/step_definitions.go index dcf9d78..04b911b 100644 --- a/internal/features/steps/step_definitions.go +++ b/internal/features/steps/step_definitions.go @@ -40,7 +40,7 @@ func init() { cfg = ecc.NewConfig(os.Getenv("NATS_URI")) n = cfg.Nats() - Given("^I setup a new service name$", func() { + Given("^I setup a new environment name$", func() { serviceName = "aws" + strconv.Itoa(rand.Intn(9999999)) }) @@ -136,12 +136,12 @@ func init() { _, _ = n.Request("user.del", msg, time.Second*3) }) - And(`^The datacenter "(.+?)" does not exist$`, func(d string) { + And(`^The project "(.+?)" does not exist$`, func(d string) { msg := []byte(`{"name":"` + d + `", "type":"aws"}`) _, _ = n.Request("datacenter.del", msg, time.Second*3) }) - And(`^The service "(.+?)" does not exist$`, func(d string) { + And(`^The environment "(.+?)" does not exist$`, func(d string) { msg := []byte(`{"name":"` + d + `", "type":"aws"}`) _, _ = n.Request("service.del", msg, time.Second*3) }) @@ -160,7 +160,7 @@ func init() { _, _ = n.Request("user.set", msg, time.Second*3) }) - And(`^The datacenter "(.+?)" exists$`, func(d string) { + And(`^The project "(.+?)" exists$`, func(d string) { msg := []byte(`{"name":"` + d + `", "type":"aws"}`) _, _ = n.Request("datacenter.del", msg, time.Second*3) msg = []byte(`{"name":"` + d + `"}`) @@ -182,12 +182,12 @@ func init() { } }) - Then(`^The output datacenters table should contain "(.+?)" assigned to "(.+?)" group$`, func(datacenter string, group string) { + Then(`^The output projects table should contain "(.+?)" assigned to "(.+?)" group$`, func(project string, group string) { lines := strings.Split(lastOutput, "\n") for _, l := range lines { - if strings.Contains(l, datacenter) { + if strings.Contains(l, project) { if !strings.Contains(l, "| "+group) { - T.Errorf(`Datacenter doesn't seem to belong to specified group: \n` + l) + T.Errorf(`Project doesn't seem to belong to specified group: \n` + l) } } } @@ -208,8 +208,8 @@ func init() { }) - And(`^I force "(.+?)" to be on status "(.+?)"$`, func(service string, status string) { - _, _ = n.Request("build.set.status", []byte(`{"name":"`+service+`","status":"`+status+`"}`), time.Second*3) + And(`^I force "(.+?)" to be on status "(.+?)"$`, func(environment string, status string) { + _, _ = n.Request("build.set.status", []byte(`{"name":"`+environment+`","status":"`+status+`"}`), time.Second*3) }) And(`^File "(.+?)" exists$`, func(filename string) { @@ -228,8 +228,8 @@ func init() { }) And(`^I stop recording$`, func() { - _ = sub.Unsubscribe() time.Sleep(time.Second * 5) + _ = sub.Unsubscribe() }) Then(`^all "(.+?)" messages should contain a field "(.+?)" with "(.+?)"$`, func(subject string, field string, val string) { @@ -285,7 +285,7 @@ func init() { } } def = getDefinitionPathAWS(def, serviceName) - ernest("service", "apply", def) + ernest("environment", "apply", def) }) And(`^I apply the definition "(.+?)" with dry option$`, func(def string) { @@ -296,7 +296,7 @@ func init() { } } def = getDefinitionPathAWS(def, serviceName) - ernest("service", "apply", "--dry", def) + ernest("environment", "apply", "--dry", def) }) And(`^message "(.+?)" number "(.+?)" should contain "(.+?)" as json field "(.+?)"$`, func(subject string, num int, val, key string) { @@ -353,12 +353,12 @@ func init() { _, _ = n.Request("user.del", msg, time.Second*3) }) - And(`^the datacenter "(.+?)" does not exist$`, func(d string) { + And(`^the project "(.+?)" does not exist$`, func(d string) { msg := []byte(`{"name":"` + d + `", "type":"aws"}`) _, _ = n.Request("datacenter.del", msg, time.Second*3) }) - And(`^The service "(.+?)" does not exist$`, func(d string) { + And(`^The environment "(.+?)" does not exist$`, func(d string) { msg := []byte(`{"name":"` + d + `", "type":"aws"}`) _, _ = n.Request("service.del", msg, time.Second*3) }) @@ -377,7 +377,7 @@ func init() { _, _ = n.Request("user.set", msg, time.Second*3) }) - And(`^the datacenter "(.+?)" exists$`, func(d string) { + And(`^the project "(.+?)" exists$`, func(d string) { msg := []byte(`{"name":"` + d + `", "type":"aws"}`) _, _ = n.Request("datacenter.del", msg, time.Second*3) msg = []byte(`{"name":"` + d + `"}`) @@ -419,7 +419,7 @@ func init() { } }) - And(`^The azure datacenter "(.+?)" credentials should be "(.+?)", "(.+?)", "(.+?)", "(.+?)" and "(.+?)"$`, func(name, sID, cID, cSecret, tID, env string) { + And(`^The azure project "(.+?)" credentials should be "(.+?)", "(.+?)", "(.+?)", "(.+?)" and "(.+?)"$`, func(name, sID, cID, cSecret, tID, env string) { msg := []byte(`{"name":"` + name + `", "type":"azure"}`) res, _ := n.Request("datacenter.get", msg, time.Second*3) var d struct { @@ -471,7 +471,7 @@ func init() { } }) - And(`^The aws datacenter "(.+?)" credentials should be "(.+?)" and "(.+?)"$`, func(name, token, secret string) { + And(`^The aws project "(.+?)" credentials should be "(.+?)" and "(.+?)"$`, func(name, token, secret string) { msg := []byte(`{"name":"` + name + `", "type":"aws"}`) res, _ := n.Request("datacenter.get", msg, time.Second*3) var d struct { @@ -514,12 +514,12 @@ func init() { } }) - Then(`^The output datacenters table should contain "(.+?)" assigned to "(.+?)" group$`, func(datacenter string, group string) { + Then(`^The output projects table should contain "(.+?)" assigned to "(.+?)" group$`, func(project string, group string) { lines := strings.Split(lastOutput, "\n") for _, l := range lines { - if strings.Contains(l, datacenter) { + if strings.Contains(l, project) { if !strings.Contains(l, "| "+group) { - T.Errorf(`Datacenter doesn't seem to belong to specified group: \n` + l) + T.Errorf(`Project doesn't seem to belong to specified group: \n` + l) } } } @@ -540,8 +540,8 @@ func init() { }) - And(`^I force "(.+?)" to be on status "(.+?)"$`, func(service string, status string) { - _, _ = n.Request("service.set", []byte(`{"name":"`+service+`","status":"`+status+`"}`), time.Second*3) + And(`^I force "(.+?)" to be on status "(.+?)"$`, func(environment string, status string) { + _, _ = n.Request("service.set", []byte(`{"name":"`+environment+`","status":"`+status+`"}`), time.Second*3) }) And(`^File "(.+?)" exists$`, func(filename string) { diff --git a/internal/features/vcloud/add_and_attach_network.feature b/internal/features/vcloud/add_and_attach_network.feature index 6327d7e..dfb3ba6 100644 --- a/internal/features/vcloud/add_and_attach_network.feature +++ b/internal/features/vcloud/add_and_attach_network.feature @@ -1,9 +1,9 @@ @vcloud @add_and_attach_network -Feature: Service apply +Feature: Environment apply Scenario: Add a network and attach a new instance Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "vcloud2.yml" And I start recording diff --git a/internal/features/vcloud/base.feature b/internal/features/vcloud/base.feature index 89b7e04..15354b4 100644 --- a/internal/features/vcloud/base.feature +++ b/internal/features/vcloud/base.feature @@ -1,9 +1,9 @@ @vcloud @vcloud_base -Feature: Service apply +Feature: Environment apply - Scenario: Applying a basic service + Scenario: Applying a basic environment Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I start recording And I apply the definition "vcloud1.yml" diff --git a/internal/features/vcloud/decrease_instances_count.feature b/internal/features/vcloud/decrease_instances_count.feature index 139a7f9..d125879 100644 --- a/internal/features/vcloud/decrease_instances_count.feature +++ b/internal/features/vcloud/decrease_instances_count.feature @@ -1,9 +1,9 @@ @vcloud @decrease_instances_count -Feature: Service apply +Feature: Environment apply Scenario: Decreasing instance count Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "vcloud4.yml" And I start recording diff --git a/internal/features/vcloud/increase_instances_count.feature b/internal/features/vcloud/increase_instances_count.feature index 5380e97..52d06f7 100644 --- a/internal/features/vcloud/increase_instances_count.feature +++ b/internal/features/vcloud/increase_instances_count.feature @@ -1,9 +1,9 @@ @vcloud @increase_instances_count -Feature: Service apply +Feature: Environment apply Scenario: Increasing instance count Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "vcloud3.yml" And I start recording diff --git a/internal/features/vcloud/instance_only.feature b/internal/features/vcloud/instance_only.feature index 4f118c3..7d46879 100644 --- a/internal/features/vcloud/instance_only.feature +++ b/internal/features/vcloud/instance_only.feature @@ -1,9 +1,9 @@ @vcloud @instance_only -Feature: Service apply +Feature: Environment apply - Scenario: Applying an instance only service + Scenario: Applying an instance only environment Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I start recording And I apply the definition "vcloud8.yml" diff --git a/internal/features/vcloud/remove_and_dettach_network.feature b/internal/features/vcloud/remove_and_dettach_network.feature index c3e8cdf..62772aa 100644 --- a/internal/features/vcloud/remove_and_dettach_network.feature +++ b/internal/features/vcloud/remove_and_dettach_network.feature @@ -1,9 +1,9 @@ @vcloud @remove_and_dettach_network -Feature: Service apply +Feature: Environment apply Scenario: Remove a network and dettach an existing instance Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "vcloud3.yml" And I start recording diff --git a/internal/features/vcloud/update_firewall_rules.feature b/internal/features/vcloud/update_firewall_rules.feature index 823e152..ad14a82 100644 --- a/internal/features/vcloud/update_firewall_rules.feature +++ b/internal/features/vcloud/update_firewall_rules.feature @@ -1,9 +1,9 @@ @vcloud @update_firewall_rules -Feature: Service apply +Feature: Environment apply Scenario: Updating router firewall rules Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "vcloud5.yml" And I start recording diff --git a/internal/features/vcloud/update_instances_resource.feature b/internal/features/vcloud/update_instances_resource.feature index df72fc1..e36ac4a 100644 --- a/internal/features/vcloud/update_instances_resource.feature +++ b/internal/features/vcloud/update_instances_resource.feature @@ -1,9 +1,9 @@ @vcloud @update_instances_resource -Feature: Service apply +Feature: Environment apply Scenario: Update existing instance ram and cpu Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "vcloud4.yml" And I start recording diff --git a/internal/features/vcloud/update_nat_rules.feature b/internal/features/vcloud/update_nat_rules.feature index bc42c42..2272137 100644 --- a/internal/features/vcloud/update_nat_rules.feature +++ b/internal/features/vcloud/update_nat_rules.feature @@ -1,9 +1,9 @@ @vcloud @update_nat_rules -Feature: Service apply +Feature: Environment apply Scenario: Updating router nat rules Given I setup ernest with target "https://ernest.local" - And I setup a new service name + And I setup a new environment name When I'm logged in as "usr" / "secret123" And I apply the definition "vcloud5.yml" And I start recording diff --git a/template.yml b/template.yml index 3dca9e2..dcac481 100644 --- a/template.yml +++ b/template.yml @@ -10,7 +10,7 @@ services: volumes: - ./postgres/data:/var/lib/postgresql/data environment: - DB_NAME: users,groups,datacenters,services,usage + DB_NAME: users,groups,datacenters,services,usage,authorizations nginx: image: nginx volumes: From 9d14fa774a6d0b0eae1aec17c4f8ac905b8f2785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Wed, 2 Aug 2017 17:13:33 +0200 Subject: [PATCH 07/34] Azure fixes --- internal/features/azure/creator.feature | 452 ------------------------ 1 file changed, 452 deletions(-) diff --git a/internal/features/azure/creator.feature b/internal/features/azure/creator.feature index c96cc26..dc047f6 100644 --- a/internal/features/azure/creator.feature +++ b/internal/features/azure/creator.feature @@ -706,43 +706,6 @@ Feature: Creator And message "storage_container.create.azure-fake.done" number "0" should contain "_component" as json field "storage_container" And message "storage_container.create.azure-fake.done" number "0" should contain "_component_id" as json field "storage_container::sc1" And message "storage_container.create.azure-fake.done" number "0" should contain "storage_account_name" as json field "r3labssa1" - And an event "network_interface.delete.azure-fake" should be called exactly "1" times - And message "network_interface.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "network_interface.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "network_interface.delete.azure-fake" number "0" should contain "virtual_machine_id" as json field "virtual_machine::web" - And message "network_interface.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "network_interface.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "network_interface.delete.azure-fake" number "0" should contain "_component" as json field "network_interface" - And message "network_interface.delete.azure-fake" number "0" should contain "_component_id" as json field "network_interface::web-2" - And message "network_interface.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And an event "public_ip.delete.azure-fake" should be called exactly "1" times - And message "public_ip.delete.azure-fake" number "0" should contain "_component_id" as json field "public_ip::web-2-config1" - And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "public_ip.delete.azure-fake" number "0" should contain "public_ip_address_allocation" as json field "static" - And message "public_ip.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "public_ip.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "public_ip.delete.azure-fake" number "0" should contain "_component" as json field "public_ip" - And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "public_ip.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "public_ip.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "public_ip.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And an event "network_interface.delete.azure-fake.done" should be called exactly "1" times - And message "network_interface.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "network_interface.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "network_interface.delete.azure-fake.done" number "0" should contain "virtual_machine_id" as json field "virtual_machine::web" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_component" as json field "network_interface" - And message "network_interface.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And message "network_interface.delete.azure-fake.done" number "0" should contain "type" as json field "network_interface.delete.azure-fake.done" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_component_id" as json field "network_interface::web-2" - And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" And an event "group.get" should be called exactly "1" times And an event "public_ip.create.azure-fake.done" should be called exactly "2" times And message "public_ip.create.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" @@ -770,34 +733,6 @@ Feature: Creator And message "public_ip.create.azure-fake.done" number "1" should contain "type" as json field "public_ip.create.azure-fake.done" And message "public_ip.create.azure-fake.done" number "1" should contain "datacenter_type" as json field "azure-fake" And an event "datacenter.find" should be called exactly "1" times - And an event "public_ip.delete.azure-fake.done" should be called exactly "1" times - And message "public_ip.delete.azure-fake.done" number "0" should contain "_component_id" as json field "public_ip::web-2-config1" - And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "public_ip.delete.azure-fake.done" number "0" should contain "public_ip_address_allocation" as json field "static" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "public_ip.delete.azure-fake.done" number "0" should contain "type" as json field "public_ip.delete.azure-fake.done" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "public_ip.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "public_ip.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_component" as json field "public_ip" - And an event "virtual_machine.delete.azure-fake.done" should be called exactly "1" times - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "availability_set" as json field "web" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component" as json field "virtual_machine" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component_id" as json field "virtual_machine::web-2" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "availability_set_id" as json field "$(components.#[_component_id="availability_set::web"].id)" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "type" as json field "virtual_machine.delete.azure-fake.done" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "vm_size" as json field "Standard_DS2_v2" And an event "virtual_machine.create.azure-fake" should be called exactly "2" times And message "virtual_machine.create.azure-fake" number "0" should contain "_component" as json field "virtual_machine" And message "virtual_machine.create.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" @@ -821,20 +756,6 @@ Feature: Creator And message "virtual_machine.create.azure-fake" number "1" should contain "_component_id" as json field "virtual_machine::win-2" And message "virtual_machine.create.azure-fake" number "1" should contain "_state" as json field "running" And message "virtual_machine.create.azure-fake" number "1" should contain "datacenter_name" as json field "fakeazure" - And an event "virtual_machine.delete.azure-fake" should be called exactly "1" times - And message "virtual_machine.delete.azure-fake" number "0" should contain "availability_set_id" as json field "$(components.#[_component_id="availability_set::web"].id)" - And message "virtual_machine.delete.azure-fake" number "0" should contain "vm_size" as json field "Standard_DS2_v2" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake" number "0" should contain "availability_set" as json field "web" - And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "virtual_machine.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_component" as json field "virtual_machine" - And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "virtual_machine.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_component_id" as json field "virtual_machine::web-2" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_state" as json field "running" And an event "subnet.create.azure-fake" should be called exactly "1" times And message "subnet.create.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" And message "subnet.create.azure-fake" number "0" should contain "_component" as json field "subnet" @@ -864,46 +785,6 @@ Feature: Creator And message "sql_database.create.azure-fake" number "0" should contain "_component" as json field "sql_database" And message "sql_database.create.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" And message "sql_database.create.azure-fake" number "0" should contain "location" as json field "westeurope" - And an event "network_interface.delete.azure-fake" should be called exactly "1" times - And message "network_interface.delete.azure-fake" number "0" should contain "_component" as json field "network_interface" - And message "network_interface.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "network_interface.delete.azure-fake" number "0" should contain "virtual_machine_id" as json field "virtual_machine::win" - And message "network_interface.delete.azure-fake" number "0" should contain "_component_id" as json field "network_interface::win-2" - And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "network_interface.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And message "network_interface.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "network_interface.delete.azure-fake" number "0" should contain "network_security_group" as json field "vm-sg" - And message "network_interface.delete.azure-fake" number "0" should contain "network_security_group_id" as json field "$(components.#[_component_id="security_group::vm-sg"].id)" - And message "network_interface.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "network_interface.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And an event "group.get" should be called exactly "1" times - And an event "virtual_machine.delete.azure-fake" should be called exactly "1" times - And message "virtual_machine.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_component" as json field "virtual_machine" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "virtual_machine.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_component_id" as json field "virtual_machine::win-2" - And message "virtual_machine.delete.azure-fake" number "0" should contain "vm_size" as json field "Standard_DS1_v2" - And an event "virtual_machine.delete.azure-fake.done" should be called exactly "1" times - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component" as json field "virtual_machine" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component_id" as json field "virtual_machine::win-2" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "type" as json field "virtual_machine.delete.azure-fake.done" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "vm_size" as json field "Standard_DS1_v2" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" And an event "sql_server.create.azure-fake.done" should be called exactly "1" times And message "sql_server.create.azure-fake.done" number "0" should contain "_component_id" as json field "sql_server::jasonr3labs" And message "sql_server.create.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" @@ -949,31 +830,6 @@ Feature: Creator And message "sql_firewall_rule.create.azure-fake.done" number "0" should contain "_state" as json field "completed" And message "sql_firewall_rule.create.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" And an event "datacenter.find" should be called exactly "1" times - And an event "public_ip.delete.azure-fake" should be called exactly "1" times - And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "public_ip.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "public_ip.delete.azure-fake" number "0" should contain "_component" as json field "public_ip" - And message "public_ip.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "public_ip.delete.azure-fake" number "0" should contain "public_ip_address_allocation" as json field "static" - And message "public_ip.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "public_ip.delete.azure-fake" number "0" should contain "_component_id" as json field "public_ip::win-2-config1" - And message "public_ip.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "public_ip.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And an event "public_ip.delete.azure-fake.done" should be called exactly "1" times - And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "public_ip.delete.azure-fake.done" number "0" should contain "public_ip_address_allocation" as json field "static" - And message "public_ip.delete.azure-fake.done" number "0" should contain "type" as json field "public_ip.delete.azure-fake.done" - And message "public_ip.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_component" as json field "public_ip" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_component_id" as json field "public_ip::win-2-config1" - And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "public_ip.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" And an event "user.get" should be called exactly "1" times And message "user.get" number "0" should contain "username" as json field "usr" And an event "definition.map.creation" should be called exactly "1" times @@ -1005,82 +861,11 @@ Feature: Creator And message "sql_firewall_rule.create.azure-fake" number "0" should contain "_component_id" as json field "sql_firewall_rule::rule1" And message "sql_firewall_rule.create.azure-fake" number "0" should contain "_provider" as json field "azure-fake" And message "sql_firewall_rule.create.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And an event "network_interface.delete.azure-fake.done" should be called exactly "1" times - And message "network_interface.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "network_interface.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And message "network_interface.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "network_interface.delete.azure-fake.done" number "0" should contain "type" as json field "network_interface.delete.azure-fake.done" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_component_id" as json field "network_interface::win-2" - And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "network_interface.delete.azure-fake.done" number "0" should contain "network_security_group_id" as json field "$(components.#[_component_id="security_group::vm-sg"].id)" - And message "network_interface.delete.azure-fake.done" number "0" should contain "network_security_group" as json field "vm-sg" - And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "network_interface.delete.azure-fake.done" number "0" should contain "virtual_machine_id" as json field "virtual_machine::win" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_component" as json field "network_interface" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" And I start recording And I apply the definition "azure6.yml" And I stop recording And an event "user.get" should be called exactly "1" times And message "user.get" number "0" should contain "username" as json field "usr" - And an event "lb_rule.delete.azure-fake.done" should be called exactly "1" times - And message "lb_rule.delete.azure-fake.done" number "0" should contain "_component_id" as json field "lb_rule::http" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "loadbalancer" as json field "lb" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "backend_address_pool_id" as json field "$(components.#[_component_id="lb_backend_address_pool::pool1"].id)" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "frontend_ip_configuration_name" as json field "lbip" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "probe" as json field "http" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "type" as json field "lb_rule.delete.azure-fake.done" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "backend_address_pool" as json field "pool1" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "probe_id" as json field "$(components.#[_component_id="lb_probe::http"].id)" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "_component" as json field "lb_rule" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "protocol" as json field "Tcp" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "lb_rule.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And an event "network_interface.delete.azure-fake" should be called exactly "1" times - And message "network_interface.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "network_interface.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "network_interface.delete.azure-fake" number "0" should contain "_component_id" as json field "network_interface::web-1" - And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "network_interface.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "network_interface.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And message "network_interface.delete.azure-fake" number "0" should contain "virtual_machine_id" as json field "virtual_machine::web" - And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "network_interface.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "network_interface.delete.azure-fake" number "0" should contain "_component" as json field "network_interface" - And an event "network_interface.delete.azure-fake.done" should be called exactly "1" times - And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "network_interface.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_component" as json field "network_interface" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_component_id" as json field "network_interface::web-1" - And message "network_interface.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "network_interface.delete.azure-fake.done" number "0" should contain "virtual_machine_id" as json field "virtual_machine::web" - And message "network_interface.delete.azure-fake.done" number "0" should contain "type" as json field "network_interface.delete.azure-fake.done" - And message "network_interface.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And an event "lb_backend_address_pool.delete.azure-fake" should be called exactly "1" times - And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" - And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "_component" as json field "lb_backend_address_pool" - And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "loadbalancer" as json field "lb" - And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "_component_id" as json field "lb_backend_address_pool::pool1" - And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" And an event "datacenter.find" should be called exactly "1" times And an event "definition.map.creation" should be called exactly "1" times And message "definition.map.creation" number "0" should contain "previous_id" as json field "469d51d1-9524-4dae-6fbc-b7da83b0354f-6bfc681a4807703c77135f2a72c7dc40" @@ -1112,43 +897,6 @@ Feature: Creator And message "network_interface.create.azure-fake.done" number "0" should contain "_component" as json field "network_interface" And message "network_interface.create.azure-fake.done" number "0" should contain "_component_id" as json field "network_interface::win-2" And message "network_interface.create.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And an event "availability_set.delete.azure-fake" should be called exactly "1" times - And message "availability_set.delete.azure-fake" number "0" should contain "_component_id" as json field "availability_set::web" - And message "availability_set.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "availability_set.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And message "availability_set.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "availability_set.delete.azure-fake" number "0" should contain "_component" as json field "availability_set" - And message "availability_set.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "availability_set.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "availability_set.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "availability_set.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "availability_set.delete.azure-fake" number "0" should contain "_state" as json field "running" - And an event "group.get" should be called exactly "1" times - And an event "public_ip.delete.azure-fake.done" should be called exactly "2" times - And message "public_ip.delete.azure-fake.done" number "0" should contain "public_ip_address_allocation" as json field "static" - And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "public_ip.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_component" as json field "public_ip" - And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "public_ip.delete.azure-fake.done" number "0" should contain "_component_id" as json field "public_ip::web-1-config1" - And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "public_ip.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "public_ip.delete.azure-fake.done" number "0" should contain "type" as json field "public_ip.delete.azure-fake.done" - And message "public_ip.delete.azure-fake.done" number "1" should contain "_component_id" as json field "public_ip::lb-lbip" - And message "public_ip.delete.azure-fake.done" number "1" should contain "_action" as json field "delete" - And message "public_ip.delete.azure-fake.done" number "1" should contain "datacenter_name" as json field "fakeazure" - And message "public_ip.delete.azure-fake.done" number "1" should contain "type" as json field "public_ip.delete.azure-fake.done" - And message "public_ip.delete.azure-fake.done" number "1" should contain "_component" as json field "public_ip" - And message "public_ip.delete.azure-fake.done" number "1" should contain "location" as json field "westeurope" - And message "public_ip.delete.azure-fake.done" number "1" should contain "datacenter_region" as json field "westus" - And message "public_ip.delete.azure-fake.done" number "1" should contain "public_ip_address_allocation" as json field "static" - And message "public_ip.delete.azure-fake.done" number "1" should contain "resource_group_name" as json field "az-test" - And message "public_ip.delete.azure-fake.done" number "1" should contain "_state" as json field "completed" - And message "public_ip.delete.azure-fake.done" number "1" should contain "datacenter_type" as json field "azure-fake" - And message "public_ip.delete.azure-fake.done" number "1" should contain "_provider" as json field "azure-fake" And an event "virtual_machine.create.azure-fake" should be called exactly "1" times And message "virtual_machine.create.azure-fake" number "0" should contain "_state" as json field "running" And message "virtual_machine.create.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" @@ -1161,49 +909,6 @@ Feature: Creator And message "virtual_machine.create.azure-fake" number "0" should contain "_component" as json field "virtual_machine" And message "virtual_machine.create.azure-fake" number "0" should contain "_component_id" as json field "virtual_machine::win-2" And message "virtual_machine.create.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And an event "lb.delete.azure-fake" should be called exactly "1" times - And message "lb.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "lb.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "lb.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "lb.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And message "lb.delete.azure-fake" number "0" should contain "_component_id" as json field "lb::lb" - And message "lb.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "lb.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "lb.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "lb.delete.azure-fake" number "0" should contain "_component" as json field "lb" - And message "lb.delete.azure-fake" number "0" should contain "_state" as json field "running" - And an event "lb_rule.delete.azure-fake" should be called exactly "1" times - And message "lb_rule.delete.azure-fake" number "0" should contain "backend_address_pool" as json field "pool1" - And message "lb_rule.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "lb_rule.delete.azure-fake" number "0" should contain "frontend_ip_configuration_name" as json field "lbip" - And message "lb_rule.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "lb_rule.delete.azure-fake" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" - And message "lb_rule.delete.azure-fake" number "0" should contain "protocol" as json field "Tcp" - And message "lb_rule.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "lb_rule.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "lb_rule.delete.azure-fake" number "0" should contain "_component" as json field "lb_rule" - And message "lb_rule.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "lb_rule.delete.azure-fake" number "0" should contain "probe_id" as json field "$(components.#[_component_id="lb_probe::http"].id)" - And message "lb_rule.delete.azure-fake" number "0" should contain "_component_id" as json field "lb_rule::http" - And message "lb_rule.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "lb_rule.delete.azure-fake" number "0" should contain "loadbalancer" as json field "lb" - And message "lb_rule.delete.azure-fake" number "0" should contain "backend_address_pool_id" as json field "$(components.#[_component_id="lb_backend_address_pool::pool1"].id)" - And message "lb_rule.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "lb_rule.delete.azure-fake" number "0" should contain "probe" as json field "http" - And an event "virtual_machine.delete.azure-fake" should be called exactly "1" times - And message "virtual_machine.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "virtual_machine.delete.azure-fake" number "0" should contain "availability_set_id" as json field "$(components.#[_component_id="availability_set::web"].id)" - And message "virtual_machine.delete.azure-fake" number "0" should contain "availability_set" as json field "web" - And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake" number "0" should contain "vm_size" as json field "Standard_DS2_v2" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And message "virtual_machine.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_component" as json field "virtual_machine" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_component_id" as json field "virtual_machine::web-1" - And message "virtual_machine.delete.azure-fake" number "0" should contain "_state" as json field "running" And an event "public_ip.create.azure-fake" should be called exactly "1" times And message "public_ip.create.azure-fake" number "0" should contain "datacenter_region" as json field "westus" And message "public_ip.create.azure-fake" number "0" should contain "_component" as json field "public_ip" @@ -1215,57 +920,6 @@ Feature: Creator And message "public_ip.create.azure-fake" number "0" should contain "_component_id" as json field "public_ip::win-2-config1" And message "public_ip.create.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" And message "public_ip.create.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "public_ip.create.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And an event "availability_set.delete.azure-fake.done" should be called exactly "1" times - And message "availability_set.delete.azure-fake.done" number "0" should contain "_component" as json field "availability_set" - And message "availability_set.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "availability_set.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "availability_set.delete.azure-fake.done" number "0" should contain "type" as json field "availability_set.delete.azure-fake.done" - And message "availability_set.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And message "availability_set.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "availability_set.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "availability_set.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "availability_set.delete.azure-fake.done" number "0" should contain "_component_id" as json field "availability_set::web" - And message "availability_set.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "availability_set.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And an event "public_ip.delete.azure-fake" should be called exactly "2" times - And message "public_ip.delete.azure-fake" number "0" should contain "_component" as json field "public_ip" - And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "public_ip.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "public_ip.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "public_ip.delete.azure-fake" number "0" should contain "_component_id" as json field "public_ip::web-1-config1" - And message "public_ip.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "public_ip.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And message "public_ip.delete.azure-fake" number "0" should contain "public_ip_address_allocation" as json field "static" - And message "public_ip.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "public_ip.delete.azure-fake" number "1" should contain "_action" as json field "delete" - And message "public_ip.delete.azure-fake" number "1" should contain "_component_id" as json field "public_ip::lb-lbip" - And message "public_ip.delete.azure-fake" number "1" should contain "datacenter_name" as json field "fakeazure" - And message "public_ip.delete.azure-fake" number "1" should contain "datacenter_region" as json field "westus" - And message "public_ip.delete.azure-fake" number "1" should contain "location" as json field "westeurope" - And message "public_ip.delete.azure-fake" number "1" should contain "public_ip_address_allocation" as json field "static" - And message "public_ip.delete.azure-fake" number "1" should contain "_component" as json field "public_ip" - And message "public_ip.delete.azure-fake" number "1" should contain "_provider" as json field "azure-fake" - And message "public_ip.delete.azure-fake" number "1" should contain "_state" as json field "running" - And message "public_ip.delete.azure-fake" number "1" should contain "resource_group_name" as json field "az-test" - And message "public_ip.delete.azure-fake" number "1" should contain "datacenter_type" as json field "azure-fake" - And an event "virtual_machine.delete.azure-fake.done" should be called exactly "1" times - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "availability_set_id" as json field "$(components.#[_component_id="availability_set::web"].id)" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "availability_set" as json field "web" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component" as json field "virtual_machine" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component_id" as json field "virtual_machine::web-1" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "type" as json field "virtual_machine.delete.azure-fake.done" - And message "virtual_machine.delete.azure-fake.done" number "0" should contain "vm_size" as json field "Standard_DS2_v2" And an event "virtual_machine.create.azure-fake.done" should be called exactly "1" times And message "virtual_machine.create.azure-fake.done" number "0" should contain "_action" as json field "create" And message "virtual_machine.create.azure-fake.done" number "0" should contain "_component" as json field "virtual_machine" @@ -1279,56 +933,6 @@ Feature: Creator And message "virtual_machine.create.azure-fake.done" number "0" should contain "location" as json field "westeurope" And message "virtual_machine.create.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" And message "virtual_machine.create.azure-fake.done" number "0" should contain "vm_size" as json field "Standard_DS1_v2" - And an event "security_group.delete.azure-fake" should be called exactly "1" times - And message "security_group.delete.azure-fake" number "0" should contain "location" as json field "westeurope" - And message "security_group.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "security_group.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "security_group.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "security_group.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "security_group.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "security_group.delete.azure-fake" number "0" should contain "_component" as json field "security_group" - And message "security_group.delete.azure-fake" number "0" should contain "_component_id" as json field "security_group::subnet-sg" - And message "security_group.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "security_group.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And an event "lb_probe.delete.azure-fake.done" should be called exactly "1" times - And message "lb_probe.delete.azure-fake.done" number "0" should contain "_component_id" as json field "lb_probe::http" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "protocol" as json field "Http" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "_component" as json field "lb_probe" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "request_path" as json field "/" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "type" as json field "lb_probe.delete.azure-fake.done" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "loadbalancer" as json field "lb" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "lb_probe.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And an event "security_group.delete.azure-fake.done" should be called exactly "1" times - And message "security_group.delete.azure-fake.done" number "0" should contain "_component" as json field "security_group" - And message "security_group.delete.azure-fake.done" number "0" should contain "_component_id" as json field "security_group::subnet-sg" - And message "security_group.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "security_group.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "security_group.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "security_group.delete.azure-fake.done" number "0" should contain "type" as json field "security_group.delete.azure-fake.done" - And message "security_group.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "security_group.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "security_group.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "security_group.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "security_group.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And an event "lb.delete.azure-fake.done" should be called exactly "1" times - And message "lb.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "lb.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" - And message "lb.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "lb.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "lb.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "lb.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "lb.delete.azure-fake.done" number "0" should contain "_component_id" as json field "lb::lb" - And message "lb.delete.azure-fake.done" number "0" should contain "type" as json field "lb.delete.azure-fake.done" - And message "lb.delete.azure-fake.done" number "0" should contain "_component" as json field "lb" - And message "lb.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "lb.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" And an event "network_interface.create.azure-fake" should be called exactly "1" times And message "network_interface.create.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" And message "network_interface.create.azure-fake" number "0" should contain "network_security_group" as json field "vm-sg" @@ -1343,59 +947,3 @@ Feature: Creator And message "network_interface.create.azure-fake" number "0" should contain "virtual_machine_id" as json field "virtual_machine::win" And message "network_interface.create.azure-fake" number "0" should contain "location" as json field "westeurope" And message "network_interface.create.azure-fake" number "0" should contain "network_security_group_id" as json field "$(components.#[_component_id="security_group::vm-sg"].id)" - And an event "lb_probe.delete.azure-fake" should be called exactly "1" times - And message "lb_probe.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "lb_probe.delete.azure-fake" number "0" should contain "_component_id" as json field "lb_probe::http" - And message "lb_probe.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "lb_probe.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "lb_probe.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "lb_probe.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And message "lb_probe.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "lb_probe.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "lb_probe.delete.azure-fake" number "0" should contain "protocol" as json field "Http" - And message "lb_probe.delete.azure-fake" number "0" should contain "_component" as json field "lb_probe" - And message "lb_probe.delete.azure-fake" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" - And message "lb_probe.delete.azure-fake" number "0" should contain "loadbalancer" as json field "lb" - And message "lb_probe.delete.azure-fake" number "0" should contain "request_path" as json field "/" - And an event "lb_backend_address_pool.delete.azure-fake.done" should be called exactly "1" times - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "_component" as json field "lb_backend_address_pool" - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "loadbalancer" as json field "lb" - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "type" as json field "lb_backend_address_pool.delete.azure-fake.done" - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "_component_id" as json field "lb_backend_address_pool::pool1" - And an event "subnet.delete.azure-fake" should be called exactly "1" times - And message "subnet.delete.azure-fake" number "0" should contain "_action" as json field "delete" - And message "subnet.delete.azure-fake" number "0" should contain "address_prefix" as json field "10.0.1.0/24" - And message "subnet.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "subnet.delete.azure-fake" number "0" should contain "_component" as json field "subnet" - And message "subnet.delete.azure-fake" number "0" should contain "network_security_group" as json field "subnet-sg" - And message "subnet.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" - And message "subnet.delete.azure-fake" number "0" should contain "network_security_group_id" as json field "$(components.#[_component_id="security_group::subnet-sg"].id)" - And message "subnet.delete.azure-fake" number "0" should contain "_state" as json field "running" - And message "subnet.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" - And message "subnet.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "subnet.delete.azure-fake" number "0" should contain "virtual_network_name" as json field "net" - And message "subnet.delete.azure-fake" number "0" should contain "_component_id" as json field "subnet::sub1" - And message "subnet.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" - And an event "subnet.delete.azure-fake.done" should be called exactly "1" times - And message "subnet.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" - And message "subnet.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" - And message "subnet.delete.azure-fake.done" number "0" should contain "network_security_group_id" as json field "$(components.#[_component_id="security_group::subnet-sg"].id)" - And message "subnet.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" - And message "subnet.delete.azure-fake.done" number "0" should contain "_component" as json field "subnet" - And message "subnet.delete.azure-fake.done" number "0" should contain "virtual_network_name" as json field "net" - And message "subnet.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" - And message "subnet.delete.azure-fake.done" number "0" should contain "network_security_group" as json field "subnet-sg" - And message "subnet.delete.azure-fake.done" number "0" should contain "type" as json field "subnet.delete.azure-fake.done" - And message "subnet.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" - And message "subnet.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" - And message "subnet.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And message "subnet.delete.azure-fake.done" number "0" should contain "_component_id" as json field "subnet::sub1" - And message "subnet.delete.azure-fake.done" number "0" should contain "address_prefix" as json field "10.0.1.0/24" From 669da0eef3c5511ba910d93b0a28fa35b98badfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Thu, 3 Aug 2017 08:01:55 +0200 Subject: [PATCH 08/34] Azure fixes --- internal/features/azure/creator.feature | 458 +++++++++++++++++- .../features/cli/{roles.feature => roles.bk} | 0 2 files changed, 450 insertions(+), 8 deletions(-) rename internal/features/cli/{roles.feature => roles.bk} (100%) diff --git a/internal/features/azure/creator.feature b/internal/features/azure/creator.feature index dc047f6..c055ae6 100644 --- a/internal/features/azure/creator.feature +++ b/internal/features/azure/creator.feature @@ -197,7 +197,6 @@ Feature: Creator And message "virtual_machine.create.azure-fake" number "1" should contain "_state" as json field "running" And message "virtual_machine.create.azure-fake" number "1" should contain "vm_size" as json field "Standard_DS1_v2" And message "virtual_machine.create.azure-fake" number "1" should contain "datacenter_type" as json field "azure-fake" - And an event "group.get" should be called exactly "1" times And an event "virtual_machine.create.azure-fake.done" should be called exactly "2" times And message "virtual_machine.create.azure-fake.done" number "0" should contain "availability_set" as json field "web" And message "virtual_machine.create.azure-fake.done" number "0" should contain "type" as json field "virtual_machine.create.azure-fake.done" @@ -340,7 +339,6 @@ Feature: Creator And message "subnet.create.azure-fake.done" number "0" should contain "_state" as json field "completed" And message "subnet.create.azure-fake.done" number "0" should contain "network_security_group" as json field "subnet-sg" And message "subnet.create.azure-fake.done" number "0" should contain "network_security_group_id" as json field "$(components.#[_component_id="security_group::subnet-sg"].id)" - And an event "datacenter.find" should be called exactly "1" times And an event "lb.create.azure-fake.done" should be called exactly "1" times And message "lb.create.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" And message "lb.create.azure-fake.done" number "0" should contain "_action" as json field "create" @@ -453,8 +451,6 @@ Feature: Creator And message "virtual_machine.update.azure-fake" number "1" should contain "_state" as json field "running" And message "virtual_machine.update.azure-fake" number "1" should contain "datacenter_type" as json field "azure-fake" And message "virtual_machine.update.azure-fake" number "1" should contain "location" as json field "westeurope" - And an event "datacenter.find" should be called exactly "1" times - And an event "group.get" should be called exactly "1" times And an event "security_group.update.azure-fake.done" should be called exactly "1" times And message "security_group.update.azure-fake.done" number "0" should contain "_component" as json field "security_group" And message "security_group.update.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" @@ -706,7 +702,43 @@ Feature: Creator And message "storage_container.create.azure-fake.done" number "0" should contain "_component" as json field "storage_container" And message "storage_container.create.azure-fake.done" number "0" should contain "_component_id" as json field "storage_container::sc1" And message "storage_container.create.azure-fake.done" number "0" should contain "storage_account_name" as json field "r3labssa1" - And an event "group.get" should be called exactly "1" times + And an event "network_interface.delete.azure-fake" should be called exactly "1" times + And message "network_interface.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "network_interface.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "network_interface.delete.azure-fake" number "0" should contain "virtual_machine_id" as json field "virtual_machine::web" + And message "network_interface.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "network_interface.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "network_interface.delete.azure-fake" number "0" should contain "_component" as json field "network_interface" + And message "network_interface.delete.azure-fake" number "0" should contain "_component_id" as json field "network_interface::web-2" + And message "network_interface.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And an event "public_ip.delete.azure-fake" should be called exactly "1" times + And message "public_ip.delete.azure-fake" number "0" should contain "_component_id" as json field "public_ip::web-2-config1" + And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "public_ip.delete.azure-fake" number "0" should contain "public_ip_address_allocation" as json field "static" + And message "public_ip.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "public_ip.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "public_ip.delete.azure-fake" number "0" should contain "_component" as json field "public_ip" + And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "public_ip.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "public_ip.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "public_ip.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And an event "network_interface.delete.azure-fake.done" should be called exactly "1" times + And message "network_interface.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "network_interface.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "network_interface.delete.azure-fake.done" number "0" should contain "virtual_machine_id" as json field "virtual_machine::web" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_component" as json field "network_interface" + And message "network_interface.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And message "network_interface.delete.azure-fake.done" number "0" should contain "type" as json field "network_interface.delete.azure-fake.done" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_component_id" as json field "network_interface::web-2" + And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" And an event "public_ip.create.azure-fake.done" should be called exactly "2" times And message "public_ip.create.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" And message "public_ip.create.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" @@ -732,7 +764,34 @@ Feature: Creator And message "public_ip.create.azure-fake.done" number "1" should contain "resource_group_name" as json field "az-test" And message "public_ip.create.azure-fake.done" number "1" should contain "type" as json field "public_ip.create.azure-fake.done" And message "public_ip.create.azure-fake.done" number "1" should contain "datacenter_type" as json field "azure-fake" - And an event "datacenter.find" should be called exactly "1" times + And an event "public_ip.delete.azure-fake.done" should be called exactly "1" times + And message "public_ip.delete.azure-fake.done" number "0" should contain "_component_id" as json field "public_ip::web-2-config1" + And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "public_ip.delete.azure-fake.done" number "0" should contain "public_ip_address_allocation" as json field "static" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "public_ip.delete.azure-fake.done" number "0" should contain "type" as json field "public_ip.delete.azure-fake.done" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "public_ip.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "public_ip.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_component" as json field "public_ip" + And an event "virtual_machine.delete.azure-fake.done" should be called exactly "1" times + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "availability_set" as json field "web" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component" as json field "virtual_machine" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component_id" as json field "virtual_machine::web-2" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "availability_set_id" as json field "$(components.#[_component_id="availability_set::web"].id)" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "type" as json field "virtual_machine.delete.azure-fake.done" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "vm_size" as json field "Standard_DS2_v2" And an event "virtual_machine.create.azure-fake" should be called exactly "2" times And message "virtual_machine.create.azure-fake" number "0" should contain "_component" as json field "virtual_machine" And message "virtual_machine.create.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" @@ -756,6 +815,20 @@ Feature: Creator And message "virtual_machine.create.azure-fake" number "1" should contain "_component_id" as json field "virtual_machine::win-2" And message "virtual_machine.create.azure-fake" number "1" should contain "_state" as json field "running" And message "virtual_machine.create.azure-fake" number "1" should contain "datacenter_name" as json field "fakeazure" + And an event "virtual_machine.delete.azure-fake" should be called exactly "1" times + And message "virtual_machine.delete.azure-fake" number "0" should contain "availability_set_id" as json field "$(components.#[_component_id="availability_set::web"].id)" + And message "virtual_machine.delete.azure-fake" number "0" should contain "vm_size" as json field "Standard_DS2_v2" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake" number "0" should contain "availability_set" as json field "web" + And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "virtual_machine.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_component" as json field "virtual_machine" + And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "virtual_machine.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_component_id" as json field "virtual_machine::web-2" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_state" as json field "running" And an event "subnet.create.azure-fake" should be called exactly "1" times And message "subnet.create.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" And message "subnet.create.azure-fake" number "0" should contain "_component" as json field "subnet" @@ -785,6 +858,45 @@ Feature: Creator And message "sql_database.create.azure-fake" number "0" should contain "_component" as json field "sql_database" And message "sql_database.create.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" And message "sql_database.create.azure-fake" number "0" should contain "location" as json field "westeurope" + And an event "network_interface.delete.azure-fake" should be called exactly "1" times + And message "network_interface.delete.azure-fake" number "0" should contain "_component" as json field "network_interface" + And message "network_interface.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "network_interface.delete.azure-fake" number "0" should contain "virtual_machine_id" as json field "virtual_machine::win" + And message "network_interface.delete.azure-fake" number "0" should contain "_component_id" as json field "network_interface::win-2" + And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "network_interface.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And message "network_interface.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "network_interface.delete.azure-fake" number "0" should contain "network_security_group" as json field "vm-sg" + And message "network_interface.delete.azure-fake" number "0" should contain "network_security_group_id" as json field "$(components.#[_component_id="security_group::vm-sg"].id)" + And message "network_interface.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "network_interface.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And an event "virtual_machine.delete.azure-fake" should be called exactly "1" times + And message "virtual_machine.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_component" as json field "virtual_machine" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "virtual_machine.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_component_id" as json field "virtual_machine::win-2" + And message "virtual_machine.delete.azure-fake" number "0" should contain "vm_size" as json field "Standard_DS1_v2" + And an event "virtual_machine.delete.azure-fake.done" should be called exactly "1" times + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component" as json field "virtual_machine" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component_id" as json field "virtual_machine::win-2" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "type" as json field "virtual_machine.delete.azure-fake.done" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "vm_size" as json field "Standard_DS1_v2" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" And an event "sql_server.create.azure-fake.done" should be called exactly "1" times And message "sql_server.create.azure-fake.done" number "0" should contain "_component_id" as json field "sql_server::jasonr3labs" And message "sql_server.create.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" @@ -829,7 +941,31 @@ Feature: Creator And message "sql_firewall_rule.create.azure-fake.done" number "0" should contain "_component" as json field "sql_firewall_rule" And message "sql_firewall_rule.create.azure-fake.done" number "0" should contain "_state" as json field "completed" And message "sql_firewall_rule.create.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" - And an event "datacenter.find" should be called exactly "1" times + And an event "public_ip.delete.azure-fake" should be called exactly "1" times + And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "public_ip.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "public_ip.delete.azure-fake" number "0" should contain "_component" as json field "public_ip" + And message "public_ip.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "public_ip.delete.azure-fake" number "0" should contain "public_ip_address_allocation" as json field "static" + And message "public_ip.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "public_ip.delete.azure-fake" number "0" should contain "_component_id" as json field "public_ip::win-2-config1" + And message "public_ip.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "public_ip.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And an event "public_ip.delete.azure-fake.done" should be called exactly "1" times + And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "public_ip.delete.azure-fake.done" number "0" should contain "public_ip_address_allocation" as json field "static" + And message "public_ip.delete.azure-fake.done" number "0" should contain "type" as json field "public_ip.delete.azure-fake.done" + And message "public_ip.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_component" as json field "public_ip" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_component_id" as json field "public_ip::win-2-config1" + And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "public_ip.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" And an event "user.get" should be called exactly "1" times And message "user.get" number "0" should contain "username" as json field "usr" And an event "definition.map.creation" should be called exactly "1" times @@ -861,12 +997,82 @@ Feature: Creator And message "sql_firewall_rule.create.azure-fake" number "0" should contain "_component_id" as json field "sql_firewall_rule::rule1" And message "sql_firewall_rule.create.azure-fake" number "0" should contain "_provider" as json field "azure-fake" And message "sql_firewall_rule.create.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And an event "network_interface.delete.azure-fake.done" should be called exactly "1" times + And message "network_interface.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "network_interface.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And message "network_interface.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "network_interface.delete.azure-fake.done" number "0" should contain "type" as json field "network_interface.delete.azure-fake.done" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_component_id" as json field "network_interface::win-2" + And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "network_interface.delete.azure-fake.done" number "0" should contain "network_security_group_id" as json field "$(components.#[_component_id="security_group::vm-sg"].id)" + And message "network_interface.delete.azure-fake.done" number "0" should contain "network_security_group" as json field "vm-sg" + And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "network_interface.delete.azure-fake.done" number "0" should contain "virtual_machine_id" as json field "virtual_machine::win" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_component" as json field "network_interface" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" And I start recording And I apply the definition "azure6.yml" And I stop recording And an event "user.get" should be called exactly "1" times And message "user.get" number "0" should contain "username" as json field "usr" - And an event "datacenter.find" should be called exactly "1" times + And an event "lb_rule.delete.azure-fake.done" should be called exactly "1" times + And message "lb_rule.delete.azure-fake.done" number "0" should contain "_component_id" as json field "lb_rule::http" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "loadbalancer" as json field "lb" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "backend_address_pool_id" as json field "$(components.#[_component_id="lb_backend_address_pool::pool1"].id)" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "frontend_ip_configuration_name" as json field "lbip" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "probe" as json field "http" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "type" as json field "lb_rule.delete.azure-fake.done" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "backend_address_pool" as json field "pool1" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "probe_id" as json field "$(components.#[_component_id="lb_probe::http"].id)" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "_component" as json field "lb_rule" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "protocol" as json field "Tcp" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "lb_rule.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And an event "network_interface.delete.azure-fake" should be called exactly "1" times + And message "network_interface.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "network_interface.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "network_interface.delete.azure-fake" number "0" should contain "_component_id" as json field "network_interface::web-1" + And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "network_interface.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "network_interface.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And message "network_interface.delete.azure-fake" number "0" should contain "virtual_machine_id" as json field "virtual_machine::web" + And message "network_interface.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "network_interface.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "network_interface.delete.azure-fake" number "0" should contain "_component" as json field "network_interface" + And an event "network_interface.delete.azure-fake.done" should be called exactly "1" times + And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "network_interface.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "network_interface.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_component" as json field "network_interface" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_component_id" as json field "network_interface::web-1" + And message "network_interface.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "network_interface.delete.azure-fake.done" number "0" should contain "virtual_machine_id" as json field "virtual_machine::web" + And message "network_interface.delete.azure-fake.done" number "0" should contain "type" as json field "network_interface.delete.azure-fake.done" + And message "network_interface.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And an event "lb_backend_address_pool.delete.azure-fake" should be called exactly "1" times + And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" + And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "_component" as json field "lb_backend_address_pool" + And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "loadbalancer" as json field "lb" + And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "_component_id" as json field "lb_backend_address_pool::pool1" + And message "lb_backend_address_pool.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" And an event "definition.map.creation" should be called exactly "1" times And message "definition.map.creation" number "0" should contain "previous_id" as json field "469d51d1-9524-4dae-6fbc-b7da83b0354f-6bfc681a4807703c77135f2a72c7dc40" And an event "public_ip.create.azure-fake.done" should be called exactly "1" times @@ -897,6 +1103,42 @@ Feature: Creator And message "network_interface.create.azure-fake.done" number "0" should contain "_component" as json field "network_interface" And message "network_interface.create.azure-fake.done" number "0" should contain "_component_id" as json field "network_interface::win-2" And message "network_interface.create.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And an event "availability_set.delete.azure-fake" should be called exactly "1" times + And message "availability_set.delete.azure-fake" number "0" should contain "_component_id" as json field "availability_set::web" + And message "availability_set.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "availability_set.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And message "availability_set.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "availability_set.delete.azure-fake" number "0" should contain "_component" as json field "availability_set" + And message "availability_set.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "availability_set.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "availability_set.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "availability_set.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "availability_set.delete.azure-fake" number "0" should contain "_state" as json field "running" + And an event "public_ip.delete.azure-fake.done" should be called exactly "2" times + And message "public_ip.delete.azure-fake.done" number "0" should contain "public_ip_address_allocation" as json field "static" + And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "public_ip.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_component" as json field "public_ip" + And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "public_ip.delete.azure-fake.done" number "0" should contain "_component_id" as json field "public_ip::web-1-config1" + And message "public_ip.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "public_ip.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "public_ip.delete.azure-fake.done" number "0" should contain "type" as json field "public_ip.delete.azure-fake.done" + And message "public_ip.delete.azure-fake.done" number "1" should contain "_component_id" as json field "public_ip::lb-lbip" + And message "public_ip.delete.azure-fake.done" number "1" should contain "_action" as json field "delete" + And message "public_ip.delete.azure-fake.done" number "1" should contain "datacenter_name" as json field "fakeazure" + And message "public_ip.delete.azure-fake.done" number "1" should contain "type" as json field "public_ip.delete.azure-fake.done" + And message "public_ip.delete.azure-fake.done" number "1" should contain "_component" as json field "public_ip" + And message "public_ip.delete.azure-fake.done" number "1" should contain "location" as json field "westeurope" + And message "public_ip.delete.azure-fake.done" number "1" should contain "datacenter_region" as json field "westus" + And message "public_ip.delete.azure-fake.done" number "1" should contain "public_ip_address_allocation" as json field "static" + And message "public_ip.delete.azure-fake.done" number "1" should contain "resource_group_name" as json field "az-test" + And message "public_ip.delete.azure-fake.done" number "1" should contain "_state" as json field "completed" + And message "public_ip.delete.azure-fake.done" number "1" should contain "datacenter_type" as json field "azure-fake" + And message "public_ip.delete.azure-fake.done" number "1" should contain "_provider" as json field "azure-fake" And an event "virtual_machine.create.azure-fake" should be called exactly "1" times And message "virtual_machine.create.azure-fake" number "0" should contain "_state" as json field "running" And message "virtual_machine.create.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" @@ -909,6 +1151,49 @@ Feature: Creator And message "virtual_machine.create.azure-fake" number "0" should contain "_component" as json field "virtual_machine" And message "virtual_machine.create.azure-fake" number "0" should contain "_component_id" as json field "virtual_machine::win-2" And message "virtual_machine.create.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And an event "lb.delete.azure-fake" should be called exactly "1" times + And message "lb.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "lb.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "lb.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "lb.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And message "lb.delete.azure-fake" number "0" should contain "_component_id" as json field "lb::lb" + And message "lb.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "lb.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "lb.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "lb.delete.azure-fake" number "0" should contain "_component" as json field "lb" + And message "lb.delete.azure-fake" number "0" should contain "_state" as json field "running" + And an event "lb_rule.delete.azure-fake" should be called exactly "1" times + And message "lb_rule.delete.azure-fake" number "0" should contain "backend_address_pool" as json field "pool1" + And message "lb_rule.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "lb_rule.delete.azure-fake" number "0" should contain "frontend_ip_configuration_name" as json field "lbip" + And message "lb_rule.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "lb_rule.delete.azure-fake" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" + And message "lb_rule.delete.azure-fake" number "0" should contain "protocol" as json field "Tcp" + And message "lb_rule.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "lb_rule.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "lb_rule.delete.azure-fake" number "0" should contain "_component" as json field "lb_rule" + And message "lb_rule.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "lb_rule.delete.azure-fake" number "0" should contain "probe_id" as json field "$(components.#[_component_id="lb_probe::http"].id)" + And message "lb_rule.delete.azure-fake" number "0" should contain "_component_id" as json field "lb_rule::http" + And message "lb_rule.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "lb_rule.delete.azure-fake" number "0" should contain "loadbalancer" as json field "lb" + And message "lb_rule.delete.azure-fake" number "0" should contain "backend_address_pool_id" as json field "$(components.#[_component_id="lb_backend_address_pool::pool1"].id)" + And message "lb_rule.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "lb_rule.delete.azure-fake" number "0" should contain "probe" as json field "http" + And an event "virtual_machine.delete.azure-fake" should be called exactly "1" times + And message "virtual_machine.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "virtual_machine.delete.azure-fake" number "0" should contain "availability_set_id" as json field "$(components.#[_component_id="availability_set::web"].id)" + And message "virtual_machine.delete.azure-fake" number "0" should contain "availability_set" as json field "web" + And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "virtual_machine.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake" number "0" should contain "vm_size" as json field "Standard_DS2_v2" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And message "virtual_machine.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_component" as json field "virtual_machine" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_component_id" as json field "virtual_machine::web-1" + And message "virtual_machine.delete.azure-fake" number "0" should contain "_state" as json field "running" And an event "public_ip.create.azure-fake" should be called exactly "1" times And message "public_ip.create.azure-fake" number "0" should contain "datacenter_region" as json field "westus" And message "public_ip.create.azure-fake" number "0" should contain "_component" as json field "public_ip" @@ -920,6 +1205,57 @@ Feature: Creator And message "public_ip.create.azure-fake" number "0" should contain "_component_id" as json field "public_ip::win-2-config1" And message "public_ip.create.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" And message "public_ip.create.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "public_ip.create.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And an event "availability_set.delete.azure-fake.done" should be called exactly "1" times + And message "availability_set.delete.azure-fake.done" number "0" should contain "_component" as json field "availability_set" + And message "availability_set.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "availability_set.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "availability_set.delete.azure-fake.done" number "0" should contain "type" as json field "availability_set.delete.azure-fake.done" + And message "availability_set.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And message "availability_set.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "availability_set.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "availability_set.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "availability_set.delete.azure-fake.done" number "0" should contain "_component_id" as json field "availability_set::web" + And message "availability_set.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "availability_set.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And an event "public_ip.delete.azure-fake" should be called exactly "2" times + And message "public_ip.delete.azure-fake" number "0" should contain "_component" as json field "public_ip" + And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "public_ip.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "public_ip.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "public_ip.delete.azure-fake" number "0" should contain "_component_id" as json field "public_ip::web-1-config1" + And message "public_ip.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "public_ip.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And message "public_ip.delete.azure-fake" number "0" should contain "public_ip_address_allocation" as json field "static" + And message "public_ip.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "public_ip.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "public_ip.delete.azure-fake" number "1" should contain "_action" as json field "delete" + And message "public_ip.delete.azure-fake" number "1" should contain "_component_id" as json field "public_ip::lb-lbip" + And message "public_ip.delete.azure-fake" number "1" should contain "datacenter_name" as json field "fakeazure" + And message "public_ip.delete.azure-fake" number "1" should contain "datacenter_region" as json field "westus" + And message "public_ip.delete.azure-fake" number "1" should contain "location" as json field "westeurope" + And message "public_ip.delete.azure-fake" number "1" should contain "public_ip_address_allocation" as json field "static" + And message "public_ip.delete.azure-fake" number "1" should contain "_component" as json field "public_ip" + And message "public_ip.delete.azure-fake" number "1" should contain "_provider" as json field "azure-fake" + And message "public_ip.delete.azure-fake" number "1" should contain "_state" as json field "running" + And message "public_ip.delete.azure-fake" number "1" should contain "resource_group_name" as json field "az-test" + And message "public_ip.delete.azure-fake" number "1" should contain "datacenter_type" as json field "azure-fake" + And an event "virtual_machine.delete.azure-fake.done" should be called exactly "1" times + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "availability_set_id" as json field "$(components.#[_component_id="availability_set::web"].id)" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "availability_set" as json field "web" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component" as json field "virtual_machine" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_component_id" as json field "virtual_machine::web-1" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "type" as json field "virtual_machine.delete.azure-fake.done" + And message "virtual_machine.delete.azure-fake.done" number "0" should contain "vm_size" as json field "Standard_DS2_v2" And an event "virtual_machine.create.azure-fake.done" should be called exactly "1" times And message "virtual_machine.create.azure-fake.done" number "0" should contain "_action" as json field "create" And message "virtual_machine.create.azure-fake.done" number "0" should contain "_component" as json field "virtual_machine" @@ -933,6 +1269,56 @@ Feature: Creator And message "virtual_machine.create.azure-fake.done" number "0" should contain "location" as json field "westeurope" And message "virtual_machine.create.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" And message "virtual_machine.create.azure-fake.done" number "0" should contain "vm_size" as json field "Standard_DS1_v2" + And an event "security_group.delete.azure-fake" should be called exactly "1" times + And message "security_group.delete.azure-fake" number "0" should contain "location" as json field "westeurope" + And message "security_group.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "security_group.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "security_group.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "security_group.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "security_group.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "security_group.delete.azure-fake" number "0" should contain "_component" as json field "security_group" + And message "security_group.delete.azure-fake" number "0" should contain "_component_id" as json field "security_group::subnet-sg" + And message "security_group.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "security_group.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And an event "lb_probe.delete.azure-fake.done" should be called exactly "1" times + And message "lb_probe.delete.azure-fake.done" number "0" should contain "_component_id" as json field "lb_probe::http" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "protocol" as json field "Http" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "_component" as json field "lb_probe" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "request_path" as json field "/" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "type" as json field "lb_probe.delete.azure-fake.done" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "loadbalancer" as json field "lb" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "lb_probe.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And an event "security_group.delete.azure-fake.done" should be called exactly "1" times + And message "security_group.delete.azure-fake.done" number "0" should contain "_component" as json field "security_group" + And message "security_group.delete.azure-fake.done" number "0" should contain "_component_id" as json field "security_group::subnet-sg" + And message "security_group.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "security_group.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "security_group.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "security_group.delete.azure-fake.done" number "0" should contain "type" as json field "security_group.delete.azure-fake.done" + And message "security_group.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "security_group.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "security_group.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "security_group.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "security_group.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And an event "lb.delete.azure-fake.done" should be called exactly "1" times + And message "lb.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "lb.delete.azure-fake.done" number "0" should contain "location" as json field "westeurope" + And message "lb.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "lb.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "lb.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "lb.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "lb.delete.azure-fake.done" number "0" should contain "_component_id" as json field "lb::lb" + And message "lb.delete.azure-fake.done" number "0" should contain "type" as json field "lb.delete.azure-fake.done" + And message "lb.delete.azure-fake.done" number "0" should contain "_component" as json field "lb" + And message "lb.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "lb.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" And an event "network_interface.create.azure-fake" should be called exactly "1" times And message "network_interface.create.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" And message "network_interface.create.azure-fake" number "0" should contain "network_security_group" as json field "vm-sg" @@ -947,3 +1333,59 @@ Feature: Creator And message "network_interface.create.azure-fake" number "0" should contain "virtual_machine_id" as json field "virtual_machine::win" And message "network_interface.create.azure-fake" number "0" should contain "location" as json field "westeurope" And message "network_interface.create.azure-fake" number "0" should contain "network_security_group_id" as json field "$(components.#[_component_id="security_group::vm-sg"].id)" + And an event "lb_probe.delete.azure-fake" should be called exactly "1" times + And message "lb_probe.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "lb_probe.delete.azure-fake" number "0" should contain "_component_id" as json field "lb_probe::http" + And message "lb_probe.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "lb_probe.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "lb_probe.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "lb_probe.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And message "lb_probe.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "lb_probe.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "lb_probe.delete.azure-fake" number "0" should contain "protocol" as json field "Http" + And message "lb_probe.delete.azure-fake" number "0" should contain "_component" as json field "lb_probe" + And message "lb_probe.delete.azure-fake" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" + And message "lb_probe.delete.azure-fake" number "0" should contain "loadbalancer" as json field "lb" + And message "lb_probe.delete.azure-fake" number "0" should contain "request_path" as json field "/" + And an event "lb_backend_address_pool.delete.azure-fake.done" should be called exactly "1" times + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "_component" as json field "lb_backend_address_pool" + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "loadbalancer_id" as json field "$(components.#[_component_id="lb::lb"].id)" + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "loadbalancer" as json field "lb" + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "type" as json field "lb_backend_address_pool.delete.azure-fake.done" + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "lb_backend_address_pool.delete.azure-fake.done" number "0" should contain "_component_id" as json field "lb_backend_address_pool::pool1" + And an event "subnet.delete.azure-fake" should be called exactly "1" times + And message "subnet.delete.azure-fake" number "0" should contain "_action" as json field "delete" + And message "subnet.delete.azure-fake" number "0" should contain "address_prefix" as json field "10.0.1.0/24" + And message "subnet.delete.azure-fake" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "subnet.delete.azure-fake" number "0" should contain "_component" as json field "subnet" + And message "subnet.delete.azure-fake" number "0" should contain "network_security_group" as json field "subnet-sg" + And message "subnet.delete.azure-fake" number "0" should contain "resource_group_name" as json field "az-test" + And message "subnet.delete.azure-fake" number "0" should contain "network_security_group_id" as json field "$(components.#[_component_id="security_group::subnet-sg"].id)" + And message "subnet.delete.azure-fake" number "0" should contain "_state" as json field "running" + And message "subnet.delete.azure-fake" number "0" should contain "datacenter_region" as json field "westus" + And message "subnet.delete.azure-fake" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "subnet.delete.azure-fake" number "0" should contain "virtual_network_name" as json field "net" + And message "subnet.delete.azure-fake" number "0" should contain "_component_id" as json field "subnet::sub1" + And message "subnet.delete.azure-fake" number "0" should contain "_provider" as json field "azure-fake" + And an event "subnet.delete.azure-fake.done" should be called exactly "1" times + And message "subnet.delete.azure-fake.done" number "0" should contain "_provider" as json field "azure-fake" + And message "subnet.delete.azure-fake.done" number "0" should contain "_state" as json field "completed" + And message "subnet.delete.azure-fake.done" number "0" should contain "network_security_group_id" as json field "$(components.#[_component_id="security_group::subnet-sg"].id)" + And message "subnet.delete.azure-fake.done" number "0" should contain "_action" as json field "delete" + And message "subnet.delete.azure-fake.done" number "0" should contain "_component" as json field "subnet" + And message "subnet.delete.azure-fake.done" number "0" should contain "virtual_network_name" as json field "net" + And message "subnet.delete.azure-fake.done" number "0" should contain "datacenter_region" as json field "westus" + And message "subnet.delete.azure-fake.done" number "0" should contain "network_security_group" as json field "subnet-sg" + And message "subnet.delete.azure-fake.done" number "0" should contain "type" as json field "subnet.delete.azure-fake.done" + And message "subnet.delete.azure-fake.done" number "0" should contain "resource_group_name" as json field "az-test" + And message "subnet.delete.azure-fake.done" number "0" should contain "datacenter_name" as json field "fakeazure" + And message "subnet.delete.azure-fake.done" number "0" should contain "datacenter_type" as json field "azure-fake" + And message "subnet.delete.azure-fake.done" number "0" should contain "_component_id" as json field "subnet::sub1" + And message "subnet.delete.azure-fake.done" number "0" should contain "address_prefix" as json field "10.0.1.0/24" diff --git a/internal/features/cli/roles.feature b/internal/features/cli/roles.bk similarity index 100% rename from internal/features/cli/roles.feature rename to internal/features/cli/roles.bk From 50fe81993e086981f4d10006614f62f4c77beeec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Mon, 7 Aug 2017 10:44:58 +0200 Subject: [PATCH 09/34] Add project to all commands --- internal/features/cli/datacenter_list.feature | 1 - .../cli/environment_credentials.feature | 35 ++++++++++++++ internal/features/cli/roles.bk | 28 ----------- internal/features/cli/roles.feature | 48 +++++++++++++++++++ .../features/cli/service_definition.feature | 10 ++-- internal/features/cli/service_destroy.feature | 17 ++++--- internal/features/cli/service_history.feature | 12 +++-- internal/features/cli/service_info.feature | 2 +- internal/features/cli/service_reset.feature | 18 +++---- internal/features/cli/service_revert.feature | 12 ++--- internal/features/steps/step_definitions.go | 17 ++++++- 11 files changed, 138 insertions(+), 62 deletions(-) create mode 100644 internal/features/cli/environment_credentials.feature delete mode 100644 internal/features/cli/roles.bk create mode 100644 internal/features/cli/roles.feature diff --git a/internal/features/cli/datacenter_list.feature b/internal/features/cli/datacenter_list.feature index 7f20eea..a315a04 100644 --- a/internal/features/cli/datacenter_list.feature +++ b/internal/features/cli/datacenter_list.feature @@ -32,7 +32,6 @@ Feature: Ernest project list And The output should contain "fakeaws" And The output should contain "NAME" And The output should contain "ID" - And The output should contain "GROUP" And The output should contain "EXTERNAL NETWORK" And The output should contain "ORG" And The output should contain "URL" diff --git a/internal/features/cli/environment_credentials.feature b/internal/features/cli/environment_credentials.feature new file mode 100644 index 0000000..d7d0fd4 --- /dev/null +++ b/internal/features/cli/environment_credentials.feature @@ -0,0 +1,35 @@ +@cli @env_credentials +Feature: Environment credentials + + Scenario: Override project credentials at an environment level with create + Given I setup ernest with target "https://ernest.local" + And I setup a new environment name + And I'm logged in as "usr" / "secret123" + And I run ernest with "environment create fakeaws $(name) --secret_access_key tmp_secret_access_key_2 --access_key_id tmp_secret_up_to_16_chars_2" + And I start recording + And I apply the definition "aws1.yml" + And I stop recording + Then all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars_2" + And all "instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "tmp_secret_access_key_2" + + Scenario: Override project credentials at an environment level with create + Given I setup ernest with target "https://ernest.local" + And I setup a new environment name + And I'm logged in as "usr" / "secret123" + And I run ernest with "environment create fakeaws $(name)" + And I run ernest with "environment update fakeaws $(name) --secret_access_key tmp_secret_access_key_2 --access_key_id tmp_secret_up_to_16_chars_2" + And I start recording + And I apply the definition "aws1.yml" + And I stop recording + Then all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars_2" + + Scenario: Override project credentials at an environment level with apply + Given I setup ernest with target "https://ernest.local" + And I setup a new environment name + And I'm logged in as "usr" / "secret123" + And I start recording + And I apply "aws1.yml" with "--secret_access_key tmp_secret_access_key_2 --access_key_id tmp_secret_up_to_16_chars_2" + And I stop recording + Then all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars_2" + And all "instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "tmp_secret_access_key_2" + diff --git a/internal/features/cli/roles.bk b/internal/features/cli/roles.bk deleted file mode 100644 index 531de3f..0000000 --- a/internal/features/cli/roles.bk +++ /dev/null @@ -1,28 +0,0 @@ -@roles -Feature: Ernest role management - - Scenario: Non logged role creation - Given I setup ernest with target "https://ernest.local" - And I logout - When I run ernest with "role set" - Then The output should contain "You should provide role parameters, please run --help for help" - When I run ernest with "role set --role owner" - Then The output should contain "You should provide role parameters, please run --help for help" - When I run ernest with "role set --role owner --user roler" - Then The output should contain "You should specify at least a project name with (--project)" - When I run ernest with "role set --role owner --user roler --project test_project" - Then The output should contain "You're not allowed to perform this action, please log in" - When I run ernest with "role set --role owner --user roler --project test_project --environment test_environment" - Then The output should contain "You're not allowed to perform this action, please log in" - - Scenario: Plain user role creation - Given I setup ernest with target "https://ernest.local" - And I'm logged in as "usr" / "secret123" - And I run ernest with "project create tmp_project --type aws" - When I run ernest with "role set --role reader --user roler --project tmp_project" - Then The output should contain "User 'roler' has been authorized to read project tmp_projecte" - When I'm logged in as "roler" / "secret123" - And I run ernest with "project info tmp_project" - Then The output should contain "usr" - And The output should contain "roler" - diff --git a/internal/features/cli/roles.feature b/internal/features/cli/roles.feature new file mode 100644 index 0000000..ec13b4b --- /dev/null +++ b/internal/features/cli/roles.feature @@ -0,0 +1,48 @@ +@roles +Feature: Ernest role management + + Scenario: Non logged role creation + Given I setup ernest with target "https://ernest.local" + And I logout + When I run ernest with "role set" + Then The output should contain "Please provide a role with --role flag" + When I run ernest with "role set --role owner" + Then The output should contain "Please provide a user with --user flag" + When I run ernest with "role set --role owner --user roler" + Then The output should contain "Please provide a project with --project flag" + When I run ernest with "role set --role owner --user roler --project test_project" + Then The output should contain "You're not allowed to perform this action, please log in" + When I run ernest with "role set --role owner --user roler --project test_project --environment test_environment" + Then The output should contain "You're not allowed to perform this action, please log in" + + Scenario: Plain user role creation for a project + Given I setup ernest with target "https://ernest.local" + And I'm logged in as "usr" / "secret123" + And the project "tmp_project" does not exist + And I run ernest with "project create aws tmp_project --region fake --secret_access_key fake_up_to_16_characters --access_key_id up_to_16_characters_secret --fake" + When I run ernest with "role set --role reader --user ci_admin --project tmp_project" + Then The output should contain "User 'ci_admin' has been authorized to read resource tmp_project" + And I run ernest with "project info tmp_project" + Then The output should contain "usr (owner)" + And The output should contain "ci_admin (reader)" + When I run ernest with "role unset --role reader --user ci_admin --project tmp_project" + Then The output should contain "User 'ci_admin' has been unauthorized as tmp_project reader" + And I run ernest with "project info tmp_project" + Then The output should contain "usr (owner)" + And The output should not contain "ci_admin (reader)" + + Scenario: Plain user role creation for an environment + Given I setup ernest with target "https://ernest.local" + And I'm logged in as "usr" / "secret123" + And I apply the definition "destroyable.yml" + When I run ernest with "role set --role reader --user ci_admin --project fakeaws --environment destroyable" + Then The output should contain "User 'ci_admin' has been authorized to read resource fakeaws / destroyable" + And I run ernest with "env info fakeaws destroyable" + Then The output should contain "usr (owner)" + And The output should contain "ci_admin (reader)" + When I run ernest with "role unset --role reader --user ci_admin --project fakeaws --environment destroyable" + Then The output should contain "User 'ci_admin' has been unauthorized as fakeaws / destroyable reader" + And I run ernest with "env info fakeaws destroyable" + Then The output should contain "usr (owner)" + And The output should not contain "ci_admin (reader)" + diff --git a/internal/features/cli/service_definition.feature b/internal/features/cli/service_definition.feature index 53c5880..e3524c8 100644 --- a/internal/features/cli/service_definition.feature +++ b/internal/features/cli/service_definition.feature @@ -4,7 +4,7 @@ Feature: Ernest environment definition Scenario: Non logged user definition Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "environment definition" + When I run ernest with "env definition" Then The output should contain "You're not allowed to perform this action, please log in" Scenario: Logged user definition @@ -12,9 +12,11 @@ Feature: Ernest environment definition And I'm logged in as "usr" / "secret123" And The environment "destroyable" does not exist And I apply the definition "destroyable.yml" - When I run ernest with "environment definition" + When I run ernest with "env definition" + Then The output should contain "You should specify the project name" + When I run ernest with "env definition fakeaws" Then The output should contain "You should specify the env name" - When I run ernest with "environment definition destroyable" + When I run ernest with "env definition fakeaws destroyable" Then The output should contain "name: destroyable" And The output should contain "datacenter: fakeaws" @@ -23,7 +25,7 @@ Feature: Ernest environment definition And I'm logged in as "usr" / "secret123" And The environment "destroyable" does not exist And I apply the definition "destroyable.yml" - When I run ernest with "environment definition destroyable" + When I run ernest with "env definition fakeaws destroyable" Then The output should contain "name: destroyable" And The output should contain "datacenter: fakeaws" diff --git a/internal/features/cli/service_destroy.feature b/internal/features/cli/service_destroy.feature index 9521fd1..5490a4c 100644 --- a/internal/features/cli/service_destroy.feature +++ b/internal/features/cli/service_destroy.feature @@ -4,17 +4,19 @@ Feature: Environment destroy Scenario: Non logged environment destroy Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "environment destroy" + When I run ernest with "env destroy" Then The output should contain "You're not allowed to perform this action, please log in" - When I run ernest with "environment destroy destroyable" + When I run ernest with "env destroy fakeaws destroyable" Then The output should contain "You're not allowed to perform this action, please log in" Scenario: Logged environment destroy unexisting Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - When I run ernest with "environment destroy" - Then The output should contain "You should specify an existing environment name" - When I run ernest with "environment destroy unexisting --yes" + When I run ernest with "env destroy" + Then The output should contain "You should specify an existing project name" + When I run ernest with "env destroy fakeaws" + Then The output should contain "You should specify an existing project environment" + When I run ernest with "env destroy fakeaws unexisting --yes" Then The output should contain "Specified environment name does not exist" Scenario: Logged environment destroy @@ -22,8 +24,9 @@ Feature: Environment destroy And I'm logged in as "usr" / "secret123" And The environment "destroyable" does not exist And I apply the definition "destroyable.yml" - When I run ernest with "environment destroy destroyable --yes" + And I wait for "5" seconds + When I run ernest with "env destroy fakeaws destroyable --yes" Then The output should not contain "Specified environment name does not exist" And I wait for "1" seconds - When I run ernest with "environment destroy destroyable --yes" + When I run ernest with "env destroy fakeaws destroyable --yes" Then The output should contain "Specified environment name does not exist" diff --git a/internal/features/cli/service_history.feature b/internal/features/cli/service_history.feature index 42e83d9..e070d9a 100644 --- a/internal/features/cli/service_history.feature +++ b/internal/features/cli/service_history.feature @@ -4,17 +4,19 @@ Feature: Environment history Scenario: Non logged environment history Given I setup ernest with target "https://ernest.local" And I logout - When I run ernest with "environment history" + When I run ernest with "env history" Then The output should contain "You're not allowed to perform this action, please log in" - When I run ernest with "environment destroy destroyable" + When I run ernest with "env destroy fakeaws destroyable" Then The output should contain "You're not allowed to perform this action, please log in" Scenario: Logged environment history unexisting Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - When I run ernest with "environment history" + When I run ernest with "env history" + Then The output should contain "You should specify an existing project name" + When I run ernest with "env history fakeaws" Then The output should contain "You should specify an existing environment name" - When I run ernest with "environment history unexisting" + When I run ernest with "env history fakeaws unexisting" Then The output should contain "There are no registered builds for this environment" Scenario: Logged environment history @@ -25,7 +27,7 @@ Feature: Environment history And I wait for "5" seconds And I apply the definition "destroyable2.yml" And I wait for "5" seconds - When I run ernest with "environment history destroyable" + When I run ernest with "env history fakeaws destroyable" Then The output line number "3" should contain "destroyable" And The output line number "3" should contain "done" And The output line number "3" should contain "usr" diff --git a/internal/features/cli/service_info.feature b/internal/features/cli/service_info.feature index 9874b3f..c5c9979 100644 --- a/internal/features/cli/service_info.feature +++ b/internal/features/cli/service_info.feature @@ -12,7 +12,7 @@ Feature: Ernest environment info And I'm logged in as "usr" / "secret123" And The environment "destroyable" does not exist And I apply the definition "destroyable.yml" - When I run ernest with "environment info destroyable" + When I run ernest with "environment info fakeaws destroyable" Then The output should contain "Name : destroyable" And The output should contain "VPCs:" And The output should contain "| test-vpc | fakeaws |" diff --git a/internal/features/cli/service_reset.feature b/internal/features/cli/service_reset.feature index 3148820..9e54b05 100644 --- a/internal/features/cli/service_reset.feature +++ b/internal/features/cli/service_reset.feature @@ -10,20 +10,20 @@ Feature: Ernest environment reset Scenario: Logged user reset Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The environment "destroyable" does not exist + And The environment "fakeaws/destroyable" does not exist And I apply the definition "destroyable.yml" - When I run ernest with "environment reset destroyable" - Then The output should contain "The environment 'destroyable' cannot be reset as its status is 'done'" - And I force "destroyable" to be on status "in_progress" - When I run ernest with "environment list" + When I run ernest with "env reset fakeaws destroyable" + Then The output should contain "The environment 'fakeaws / destroyable' cannot be reset as its status is 'done'" + And I force "fakeaws/destroyable" to be on status "in_progress" + When I run ernest with "env list" And The output line number "3" should contain "destroyable" And The output line number "3" should contain "in_progress" And The output line number "3" should contain "usr" - When I run ernest with "environment reset destroyable" - Then The output should contain "You've successfully resetted the environment 'destroyable'" + When I run ernest with "env reset fakeaws destroyable" + Then The output should contain "You've successfully resetted the environment 'fakeaws / destroyable'" When I run ernest with "environment list" And The output line number "3" should contain "destroyable" And The output line number "3" should contain "errored" And The output line number "3" should contain "usr" - When I run ernest with "environment reset destroyable" - Then The output should contain "The environment 'destroyable' cannot be reset as its status is 'errored'" + When I run ernest with "environment reset fakeaws destroyable" + Then The output should contain "The environment 'fakeaws / destroyable' cannot be reset as its status is 'errored'" diff --git a/internal/features/cli/service_revert.feature b/internal/features/cli/service_revert.feature index 9b90f0a..2dd2c3a 100644 --- a/internal/features/cli/service_revert.feature +++ b/internal/features/cli/service_revert.feature @@ -8,24 +8,24 @@ Feature: Environment revert Given I'm logged in as "usr" / "secret123" And I apply the definition "service-revert.yml" And I apply the definition "service-revert2.yml" - And I run ernest with "environment revert myService 1" - When I run ernest with "environment definition myService" + And I run ernest with "env revert fakeaws myService 1" + When I run ernest with "env definition fakeaws myService" Then The output should contain "net-1" And The output should not contain "net-2" Scenario: User reverts a environment wihout providing a environment name or build ID Given I'm logged in as "usr" / "secret123" And I apply the definition "service-revert.yml" - When I run ernest with "environment revert myService" - Then The output should contain "Please specify an environment name and build ID" + When I run ernest with "env revert myService" + Then The output should contain "Please specify a project, environment and build ID" Scenario: User reverts a environment providing an invalid build ID Given I'm logged in as "usr" / "secret123" And I apply the definition "service-revert.yml" - When I run ernest with "environment revert myService 99" + When I run ernest with "env revert fakeaws myService 99" Then The output should contain "Invalid build ID" Scenario: Unauthenticated user reverts a environment Given I logout - When I run ernest with "environment revert" + When I run ernest with "env revert" Then The output should contain "You're not allowed to perform this action, please log in" diff --git a/internal/features/steps/step_definitions.go b/internal/features/steps/step_definitions.go index 04b911b..3010b3c 100644 --- a/internal/features/steps/step_definitions.go +++ b/internal/features/steps/step_definitions.go @@ -65,7 +65,9 @@ func init() { }) When(`^I run ernest with "(.+?)"$`, func(args string) { + args = strings.Replace(args, "$(name)", serviceName, -1) cmdArgs := strings.Split(args, " ") + ernest(cmdArgs...) }) @@ -299,6 +301,19 @@ func init() { ernest("environment", "apply", "--dry", def) }) + And(`^I apply "(.+?)" with "(.+?)"$`, func(def string, opts string) { + if delay := os.Getenv("ERNEST_APPLY_DELAY"); delay != "" { + if t, err := strconv.Atoi(delay); err == nil { + println("\nWaiting " + delay + " seconds...") + time.Sleep(time.Duration(t) * time.Second) + } + } + def = getDefinitionPathAWS(def, serviceName) + options := []string{"environment", "apply", def} + options = append(options, strings.Split(opts, " ")...) + ernest(options...) + }) + And(`^message "(.+?)" number "(.+?)" should contain "(.+?)" as json field "(.+?)"$`, func(subject string, num int, val, key string) { val = strings.Replace(val, "$(name)", serviceName, -1) if len(messages[subject]) == 0 { @@ -541,7 +556,7 @@ func init() { }) And(`^I force "(.+?)" to be on status "(.+?)"$`, func(environment string, status string) { - _, _ = n.Request("service.set", []byte(`{"name":"`+environment+`","status":"`+status+`"}`), time.Second*3) + _, _ = n.Request("build.set.status", []byte(`{"name":"`+environment+`","status":"`+status+`"}`), time.Second*3) }) And(`^File "(.+?)" exists$`, func(filename string) { From d227c2c472c2d6468bb10feee4f6796a35b1aed0 Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Thu, 17 Aug 2017 17:38:07 +0100 Subject: [PATCH 10/34] updated syntax --- definition.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/definition.yml b/definition.yml index f60b303..d58e165 100644 --- a/definition.yml +++ b/definition.yml @@ -89,7 +89,7 @@ repos: branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' @@ -194,4 +194,3 @@ repos: volumes: - ./logs/:/var/logs/ - ./config/:/etc/ernest/ - From 892c42a9380ba5adf86e5ebbb5930e28853df763 Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Fri, 18 Aug 2017 14:48:13 +0100 Subject: [PATCH 11/34] renamed services database to environments --- template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template.yml b/template.yml index dcac481..3027bff 100644 --- a/template.yml +++ b/template.yml @@ -10,7 +10,7 @@ services: volumes: - ./postgres/data:/var/lib/postgresql/data environment: - DB_NAME: users,groups,datacenters,services,usage,authorizations + DB_NAME: users,groups,datacenters,environments,usage,authorizations nginx: image: nginx volumes: From 6ebc32bf1922eb2fd0837050745f978aeb770aa1 Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Fri, 18 Aug 2017 17:43:55 +0100 Subject: [PATCH 12/34] removed groups db and changed datacenters -> projects --- template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template.yml b/template.yml index 3027bff..c6277c3 100644 --- a/template.yml +++ b/template.yml @@ -10,7 +10,7 @@ services: volumes: - ./postgres/data:/var/lib/postgresql/data environment: - DB_NAME: users,groups,datacenters,environments,usage,authorizations + DB_NAME: users,projects,environments,usage,authorizations nginx: image: nginx volumes: From a7fddd8ac13acbb6d5f8cdf8ecc48b35cf6abe27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Mon, 21 Aug 2017 11:04:28 +0200 Subject: [PATCH 13/34] Fix some tests --- internal/features/cli/service_destroy.feature | 3 ++- internal/features/cli/service_reset.feature | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/features/cli/service_destroy.feature b/internal/features/cli/service_destroy.feature index 5490a4c..59b4c72 100644 --- a/internal/features/cli/service_destroy.feature +++ b/internal/features/cli/service_destroy.feature @@ -12,6 +12,7 @@ Feature: Environment destroy Scenario: Logged environment destroy unexisting Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" + And The environment "fakeaws/unexisting" does not exist When I run ernest with "env destroy" Then The output should contain "You should specify an existing project name" When I run ernest with "env destroy fakeaws" @@ -22,7 +23,7 @@ Feature: Environment destroy Scenario: Logged environment destroy Given I setup ernest with target "https://ernest.local" And I'm logged in as "usr" / "secret123" - And The environment "destroyable" does not exist + And The environment "fakeaws/destroyable" does not exist And I apply the definition "destroyable.yml" And I wait for "5" seconds When I run ernest with "env destroy fakeaws destroyable --yes" diff --git a/internal/features/cli/service_reset.feature b/internal/features/cli/service_reset.feature index 9e54b05..44b17b7 100644 --- a/internal/features/cli/service_reset.feature +++ b/internal/features/cli/service_reset.feature @@ -12,6 +12,7 @@ Feature: Ernest environment reset And I'm logged in as "usr" / "secret123" And The environment "fakeaws/destroyable" does not exist And I apply the definition "destroyable.yml" + And I wait for "2" seconds When I run ernest with "env reset fakeaws destroyable" Then The output should contain "The environment 'fakeaws / destroyable' cannot be reset as its status is 'done'" And I force "fakeaws/destroyable" to be on status "in_progress" From 7ad3946afc0477928250ca6e2fdbd3748842cd2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Mon, 21 Aug 2017 12:18:04 +0200 Subject: [PATCH 14/34] Renaming datacenter to project on the yaml --- internal/definitions/aws-template1-completed.yml | 2 +- internal/definitions/aws-template1-unexisting.yml | 2 +- internal/definitions/aws-template1.yml | 2 +- internal/definitions/aws1.yml | 2 +- internal/definitions/aws10.yml | 2 +- internal/definitions/aws11.yml | 2 +- internal/definitions/aws12.yml | 2 +- internal/definitions/aws13.yml | 2 +- internal/definitions/aws14.yml | 2 +- internal/definitions/aws15.yml | 2 +- internal/definitions/aws16.yml | 2 +- internal/definitions/aws17.yml | 2 +- internal/definitions/aws18.yml | 2 +- internal/definitions/aws19.yml | 2 +- internal/definitions/aws2.yml | 2 +- internal/definitions/aws20.yml | 2 +- internal/definitions/aws21.yml | 2 +- internal/definitions/aws3.yml | 2 +- internal/definitions/aws4.yml | 2 +- internal/definitions/aws5.yml | 2 +- internal/definitions/aws6.yml | 2 +- internal/definitions/aws7.yml | 2 +- internal/definitions/aws8.yml | 2 +- internal/definitions/aws9.yml | 2 +- internal/definitions/azure1.yml | 2 +- internal/definitions/azure2.yml | 2 +- internal/definitions/azure3.yml | 2 +- internal/definitions/azure4.yml | 2 +- internal/definitions/azure5.yml | 2 +- internal/definitions/azure6.yml | 2 +- internal/definitions/destroyable.yml | 2 +- internal/definitions/destroyable2.yml | 2 +- internal/definitions/referenced.yml | 2 +- internal/definitions/service-revert.yml | 2 +- internal/definitions/service-revert2.yml | 2 +- internal/definitions/unexisting_dc.yml | 2 +- internal/definitions/update_project_aws_1.yml | 2 +- internal/definitions/update_project_aws_2.yml | 2 +- internal/definitions/vcloud1.yml | 2 +- internal/definitions/vcloud2.yml | 2 +- internal/definitions/vcloud3.yml | 2 +- internal/definitions/vcloud4.yml | 2 +- internal/definitions/vcloud5.yml | 2 +- internal/definitions/vcloud6.yml | 2 +- internal/definitions/vcloud7.yml | 2 +- internal/definitions/vcloud8.yml | 2 +- internal/features/cli/service_definition.feature | 4 ++-- internal/features/steps/step_definitions.go | 4 ++-- 48 files changed, 50 insertions(+), 50 deletions(-) diff --git a/internal/definitions/aws-template1-completed.yml b/internal/definitions/aws-template1-completed.yml index 09bd9bb..e3d0ef2 100644 --- a/internal/definitions/aws-template1-completed.yml +++ b/internal/definitions/aws-template1-completed.yml @@ -1,5 +1,5 @@ name: aws-test-4 -datacenter: tom-aws +project: tom-aws bootstrapping: none vpc_id: vpc-a921accd networks: diff --git a/internal/definitions/aws-template1-unexisting.yml b/internal/definitions/aws-template1-unexisting.yml index e633b46..96936d7 100644 --- a/internal/definitions/aws-template1-unexisting.yml +++ b/internal/definitions/aws-template1-unexisting.yml @@ -1,5 +1,5 @@ name: aws-test-999 -datacenter: fakeaws +project: fakeaws bootstrapping: none vpc_id: vpc-a921accd networks: diff --git a/internal/definitions/aws-template1.yml b/internal/definitions/aws-template1.yml index ecaa0d6..7531345 100644 --- a/internal/definitions/aws-template1.yml +++ b/internal/definitions/aws-template1.yml @@ -1,5 +1,5 @@ name: aws-test-4 -datacenter: tom-aws +project: tom-aws bootstrapping: none vpc_id: vpc-a921accd networks: diff --git a/internal/definitions/aws1.yml b/internal/definitions/aws1.yml index f0beaaf..8e07f74 100644 --- a/internal/definitions/aws1.yml +++ b/internal/definitions/aws1.yml @@ -1,7 +1,7 @@ # Basic aws example --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws10.yml b/internal/definitions/aws10.yml index 950d6a0..4ad664a 100644 --- a/internal/definitions/aws10.yml +++ b/internal/definitions/aws10.yml @@ -1,7 +1,7 @@ # Add a network and attach a new instance --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws11.yml b/internal/definitions/aws11.yml index 84ed8bd..2cbf32a 100644 --- a/internal/definitions/aws11.yml +++ b/internal/definitions/aws11.yml @@ -1,7 +1,7 @@ # Remove a network and remove the new instance --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws12.yml b/internal/definitions/aws12.yml index 12017de..e6e20be 100644 --- a/internal/definitions/aws12.yml +++ b/internal/definitions/aws12.yml @@ -1,7 +1,7 @@ # Add a nat gateway and attach a private network to it --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws13.yml b/internal/definitions/aws13.yml index c7c44f9..cdef426 100644 --- a/internal/definitions/aws13.yml +++ b/internal/definitions/aws13.yml @@ -1,7 +1,7 @@ # Add a nat gateway and attach a private network to it --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws14.yml b/internal/definitions/aws14.yml index 5c8c436..e3707e0 100644 --- a/internal/definitions/aws14.yml +++ b/internal/definitions/aws14.yml @@ -1,7 +1,7 @@ # Add a nat gateway and attach a private network to it --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws15.yml b/internal/definitions/aws15.yml index 12017de..e6e20be 100644 --- a/internal/definitions/aws15.yml +++ b/internal/definitions/aws15.yml @@ -1,7 +1,7 @@ # Add a nat gateway and attach a private network to it --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws16.yml b/internal/definitions/aws16.yml index 332f0f7..178aa3e 100644 --- a/internal/definitions/aws16.yml +++ b/internal/definitions/aws16.yml @@ -1,7 +1,7 @@ # Add a nat gateway and attach a private network to it --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws17.yml b/internal/definitions/aws17.yml index 0075031..e9d5077 100644 --- a/internal/definitions/aws17.yml +++ b/internal/definitions/aws17.yml @@ -1,7 +1,7 @@ # Add a nat gateway and attach a private network to it --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws18.yml b/internal/definitions/aws18.yml index 898d0d0..7f924e1 100644 --- a/internal/definitions/aws18.yml +++ b/internal/definitions/aws18.yml @@ -1,7 +1,7 @@ # Add a nat gateway and attach a private network to it --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws19.yml b/internal/definitions/aws19.yml index cf6cea9..2cea104 100644 --- a/internal/definitions/aws19.yml +++ b/internal/definitions/aws19.yml @@ -1,7 +1,7 @@ # Add a nat gateway and attach a private network to it --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws2.yml b/internal/definitions/aws2.yml index 9220ec7..60b6cb2 100644 --- a/internal/definitions/aws2.yml +++ b/internal/definitions/aws2.yml @@ -1,7 +1,7 @@ # Increasing the instance count against aws1.yml --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws20.yml b/internal/definitions/aws20.yml index 0075031..e9d5077 100644 --- a/internal/definitions/aws20.yml +++ b/internal/definitions/aws20.yml @@ -1,7 +1,7 @@ # Add a nat gateway and attach a private network to it --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws21.yml b/internal/definitions/aws21.yml index ef474a4..d318488 100644 --- a/internal/definitions/aws21.yml +++ b/internal/definitions/aws21.yml @@ -1,7 +1,7 @@ # Add a nat gateway and attach a private network to it --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws3.yml b/internal/definitions/aws3.yml index f0beaaf..8e07f74 100644 --- a/internal/definitions/aws3.yml +++ b/internal/definitions/aws3.yml @@ -1,7 +1,7 @@ # Basic aws example --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws4.yml b/internal/definitions/aws4.yml index 3b9a893..d7f4554 100644 --- a/internal/definitions/aws4.yml +++ b/internal/definitions/aws4.yml @@ -1,7 +1,7 @@ # Basic aws example --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws5.yml b/internal/definitions/aws5.yml index 86604a0..a71ff0a 100644 --- a/internal/definitions/aws5.yml +++ b/internal/definitions/aws5.yml @@ -1,7 +1,7 @@ # Add ingress security group --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws6.yml b/internal/definitions/aws6.yml index dbf4e87..697512c 100644 --- a/internal/definitions/aws6.yml +++ b/internal/definitions/aws6.yml @@ -1,7 +1,7 @@ # Add engress security group --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws7.yml b/internal/definitions/aws7.yml index f27e7b1..a55df17 100644 --- a/internal/definitions/aws7.yml +++ b/internal/definitions/aws7.yml @@ -1,7 +1,7 @@ # Remove engress and ingress security groups --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws8.yml b/internal/definitions/aws8.yml index dcf25c0..dacbd60 100644 --- a/internal/definitions/aws8.yml +++ b/internal/definitions/aws8.yml @@ -1,7 +1,7 @@ # Add a network --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/aws9.yml b/internal/definitions/aws9.yml index d9b85dd..baaae8d 100644 --- a/internal/definitions/aws9.yml +++ b/internal/definitions/aws9.yml @@ -1,7 +1,7 @@ # Remove a network --- name: my_service -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: test-vpc diff --git a/internal/definitions/azure1.yml b/internal/definitions/azure1.yml index 642b009..7bc8480 100644 --- a/internal/definitions/azure1.yml +++ b/internal/definitions/azure1.yml @@ -1,5 +1,5 @@ name: my_service -datacenter: fakeazure +project: fakeazure resource_groups: - name: rg2 diff --git a/internal/definitions/azure2.yml b/internal/definitions/azure2.yml index c092699..813e4a9 100644 --- a/internal/definitions/azure2.yml +++ b/internal/definitions/azure2.yml @@ -1,5 +1,5 @@ name: my_service -datacenter: fakeazure +project: fakeazure resource_groups: - name: az-test diff --git a/internal/definitions/azure3.yml b/internal/definitions/azure3.yml index a319b2a..f97bb28 100644 --- a/internal/definitions/azure3.yml +++ b/internal/definitions/azure3.yml @@ -1,5 +1,5 @@ name: my_service -datacenter: fakeazure +project: fakeazure resource_groups: - name: az-test diff --git a/internal/definitions/azure4.yml b/internal/definitions/azure4.yml index 73fbbfa..695b71b 100644 --- a/internal/definitions/azure4.yml +++ b/internal/definitions/azure4.yml @@ -1,5 +1,5 @@ name: my_service -datacenter: fakeazure +project: fakeazure resource_groups: - name: az-test diff --git a/internal/definitions/azure5.yml b/internal/definitions/azure5.yml index 03c659b..942e5d8 100644 --- a/internal/definitions/azure5.yml +++ b/internal/definitions/azure5.yml @@ -1,5 +1,5 @@ name: my_service -datacenter: fakeazure +project: fakeazure resource_groups: - name: az-test diff --git a/internal/definitions/azure6.yml b/internal/definitions/azure6.yml index b0f62a9..38524f6 100644 --- a/internal/definitions/azure6.yml +++ b/internal/definitions/azure6.yml @@ -1,5 +1,5 @@ name: my_service -datacenter: fakeazure +project: fakeazure resource_groups: - name: az-test diff --git a/internal/definitions/destroyable.yml b/internal/definitions/destroyable.yml index 552a237..5ba4561 100644 --- a/internal/definitions/destroyable.yml +++ b/internal/definitions/destroyable.yml @@ -1,7 +1,7 @@ # Basic aws example --- name: destroyable -datacenter: r3-dc2 +project: r3-dc2 bootstrapping: none service_ip: 172.16.186.44 vpcs: diff --git a/internal/definitions/destroyable2.yml b/internal/definitions/destroyable2.yml index f99abb6..4086b34 100644 --- a/internal/definitions/destroyable2.yml +++ b/internal/definitions/destroyable2.yml @@ -1,7 +1,7 @@ # Basic aws example --- name: destroyable -datacenter: r3-dc2 +project: r3-dc2 bootstrapping: none service_ip: 172.16.186.44 vpcs: diff --git a/internal/definitions/referenced.yml b/internal/definitions/referenced.yml index 2d033a7..f93ce91 100644 --- a/internal/definitions/referenced.yml +++ b/internal/definitions/referenced.yml @@ -1,7 +1,7 @@ # Basic aws example --- name: my_service -datacenter: test_dc +project: test_dc bootstrapping: none service_ip: 172.16.186.44 vpcs: diff --git a/internal/definitions/service-revert.yml b/internal/definitions/service-revert.yml index 0e8a900..23e5e89 100644 --- a/internal/definitions/service-revert.yml +++ b/internal/definitions/service-revert.yml @@ -1,6 +1,6 @@ --- name: myService -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: myVPC diff --git a/internal/definitions/service-revert2.yml b/internal/definitions/service-revert2.yml index f02f468..488dcf3 100644 --- a/internal/definitions/service-revert2.yml +++ b/internal/definitions/service-revert2.yml @@ -1,6 +1,6 @@ --- name: myService2 -datacenter: r3-dc2 +project: r3-dc2 vpcs: - name: myVPC diff --git a/internal/definitions/unexisting_dc.yml b/internal/definitions/unexisting_dc.yml index 4700d0f..072d101 100644 --- a/internal/definitions/unexisting_dc.yml +++ b/internal/definitions/unexisting_dc.yml @@ -1,7 +1,7 @@ # Basic aws example --- name: aws_test_service -datacenter: non_existing_dc +project: non_existing_dc bootstrapping: none service_ip: 172.16.186.44 vpcs: diff --git a/internal/definitions/update_project_aws_1.yml b/internal/definitions/update_project_aws_1.yml index 1b04e14..7eb10de 100644 --- a/internal/definitions/update_project_aws_1.yml +++ b/internal/definitions/update_project_aws_1.yml @@ -1,7 +1,7 @@ # Basic aws example --- name: aws_test_update_dc -datacenter: update_project +project: update_project vpcs: - name: test-vpc diff --git a/internal/definitions/update_project_aws_2.yml b/internal/definitions/update_project_aws_2.yml index 8ae6b06..4ec3189 100644 --- a/internal/definitions/update_project_aws_2.yml +++ b/internal/definitions/update_project_aws_2.yml @@ -1,7 +1,7 @@ # Basic aws example --- name: aws_test_update_dc -datacenter: update_project +project: update_project vpcs: - name: test-vpc diff --git a/internal/definitions/vcloud1.yml b/internal/definitions/vcloud1.yml index a9639eb..2db0571 100644 --- a/internal/definitions/vcloud1.yml +++ b/internal/definitions/vcloud1.yml @@ -1,6 +1,6 @@ --- name: my_service -datacenter: fakevcloud +project: fakevcloud routers: - name: vse2 diff --git a/internal/definitions/vcloud2.yml b/internal/definitions/vcloud2.yml index 28b5af9..b2c9a17 100644 --- a/internal/definitions/vcloud2.yml +++ b/internal/definitions/vcloud2.yml @@ -1,6 +1,6 @@ --- name: my_service -datacenter: fakevcloud +project: fakevcloud routers: - name: vse2 diff --git a/internal/definitions/vcloud3.yml b/internal/definitions/vcloud3.yml index a9639eb..2db0571 100644 --- a/internal/definitions/vcloud3.yml +++ b/internal/definitions/vcloud3.yml @@ -1,6 +1,6 @@ --- name: my_service -datacenter: fakevcloud +project: fakevcloud routers: - name: vse2 diff --git a/internal/definitions/vcloud4.yml b/internal/definitions/vcloud4.yml index 1c6ff79..f5bd1b4 100644 --- a/internal/definitions/vcloud4.yml +++ b/internal/definitions/vcloud4.yml @@ -1,6 +1,6 @@ --- name: my_service -datacenter: fakevcloud +project: fakevcloud routers: - name: vse2 diff --git a/internal/definitions/vcloud5.yml b/internal/definitions/vcloud5.yml index 04ae360..cc65261 100644 --- a/internal/definitions/vcloud5.yml +++ b/internal/definitions/vcloud5.yml @@ -1,6 +1,6 @@ --- name: my_service -datacenter: fakevcloud +project: fakevcloud routers: - name: vse2 diff --git a/internal/definitions/vcloud6.yml b/internal/definitions/vcloud6.yml index 280a107..0cf69e2 100644 --- a/internal/definitions/vcloud6.yml +++ b/internal/definitions/vcloud6.yml @@ -1,6 +1,6 @@ --- name: my_service -datacenter: fakevcloud +project: fakevcloud routers: - name: vse2 diff --git a/internal/definitions/vcloud7.yml b/internal/definitions/vcloud7.yml index 875e70f..4b1d476 100644 --- a/internal/definitions/vcloud7.yml +++ b/internal/definitions/vcloud7.yml @@ -1,6 +1,6 @@ --- name: my_service -datacenter: fakevcloud +project: fakevcloud routers: - name: vse2 diff --git a/internal/definitions/vcloud8.yml b/internal/definitions/vcloud8.yml index ced03df..a19d036 100644 --- a/internal/definitions/vcloud8.yml +++ b/internal/definitions/vcloud8.yml @@ -1,6 +1,6 @@ --- name: my_service -datacenter: fakevcloud +project: fakevcloud instances: - name: web diff --git a/internal/features/cli/service_definition.feature b/internal/features/cli/service_definition.feature index e3524c8..e1da6e0 100644 --- a/internal/features/cli/service_definition.feature +++ b/internal/features/cli/service_definition.feature @@ -18,7 +18,7 @@ Feature: Ernest environment definition Then The output should contain "You should specify the env name" When I run ernest with "env definition fakeaws destroyable" Then The output should contain "name: destroyable" - And The output should contain "datacenter: fakeaws" + And The output should contain "project: fakeaws" Scenario: Logged user definition for a specific build Given I setup ernest with target "https://ernest.local" @@ -27,5 +27,5 @@ Feature: Ernest environment definition And I apply the definition "destroyable.yml" When I run ernest with "env definition fakeaws destroyable" Then The output should contain "name: destroyable" - And The output should contain "datacenter: fakeaws" + And The output should contain "project: fakeaws" diff --git a/internal/features/steps/step_definitions.go b/internal/features/steps/step_definitions.go index 3010b3c..1bf04a1 100644 --- a/internal/features/steps/step_definitions.go +++ b/internal/features/steps/step_definitions.go @@ -590,8 +590,8 @@ func getDefinitionPathAWS(def string, service string) string { for _, line := range lines { if strings.Contains(line, "name: my_service") { finalLines = append(finalLines, "name: "+service) - } else if strings.Contains(line, "datacenter: r3-dc2") { - finalLines = append(finalLines, "datacenter: fakeaws") + } else if strings.Contains(line, "project: r3-dc2") { + finalLines = append(finalLines, "project: fakeaws") } else { finalLines = append(finalLines, line) } From 1174ea2604e2b21261ded4ed36a8a1bfc3a1f10d Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Mon, 21 Aug 2017 13:43:01 +0100 Subject: [PATCH 15/34] removed group store --- definition.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/definition.yml b/definition.yml index 658cca7..9530262 100644 --- a/definition.yml +++ b/definition.yml @@ -51,17 +51,6 @@ repos: NATS_URI: 'nats://nats:4222' ERNEST_CRYPTO_KEY: CRYPTO_KEY_TEMPLATE - - name: group-store - path: git@github.com:ernestio/group-store.git - branch: master - links: - - nats - depends: - - config-store - environment: - NATS_URI: 'nats://nats:4222' - ERNEST_CRYPTO_KEY: CRYPTO_KEY_TEMPLATE - - name: datacenter-store path: git@github.com:ernestio/datacenter-store.git branch: master @@ -194,4 +183,3 @@ repos: volumes: - ./logs/:/var/logs/ - ./config/:/etc/ernest/ - From 032a32413ce6a4e424c28a012f36c52a2364178f Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Mon, 21 Aug 2017 17:41:57 +0100 Subject: [PATCH 16/34] removed group creation from ci_setup --- internal/ci_setup.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/ci_setup.sh b/internal/ci_setup.sh index a722dc0..a4f05b8 100755 --- a/internal/ci_setup.sh +++ b/internal/ci_setup.sh @@ -1,5 +1,4 @@ -$GOBIN/natsc request -s $NATS_URI -t 5 -r 99 'group.set' '{"id":"1","name": "ci_admin"}' -$GOBIN/natsc request -s $NATS_URI -t 5 -r 99 'user.set' '{"group_id": 1, "username": "ci_admin", "password": "secret123", "admin":true}' +$GOBIN/natsc request -s $NATS_URI -t 5 -r 99 'user.set' '{"username": "ci_admin", "password": "secret123", "admin":true}' ernest-cli target $CURRENT_INSTANCE ernest-cli login --user ci_admin --password secret123 ernest-cli user create usr secret123 From 5cb321184c844cc0d787e495d2f33c4d58bf44cf Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Mon, 21 Aug 2017 18:40:47 +0100 Subject: [PATCH 17/34] fixed vcloud yamls --- internal/definitions/vcloud1.yml | 6 ++++-- internal/definitions/vcloud2.yml | 6 ++++-- internal/definitions/vcloud3.yml | 8 +++++--- internal/definitions/vcloud4.yml | 6 ++++-- internal/definitions/vcloud5.yml | 6 ++++-- internal/definitions/vcloud6.yml | 10 +++++++--- internal/definitions/vcloud7.yml | 6 ++++-- 7 files changed, 32 insertions(+), 16 deletions(-) diff --git a/internal/definitions/vcloud1.yml b/internal/definitions/vcloud1.yml index 2db0571..1eda66c 100644 --- a/internal/definitions/vcloud1.yml +++ b/internal/definitions/vcloud1.yml @@ -4,7 +4,7 @@ project: fakevcloud routers: - name: vse2 - rules: + firewall_rules: - name: in_in_any source: internal from_port: any @@ -41,11 +41,13 @@ routers: - name: web subnet: 10.1.0.0/24 - port_forwarding: + nat_rules: - source: 172.16.186.44 from_port: '22' to_port: '22' destination: 10.1.0.11 + protocol: tcp + type: dnat instances: - name: web diff --git a/internal/definitions/vcloud2.yml b/internal/definitions/vcloud2.yml index b2c9a17..80b3da4 100644 --- a/internal/definitions/vcloud2.yml +++ b/internal/definitions/vcloud2.yml @@ -4,7 +4,7 @@ project: fakevcloud routers: - name: vse2 - rules: + firewall_rules: - name: in_in_any source: internal from_port: any @@ -37,8 +37,10 @@ routers: protocol: tcp action: allow - port_forwarding: + nat_rules: - source: 172.16.186.44 from_port: '22' to_port: '22' destination: 10.1.0.11 + protocol: tcp + type: dnat diff --git a/internal/definitions/vcloud3.yml b/internal/definitions/vcloud3.yml index 2db0571..2cd7447 100644 --- a/internal/definitions/vcloud3.yml +++ b/internal/definitions/vcloud3.yml @@ -4,7 +4,7 @@ project: fakevcloud routers: - name: vse2 - rules: + firewall_rules: - name: in_in_any source: internal from_port: any @@ -41,12 +41,14 @@ routers: - name: web subnet: 10.1.0.0/24 - port_forwarding: + nat_rules: - source: 172.16.186.44 from_port: '22' to_port: '22' destination: 10.1.0.11 - + protocol: tcp + type: dnat + instances: - name: web image: r3/ubuntu-1404 diff --git a/internal/definitions/vcloud4.yml b/internal/definitions/vcloud4.yml index f5bd1b4..a747f83 100644 --- a/internal/definitions/vcloud4.yml +++ b/internal/definitions/vcloud4.yml @@ -4,7 +4,7 @@ project: fakevcloud routers: - name: vse2 - rules: + firewall_rules: - name: in_in_any source: internal from_port: any @@ -41,11 +41,13 @@ routers: - name: web subnet: 10.1.0.0/24 - port_forwarding: + nat_rules: - source: 172.16.186.44 from_port: '22' to_port: '22' destination: 10.1.0.11 + protocol: tcp + type: dnat instances: - name: web diff --git a/internal/definitions/vcloud5.yml b/internal/definitions/vcloud5.yml index cc65261..27eed1c 100644 --- a/internal/definitions/vcloud5.yml +++ b/internal/definitions/vcloud5.yml @@ -4,7 +4,7 @@ project: fakevcloud routers: - name: vse2 - rules: + firewall_rules: - name: in_in_any source: internal from_port: any @@ -41,11 +41,13 @@ routers: - name: web subnet: 10.1.0.0/24 - port_forwarding: + nat_rules: - source: 172.16.186.44 from_port: '22' to_port: '22' destination: 10.1.0.11 + protocol: tcp + type: dnat instances: - name: web diff --git a/internal/definitions/vcloud6.yml b/internal/definitions/vcloud6.yml index 0cf69e2..5121834 100644 --- a/internal/definitions/vcloud6.yml +++ b/internal/definitions/vcloud6.yml @@ -4,7 +4,7 @@ project: fakevcloud routers: - name: vse2 - rules: + firewall_rules: - name: in_in_any source: internal from_port: any @@ -41,16 +41,20 @@ routers: - name: web subnet: 10.1.0.0/24 - port_forwarding: + nat_rules: - source: 172.16.186.44 from_port: '22' to_port: '22' destination: 10.1.0.11 + protocol: tcp + type: dnat - source: 11.11.11.11 from_port: '22' to_port: '22' destination: 10.1.0.11 - + protocol: tcp + type: dnat + instances: - name: web image: r3/ubuntu-1404 diff --git a/internal/definitions/vcloud7.yml b/internal/definitions/vcloud7.yml index 4b1d476..266f519 100644 --- a/internal/definitions/vcloud7.yml +++ b/internal/definitions/vcloud7.yml @@ -4,7 +4,7 @@ project: fakevcloud routers: - name: vse2 - rules: + firewall_rules: - name: in_in_any source: internal from_port: any @@ -41,11 +41,13 @@ routers: - name: web subnet: 10.1.0.0/24 - port_forwarding: + nat_rules: - source: 172.16.186.44 from_port: '22' to_port: '22' destination: 10.1.0.11 + protocol: tcp + type: dnat instances: - name: web From e4f94822d3d818c4dede563edd4cfc4c5c2ca2a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Tue, 22 Aug 2017 09:58:17 +0200 Subject: [PATCH 18/34] Remove group related steps --- .../features/cli/datacenters_to_groups.old | 76 ------------------- internal/features/cli/user_disable.feature | 1 - internal/features/steps/step_definitions.go | 68 ----------------- setup | 3 +- 4 files changed, 1 insertion(+), 147 deletions(-) delete mode 100644 internal/features/cli/datacenters_to_groups.old diff --git a/internal/features/cli/datacenters_to_groups.old b/internal/features/cli/datacenters_to_groups.old deleted file mode 100644 index a96bd4e..0000000 --- a/internal/features/cli/datacenters_to_groups.old +++ /dev/null @@ -1,76 +0,0 @@ -@group @projects_to_groups -Feature: Ernest projects to groups - - Scenario: Non logged - project to group - Given I setup ernest with target "https://ernest.local" - And I logout - When I run ernest with "group add-project" - Then The output should contain "You should specify the project name and group name" - When I run ernest with "group add-project tmp_project" - Then The output should contain "You should specify the group name" - When I run ernest with "group add-project tmp_project tmp_group" - Then The output should contain "You're not allowed to perform this action, please log in" - - Scenario: Plain project - project to group - Given I setup ernest with target "https://ernest.local" - And I'm logged in as "usr" / "secret123" - When I run ernest with "group add-project" - Then The output should contain "You should specify the project name and group name" - When I run ernest with "group add-project tmp_project" - Then The output should contain "You should specify the group name" - When I run ernest with "group add-project tmp_project tmp_group" - Then The output should contain "You don't have permissions to perform this action" - - Scenario: Admin project - project to group - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" exists - And the project "tmp_project" exists - And I'm logged in as "ci_admin" / "secret123" - When I run ernest with "group add-project" - Then The output should contain "You should specify the project name and group name" - When I run ernest with "group add-project tmp_project" - Then The output should contain "You should specify the group name" - When I run ernest with "group add-project tmp_project tmp_group" - Then The output should contain "Project 'tmp_project' is now assigned to group 'tmp_group'" - When I run ernest with "project list" - Then The output projects table should contain "tmp_project" assigned to "tmp_group" group - - Scenario: Already assigned project - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" exists - And the project "tmp_project" exists - And I'm logged in as "ci_admin" / "secret123" - And I run ernest with "group add-project tmp_project tmp_group" - When I run ernest with "group add-project tmp_project tmp_group" - Then The output should contain "Project 'tmp_project' already belongs to 'tmp_group' group" - - Scenario: Unexisting group - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" does not exist - And the project "tmp_project" exists - And I'm logged in as "ci_admin" / "secret123" - When I run ernest with "group add-project tmp_project tmp_group" - Then The output should contain "Group 'tmp_group' does not exist" - - Scenario: Unexisting project - Given I setup ernest with target "https://ernest.local" - And the project "tmp_project" does not exist - And the group "tmp_group" exists - And I'm logged in as "ci_admin" / "secret123" - When I run ernest with "group add-project tmp_project tmp_group" - Then The output should contain "Project 'tmp_project' does not exist" - - Scenario: Admin project - remove project from group - Given I setup ernest with target "https://ernest.local" - And the group "tmp_group" exists - And the project "tmp_project" exists - And I'm logged in as "ci_admin" / "secret123" - And I run ernest with "group add-project tmp_project tmp_group" - When I run ernest with "group remove-project" - Then The output should contain "You should specify the project name and group name" - When I run ernest with "group remove-project tmp_project" - Then The output should contain "You should specify the group name" - When I run ernest with "group remove-project tmp_project tmp_group" - Then The output should contain "Project 'tmp_project' is not assigned anymore to group 'tmp_group'" - When I run ernest with "project list" - Then The output projects table should contain "tmp_project" assigned to " " group diff --git a/internal/features/cli/user_disable.feature b/internal/features/cli/user_disable.feature index 508e66b..79b82f5 100644 --- a/internal/features/cli/user_disable.feature +++ b/internal/features/cli/user_disable.feature @@ -24,7 +24,6 @@ Feature: Ernest user disable And I'm logged in as "ci_admin" / "secret123" And The output should contain "Welcome back ci_admin" When I run ernest with "user create to_disable secret123" - And I run ernest with "group-add to_disable test" And I'm logged in as "to_disable" / "secret123" Then The output should contain "Welcome back to_disable" When I'm logged in as "ci_admin" / "secret123" diff --git a/internal/features/steps/step_definitions.go b/internal/features/steps/step_definitions.go index 1bf04a1..403aa4d 100644 --- a/internal/features/steps/step_definitions.go +++ b/internal/features/steps/step_definitions.go @@ -128,11 +128,6 @@ func init() { lastError = err }) - And(`^The group "(.+?)" does not exist$`, func(group string) { - msg := []byte(`{"name":"` + group + `"}`) - _, _ = n.Request("group.del", msg, time.Second*3) - }) - And(`^The user "(.+?)" does not exist$`, func(user string) { msg := []byte(`{"username":"` + user + `"}`) _, _ = n.Request("user.del", msg, time.Second*3) @@ -148,13 +143,6 @@ func init() { _, _ = n.Request("service.del", msg, time.Second*3) }) - And(`^The group "(.+?)" exists$`, func(group string) { - msg := []byte(`{"name":"` + group + `"}`) - _, _ = n.Request("group.del", msg, time.Second*3) - msg = []byte(`{"name":"` + group + `"}`) - _, _ = n.Request("group.set", msg, time.Second*3) - }) - And(`^The user "(.+?)" exists$`, func(user string) { msg := []byte(`{"username":"` + user + `"}`) _, _ = n.Request("user.del", msg, time.Second*3) @@ -173,28 +161,6 @@ func init() { time.Sleep(time.Duration(n) * time.Second) }) - Then(`^The output users table should contain "(.+?)" assigned to "(.+?)" group$`, func(user string, group string) { - lines := strings.Split(lastOutput, "\n") - for _, l := range lines { - if strings.Contains(l, user) { - if !strings.Contains(l, "| "+group) { - T.Errorf(`User doesn't seem to belong to specified group: \n` + l) - } - } - } - }) - - Then(`^The output projects table should contain "(.+?)" assigned to "(.+?)" group$`, func(project string, group string) { - lines := strings.Split(lastOutput, "\n") - for _, l := range lines { - if strings.Contains(l, project) { - if !strings.Contains(l, "| "+group) { - T.Errorf(`Project doesn't seem to belong to specified group: \n` + l) - } - } - } - }) - Then(`^The output line number "(.+?)" should contain "(.+?)"$`, func(number int, needle string) { lines := strings.Split(lastOutput, "\n") n := strconv.Itoa(number) @@ -358,11 +324,6 @@ func init() { lastError = err }) - And(`^the group "(.+?)" does not exist$`, func(group string) { - msg := []byte(`{"name":"` + group + `"}`) - _, _ = n.Request("group.del", msg, time.Second*3) - }) - And(`^the user "(.+?)" does not exist$`, func(user string) { msg := []byte(`{"username":"` + user + `"}`) _, _ = n.Request("user.del", msg, time.Second*3) @@ -378,13 +339,6 @@ func init() { _, _ = n.Request("service.del", msg, time.Second*3) }) - And(`^the group "(.+?)" exists$`, func(group string) { - msg := []byte(`{"name":"` + group + `"}`) - _, _ = n.Request("group.del", msg, time.Second*3) - msg = []byte(`{"name":"` + group + `"}`) - _, _ = n.Request("group.set", msg, time.Second*3) - }) - And(`^the user "(.+?)" exists$`, func(user string) { msg := []byte(`{"username":"` + user + `"}`) _, _ = n.Request("user.del", msg, time.Second*3) @@ -518,28 +472,6 @@ func init() { time.Sleep(time.Duration(n) * time.Millisecond) }) - Then(`^The output users table should contain "(.+?)" assigned to "(.+?)" group$`, func(user string, group string) { - lines := strings.Split(lastOutput, "\n") - for _, l := range lines { - if strings.Contains(l, user) { - if !strings.Contains(l, "| "+group) { - T.Errorf(`User doesn't seem to belong to specified group: \n` + l) - } - } - } - }) - - Then(`^The output projects table should contain "(.+?)" assigned to "(.+?)" group$`, func(project string, group string) { - lines := strings.Split(lastOutput, "\n") - for _, l := range lines { - if strings.Contains(l, project) { - if !strings.Contains(l, "| "+group) { - T.Errorf(`Project doesn't seem to belong to specified group: \n` + l) - } - } - } - }) - Then(`^The output line number "(.+?)" should contain "(.+?)"$`, func(number int, needle string) { lines := strings.Split(lastOutput, "\n") n := strconv.Itoa(number) diff --git a/setup b/setup index 83fafcc..433b76b 100755 --- a/setup +++ b/setup @@ -105,8 +105,7 @@ done # setup admin accounts -./natsc request -s nats://127.0.0.1:4222 -t 5 -r 99 'group.set' '{"id":"1","name": "admin"}' -./natsc request -s nats://127.0.0.1:4222 -t 5 -r 99 'user.set' "{\"group_id\": 1, \"username\": \"$USERNAME\", \"password\": \"$PASSWORD\", \"admin\":true}" +./natsc request -s nats://127.0.0.1:4222 -t 5 -r 99 'user.set' "{\"username\": \"$USERNAME\", \"password\": \"$PASSWORD\", \"admin\":true}" echo echo "Setup complete!" From 993f909e5a0554c0395ce3ff0bb2bcc7d7815dfd Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Tue, 22 Aug 2017 16:14:07 +0100 Subject: [PATCH 19/34] updating premium.yml --- premium.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/premium.yml b/premium.yml index a6aa06e..46ae864 100644 --- a/premium.yml +++ b/premium.yml @@ -4,7 +4,7 @@ branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' From 0274e21fc890f8cb9df84e1b5c2796d775de6816 Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Tue, 22 Aug 2017 16:39:21 +0100 Subject: [PATCH 20/34] Updated call to composable command --- circle.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index c3067d7..16d2cf4 100644 --- a/circle.yml +++ b/circle.yml @@ -38,7 +38,7 @@ dependencies: - sed -i "s:ERNESTHOST:ernest.local:g" $ROOTPATH/ernest/config/nginx/ernest.local - sed -i "/ssl_certificate/d" $ROOTPATH/ernest/config/nginx/ernest.local - sed -i "s:443:80:g" $ROOTPATH/ernest/template.yml - - cd $ROOTPATH/ernest && composable gen -E ERNEST_CRYPTO_KEY=$ERNEST_CRYPTO_KEY -exclude='*-aws-connector,*-vcloud-connector' -G $BASE_VERSION $EXTRA_OPTIONS definition.yml template.yml -- + - cd $ROOTPATH/ernest && composable generate -E ERNEST_CRYPTO_KEY=$ERNEST_CRYPTO_KEY -exclude='*-aws-connector,*-vcloud-connector' -G $BASE_VERSION $EXTRA_OPTIONS definition.yml template.yml -- - cd $ROOTPATH/ernest && docker-compose -f docker-compose.yml up -d - cd $ROOTPATH/ernest && docker-compose logs > /tmp/compose.log: background: true @@ -50,4 +50,3 @@ dependencies: test: override: - cd $ROOTPATH/ernest && make test - From e398800fb895eff990415b2261c728c0e312ce62 Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Tue, 22 Aug 2017 18:34:27 +0100 Subject: [PATCH 21/34] setting composable build path --- circle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/circle.yml b/circle.yml index 16d2cf4..c82b670 100644 --- a/circle.yml +++ b/circle.yml @@ -34,6 +34,7 @@ dependencies: - $ROOTPATH/ernest/internal/ci_install_service.sh r3labs composable master - $ROOTPATH/ernest/internal/ci_install_service.sh ernestio ernest-cli $CLI_VERSION - mkdir /tmp/composable + - composable set build.path /tmp/composable - sed -i "s:443 ssl:80:g" $ROOTPATH/ernest/config/nginx/ernest.local - sed -i "s:ERNESTHOST:ernest.local:g" $ROOTPATH/ernest/config/nginx/ernest.local - sed -i "/ssl_certificate/d" $ROOTPATH/ernest/config/nginx/ernest.local From fdbfbfed86df290afee10ef6b5574a59b349953f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Wed, 23 Aug 2017 15:11:01 +0200 Subject: [PATCH 22/34] fixing datacenter output --- internal/features/cli/service_apply.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/features/cli/service_apply.feature b/internal/features/cli/service_apply.feature index 4d15b56..1f9f6da 100644 --- a/internal/features/cli/service_apply.feature +++ b/internal/features/cli/service_apply.feature @@ -15,7 +15,7 @@ Feature: Environment apply When I run ernest with "environment apply" Then The output should contain "You should specify a valid template path or store an ernest.yml on the current folder" When I run ernest with "environment apply internal/definitions/unexisting_dc.yml" - Then The output should contain "Specified datacenter does not exist" + Then The output should contain "Specified project does not exist" Scenario: Logged environment apply Given I setup ernest with target "https://ernest.local" From 6aa3777980ae7ac25aa315477a7d98f87de0e26a Mon Sep 17 00:00:00 2001 From: Mark Newman Date: Mon, 21 Aug 2017 12:45:10 +0100 Subject: [PATCH 23/34] Add authenticator service --- config/config-store/config.json | 60 +++------------------------------ definition.yml | 12 +++++++ docker-compose.yml | 10 ++++++ internal/config.tmp.json | 50 --------------------------- internal/template.yml | 2 -- 5 files changed, 26 insertions(+), 108 deletions(-) diff --git a/config/config-store/config.json b/config/config-store/config.json index 90a7944..e5d5d66 100644 --- a/config/config-store/config.json +++ b/config/config-store/config.json @@ -1,8 +1,8 @@ { - "redis": { - "addr": "redis:6379", - "password": "", - "DB": 0 + "authenticator": { + "providers": [ + {"name": "local"} + ] }, "postgres": { "names": [ @@ -27,57 +27,5 @@ "logger": { "host": "", "port": "22001" - }, - "connectors": { - "routers": [ - "fake", - "vcloud", - "vcloud-fake", - "aws", - "aws-fake", - "azure", - "azure-fake" - ], - "networks": [ - "fake", - "vcloud", - "vcloud-fake", - "aws", - "aws-fake" - ], - "instances": [ - "fake", - "vcloud", - "vcloud-fake", - "aws", - "aws-fake" - ], - "firewalls": [ - "fake", - "vcloud", - "vcloud-fake", - "aws", - "aws-fake" - ], - "nats": [ - "fake", - "vcloud", - "vcloud-fake", - "aws", - "aws-fake" - ], - "elbs": [ - "fake", - "aws", - "aws-fake" - ], - "executions": [ - "fake", - "salt" - ] - }, - "salt": { - "user": "salt", - "password": "33Arma33" } } diff --git a/definition.yml b/definition.yml index 5e233ae..203d0d9 100644 --- a/definition.yml +++ b/definition.yml @@ -26,6 +26,18 @@ repos: JWT_SECRET: 'GENERATEDJWTSECRET' ERNEST_CRYPTO_KEY: CRYPTO_KEY_TEMPLATE + - name: authenticator + path: git@github.com:ernestio/authenticator.git + branch: master + links: + - nats + depends: + - config-store + environment: + NATS_URI: 'nats://nats:4222' + JWT_SECRET: 'GENERATEDJWTSECRET' + ERNEST_CRYPTO_KEY: CRYPTO_KEY_TEMPLATE + - name: monit path: git@github.com:ernestio/monit.git branch: master diff --git a/docker-compose.yml b/docker-compose.yml index b949959..feb5d40 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,6 +51,16 @@ services: ERNEST_CRYPTO_KEY: CRYPTO_KEY_TEMPLATE JWT_SECRET: GENERATEDJWTSECRET NATS_URI: nats://nats:4222 + authenticator: + image: ernestio/authenticator:2.1.0 + links: + - nats + depends_on: + - config-store + environment: + ERNEST_CRYPTO_KEY: CRYPTO_KEY_TEMPLATE + JWT_SECRET: GENERATEDJWTSECRET + NATS_URI: nats://nats:4222 config-store: image: ernestio/config-store:2.1.0 entrypoint: /go/bin/config-store -config /etc/ernest/config.json diff --git a/internal/config.tmp.json b/internal/config.tmp.json index bd8b385..d73aa27 100644 --- a/internal/config.tmp.json +++ b/internal/config.tmp.json @@ -1,9 +1,4 @@ { - "redis": { - "addr": "redis:6379", - "password": "", - "DB": 0 - }, "postgres": { "names": [ "users", @@ -23,50 +18,5 @@ "monitor": { "host": "127.0.0.1", "port": "22000" - }, - "connectors": { - "routers": [ - "fake", - "vcloud", - "vcloud-fake", - "aws", - "aws-fake" - ], - "networks": [ - "fake", - "vcloud", - "vcloud-fake", - "aws", - "aws-fake" - ], - "instances": [ - "fake", - "vcloud", - "vcloud-fake", - "aws", - "aws-fake" - ], - "firewalls": [ - "fake", - "vcloud", - "vcloud-fake", - "aws", - "aws-fake" - ], - "nats": [ - "fake", - "vcloud", - "vcloud-fake", - "aws", - "aws-fake" - ], - "executions": [ - "fake", - "salt" - ] - }, - "salt": { - "user": "salt", - "password": "---" } } diff --git a/internal/template.yml b/internal/template.yml index e31b130..ce3cbeb 100644 --- a/internal/template.yml +++ b/internal/template.yml @@ -1,8 +1,6 @@ --- version: '2' services: - redis: - image: redis nats: image: nats ports: From d0be2d54d58164772e5c17cbcb1a26503715fa11 Mon Sep 17 00:00:00 2001 From: Mark Newman Date: Thu, 24 Aug 2017 11:33:23 +0100 Subject: [PATCH 24/34] Update field name --- config/config-store/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config-store/config.json b/config/config-store/config.json index e5d5d66..5572afc 100644 --- a/config/config-store/config.json +++ b/config/config-store/config.json @@ -1,7 +1,7 @@ { "authenticator": { "providers": [ - {"name": "local"} + {"type": "local"} ] }, "postgres": { From 4c70f22d34773a18e96d84944696d87d93397a4c Mon Sep 17 00:00:00 2001 From: Mark Newman Date: Thu, 24 Aug 2017 13:56:49 +0100 Subject: [PATCH 25/34] Fix definition for Composable --- definition.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definition.yml b/definition.yml index 203d0d9..c625bd5 100644 --- a/definition.yml +++ b/definition.yml @@ -31,7 +31,7 @@ repos: branch: master links: - nats - depends: + depends_on: - config-store environment: NATS_URI: 'nats://nats:4222' From 7c30f6dae0c9699c27b71b43e8501aa3c6038e33 Mon Sep 17 00:00:00 2001 From: Mark Newman Date: Fri, 25 Aug 2017 18:36:41 +0100 Subject: [PATCH 26/34] Fix missing user type --- internal/ci_setup.sh | 2 +- internal/features/cli/login.feature | 2 +- internal/features/cli/user_disable.feature | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/ci_setup.sh b/internal/ci_setup.sh index a4f05b8..579155d 100755 --- a/internal/ci_setup.sh +++ b/internal/ci_setup.sh @@ -1,4 +1,4 @@ -$GOBIN/natsc request -s $NATS_URI -t 5 -r 99 'user.set' '{"username": "ci_admin", "password": "secret123", "admin":true}' +$GOBIN/natsc request -s $NATS_URI -t 5 -r 99 'user.set' '{"username": "ci_admin", "password": "secret123", "type": "local", "admin":true}' ernest-cli target $CURRENT_INSTANCE ernest-cli login --user ci_admin --password secret123 ernest-cli user create usr secret123 diff --git a/internal/features/cli/login.feature b/internal/features/cli/login.feature index 464a01d..71249f8 100644 --- a/internal/features/cli/login.feature +++ b/internal/features/cli/login.feature @@ -14,7 +14,7 @@ Feature: Ernest login Scenario: Login with non existing user When I'm logged in as "unexisting" / "secret123" - Then The output should contain "The keypair user / password does not match any user on the database, please try again" + Then The output should contain "Authentication failed" Scenario: Login with no username When I'm logged in as "" / "invalid123" diff --git a/internal/features/cli/user_disable.feature b/internal/features/cli/user_disable.feature index 79b82f5..701cb5f 100644 --- a/internal/features/cli/user_disable.feature +++ b/internal/features/cli/user_disable.feature @@ -31,5 +31,4 @@ Feature: Ernest user disable And I run ernest with "user disable to_disable" And The output should contain "Account `to_disable` has been disabled" And I'm logged in as "to_disable" / "secret123" - Then The output should contain "The keypair user / password does not match any user on the database, please try again" - + Then The output should contain "Authentication failed" From f0ab7be9960d65cbace97b5e571f2b28a59ab473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Mon, 28 Aug 2017 10:57:00 +0200 Subject: [PATCH 27/34] Authorization tests --- internal/features/cli/authorization.feature | 45 +++++++++++++++++++++ internal/features/steps/step_definitions.go | 4 ++ 2 files changed, 49 insertions(+) create mode 100644 internal/features/cli/authorization.feature diff --git a/internal/features/cli/authorization.feature b/internal/features/cli/authorization.feature new file mode 100644 index 0000000..c159071 --- /dev/null +++ b/internal/features/cli/authorization.feature @@ -0,0 +1,45 @@ +@authorization +Feature: Ernest authorization management + + Scenario: bla + Given I setup ernest with target "https://ernest.local" + And I'm logged in as "ci_admin" / "secret123" + And I run ernest with "user create auth secret123" + And I'm logged in as "auth" / "secret123" + And The output should contain "Welcome back auth" + When I run ernest with "project list" + Then The output should contain "There are no projects created yet." + When I run ernest with "env list" + Then The output should contain "There are no environments created yet" + When I run ernest with "project create aws --secret_access_key tmp_secret_access_key --access_key_id tmp_secret_up_to_16_chars --region tmp_region auth_project" + Then The output should contain "Project 'auth_project' successfully created" + When I run ernest with "project list" + Then The output should contain "auth_project" + When I'm logged in as "ci_admin" / "secret123" + And I run ernest with "role set -u auth -r reader -p fakeaws" + When I'm logged in as "auth" / "secret123" + And I run ernest with "project list" + Then The output should contain "auth_project" + And The output should contain "fakeaws" + When I setup a new environment name "auth_env" + And I apply the definition "aws1.yml" + And I wait for "3" seconds + And The output should contain "You don't have permissions to perform this action, please login as a resource owner" + When I'm logged in as "ci_admin" / "secret123" + And I run ernest with "role set -u auth -r owner -p fakeaws" + When I'm logged in as "auth" / "secret123" + And I apply the definition "aws1.yml" + And I wait for "3" seconds + And I run ernest with "env list" + Then The output should contain "auth_env" + When I'm logged in as "usr" / "secret123" + And I run ernest with "env list" + Then The output should not contain "auth_env" + When I run ernest with "env info auth_project auth_env" + Then The output should contain "Specified environment name does not exist" + When I run ernest with "project info auth_project" + Then The output should contain "403 Forbidden" + + + + diff --git a/internal/features/steps/step_definitions.go b/internal/features/steps/step_definitions.go index 403aa4d..0df1b2a 100644 --- a/internal/features/steps/step_definitions.go +++ b/internal/features/steps/step_definitions.go @@ -44,6 +44,10 @@ func init() { serviceName = "aws" + strconv.Itoa(rand.Intn(9999999)) }) + Given(`^I setup a new environment name "(.+?)"$`, func(name string) { + serviceName = name + }) + Given(`^I setup ernest with target "(.+?)"$`, func(target string) { if os.Getenv("CURRENT_INSTANCE") != "" { target = os.Getenv("CURRENT_INSTANCE") From 35265de133986703e0f9f2498605225d2d1af1ce Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Tue, 29 Aug 2017 18:26:08 +0100 Subject: [PATCH 28/34] fixing tests for credential change --- .../aws/add_and_attach_network.feature | 4 +-- .../aws/add_egress_security_group.feature | 2 +- internal/features/aws/add_elb_and_s3.feature | 2 +- .../aws/add_ingress_security_group.feature | 2 +- .../aws/add_nat_and_attach_a_network.feature | 4 +-- internal/features/aws/add_network.feature | 2 +- .../features/aws/add_rds_clusters.feature | 2 +- .../features/aws/add_rds_instances.feature | 2 +- .../append_instance_security_group.feature | 2 +- internal/features/aws/base.feature | 6 ++-- .../aws/decrease_instances_count.feature | 2 +- .../features/aws/delete_rds_clusters.feature | 2 +- .../features/aws/delete_rds_instances.feature | 2 +- .../aws/increment_instances_count.feature | 2 +- .../aws/remove_and_dettach_network.feature | 4 +-- .../features/aws/remove_elb_and_s3.feature | 2 +- internal/features/aws/remove_network.feature | 2 +- .../aws/remove_security_groups.feature | 2 +- .../features/aws/update_elb_and_s3.feature | 2 +- .../features/aws/update_rds_clusters.feature | 2 +- .../features/aws/update_rds_instances.feature | 2 +- internal/features/azure/base.feature | 2 +- internal/features/steps/step_definitions.go | 32 +++++++++++-------- 23 files changed, 45 insertions(+), 41 deletions(-) diff --git a/internal/features/aws/add_and_attach_network.feature b/internal/features/aws/add_and_attach_network.feature index 07c165a..e4b8545 100644 --- a/internal/features/aws/add_and_attach_network.feature +++ b/internal/features/aws/add_and_attach_network.feature @@ -11,15 +11,15 @@ Feature: Environment apply And I stop recording Then an event "network.create.aws-fake" should be called exactly "1" times And all "network.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "network.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.create.aws-fake" messages should contain a field "name" with "bknd" And all "network.create.aws-fake" messages should contain a field "range" with "10.2.0.0/24" + And all "network.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" Then an event "instance.create.aws-fake" should be called exactly "1" times And all "instance.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.create.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "instance.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.create.aws-fake" number "0" should contain "null" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/add_egress_security_group.feature b/internal/features/aws/add_egress_security_group.feature index fdc824d..413afae 100644 --- a/internal/features/aws/add_egress_security_group.feature +++ b/internal/features/aws/add_egress_security_group.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "firewall.update.aws-fake" should be called exactly "1" times And all "firewall.update.aws-fake" messages should contain a field "vpc_id" with "fakeaws" - And all "firewall.update.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "firewall.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And all "firewall.update.aws-fake" messages should contain a field "name" with "web-sg-1" diff --git a/internal/features/aws/add_elb_and_s3.feature b/internal/features/aws/add_elb_and_s3.feature index 8a5478d..b0cb1e5 100644 --- a/internal/features/aws/add_elb_and_s3.feature +++ b/internal/features/aws/add_elb_and_s3.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "elb.create.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "elb.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "elb.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "elb.create.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "elb.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "elb.create.aws-fake" messages should contain a field "name" with "elb-1" And message "elb.create.aws-fake" number "0" should contain "web-1" as json field "instance_names.0" And message "elb.create.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/add_ingress_security_group.feature b/internal/features/aws/add_ingress_security_group.feature index 0c51332..48e965a 100644 --- a/internal/features/aws/add_ingress_security_group.feature +++ b/internal/features/aws/add_ingress_security_group.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "firewall.update.aws-fake" should be called exactly "1" times And all "firewall.update.aws-fake" messages should contain a field "vpc_id" with "fakeaws" - And all "firewall.update.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "firewall.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And all "firewall.update.aws-fake" messages should contain a field "name" with "web-sg-1" diff --git a/internal/features/aws/add_nat_and_attach_a_network.feature b/internal/features/aws/add_nat_and_attach_a_network.feature index 63cb39c..65920e5 100644 --- a/internal/features/aws/add_nat_and_attach_a_network.feature +++ b/internal/features/aws/add_nat_and_attach_a_network.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "nat.create.aws-fake" should be called exactly "1" times And all "nat.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "nat.create.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "nat.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "nat.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "nat.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And all "nat.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" @@ -20,8 +20,8 @@ Feature: Environment apply And all "nat.create.aws-fake" messages should contain a field "_state" with "running" Then an event "network.create.aws-fake" should be called exactly "1" times And all "network.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "network.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.create.aws-fake" messages should contain a field "range" with "10.2.0.0/24" + And all "network.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" diff --git a/internal/features/aws/add_network.feature b/internal/features/aws/add_network.feature index 2b74347..4abf741 100644 --- a/internal/features/aws/add_network.feature +++ b/internal/features/aws/add_network.feature @@ -11,8 +11,8 @@ Feature: Environment apply And I stop recording Then an event "network.create.aws-fake" should be called exactly "1" times And all "network.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "network.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.create.aws-fake" messages should contain a field "range" with "10.2.0.0/24" + And all "network.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" diff --git a/internal/features/aws/add_rds_clusters.feature b/internal/features/aws/add_rds_clusters.feature index 650044a..1d678d0 100644 --- a/internal/features/aws/add_rds_clusters.feature +++ b/internal/features/aws/add_rds_clusters.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_cluster.create.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_cluster.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_cluster.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_cluster.create.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "rds_cluster.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "rds_cluster.create.aws-fake" messages should contain a field "name" with "aurora" And all "rds_cluster.create.aws-fake" messages should contain a field "engine" with "aurora" And all "rds_cluster.create.aws-fake" messages should contain a field "database_name" with "test" diff --git a/internal/features/aws/add_rds_instances.feature b/internal/features/aws/add_rds_instances.feature index 6b6e815..398b608 100644 --- a/internal/features/aws/add_rds_instances.feature +++ b/internal/features/aws/add_rds_instances.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_instance.create.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_instance.create.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "rds_instance.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "rds_instance.create.aws-fake" messages should contain a field "name" with "test-1" And all "rds_instance.create.aws-fake" messages should contain a field "size" with "db.r3.large" And all "rds_instance.create.aws-fake" messages should contain a field "cluster" with "aurora" diff --git a/internal/features/aws/append_instance_security_group.feature b/internal/features/aws/append_instance_security_group.feature index 2467b0f..04a8796 100644 --- a/internal/features/aws/append_instance_security_group.feature +++ b/internal/features/aws/append_instance_security_group.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "instance.update.aws-fake" should be called exactly "1" times And all "instance.update.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.update.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "instance.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "instance.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.update.aws-fake" number "0" should contain "null" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/base.feature b/internal/features/aws/base.feature index 33ac411..ce39e4b 100644 --- a/internal/features/aws/base.feature +++ b/internal/features/aws/base.feature @@ -10,14 +10,14 @@ Feature: Environment apply And I stop recording Then an event "network.create.aws-fake" should be called exactly "1" times And all "network.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "network.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.create.aws-fake" messages should contain a field "range" with "10.1.0.0/24" + And all "network.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" Then an event "firewall.create.aws-fake" should be called exactly "1" times And all "firewall.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" - And all "firewall.create.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "firewall.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "firewall.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "firewall.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And all "firewall.create.aws-fake" messages should contain a field "name" with "web-sg-1" @@ -28,7 +28,7 @@ Feature: Environment apply And message "firewall.create.aws-fake" number "0" should contain "running" as json field "_state" Then an event "instance.create.aws-fake" should be called exactly "1" times And all "instance.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.create.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "instance.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.create.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/decrease_instances_count.feature b/internal/features/aws/decrease_instances_count.feature index e3c30af..e28d6b8 100644 --- a/internal/features/aws/decrease_instances_count.feature +++ b/internal/features/aws/decrease_instances_count.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "instance.delete.aws-fake" should be called exactly "1" times And all "instance.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "instance.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "instance.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.delete.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/delete_rds_clusters.feature b/internal/features/aws/delete_rds_clusters.feature index 3a67494..1bad0e5 100644 --- a/internal/features/aws/delete_rds_clusters.feature +++ b/internal/features/aws/delete_rds_clusters.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_cluster.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_cluster.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_cluster.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_cluster.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "rds_cluster.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "rds_cluster.delete.aws-fake" messages should contain a field "name" with "aurora" And all "rds_cluster.delete.aws-fake" messages should contain a field "engine" with "aurora" And all "rds_cluster.delete.aws-fake" messages should contain a field "database_name" with "test" diff --git a/internal/features/aws/delete_rds_instances.feature b/internal/features/aws/delete_rds_instances.feature index ebee527..d0f56f6 100644 --- a/internal/features/aws/delete_rds_instances.feature +++ b/internal/features/aws/delete_rds_instances.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_instance.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_instance.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_instance.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_instance.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "rds_instance.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "rds_instance.delete.aws-fake" messages should contain a field "name" with "test-1" And all "rds_instance.delete.aws-fake" messages should contain a field "size" with "db.r3.xlarge" And all "rds_instance.delete.aws-fake" messages should contain a field "cluster" with "aurora" diff --git a/internal/features/aws/increment_instances_count.feature b/internal/features/aws/increment_instances_count.feature index af30a82..e8db121 100644 --- a/internal/features/aws/increment_instances_count.feature +++ b/internal/features/aws/increment_instances_count.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "instance.create.aws-fake" should be called exactly "1" times And all "instance.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.create.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "instance.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.create.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/remove_and_dettach_network.feature b/internal/features/aws/remove_and_dettach_network.feature index b1954fa..06e6141 100644 --- a/internal/features/aws/remove_and_dettach_network.feature +++ b/internal/features/aws/remove_and_dettach_network.feature @@ -11,14 +11,14 @@ Feature: Environment apply And I stop recording Then an event "network.delete.aws-fake" should be called exactly "1" times And all "network.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "network.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.delete.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.delete.aws-fake" messages should contain a field "range" with "10.2.0.0/24" + And all "network.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "network.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" Then an event "instance.delete.aws-fake" should be called exactly "1" times And all "instance.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "instance.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "instance.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.delete.aws-fake" number "0" should contain "null" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/remove_elb_and_s3.feature b/internal/features/aws/remove_elb_and_s3.feature index 5bc9af2..a9de608 100644 --- a/internal/features/aws/remove_elb_and_s3.feature +++ b/internal/features/aws/remove_elb_and_s3.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "elb.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "elb.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "elb.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "elb.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "elb.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "elb.delete.aws-fake" messages should contain a field "name" with "elb-1" And message "elb.delete.aws-fake" number "0" should contain "web-1" as json field "instance_names.0" And message "elb.delete.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/remove_network.feature b/internal/features/aws/remove_network.feature index 0d1034d..acfeac2 100644 --- a/internal/features/aws/remove_network.feature +++ b/internal/features/aws/remove_network.feature @@ -11,8 +11,8 @@ Feature: Environment apply And I stop recording Then an event "network.delete.aws-fake" should be called exactly "1" times And all "network.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "network.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.delete.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.delete.aws-fake" messages should contain a field "range" with "10.2.0.0/24" + And all "network.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "network.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" diff --git a/internal/features/aws/remove_security_groups.feature b/internal/features/aws/remove_security_groups.feature index 6ac7b55..f625df5 100644 --- a/internal/features/aws/remove_security_groups.feature +++ b/internal/features/aws/remove_security_groups.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "firewall.update.aws-fake" should be called exactly "1" times And all "firewall.update.aws-fake" messages should contain a field "vpc_id" with "fakeaws" - And all "firewall.update.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "firewall.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And all "firewall.update.aws-fake" messages should contain a field "name" with "web-sg-1" diff --git a/internal/features/aws/update_elb_and_s3.feature b/internal/features/aws/update_elb_and_s3.feature index 5db1ebf..bc935f7 100644 --- a/internal/features/aws/update_elb_and_s3.feature +++ b/internal/features/aws/update_elb_and_s3.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "elb.update.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "elb.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "elb.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "elb.update.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "elb.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "elb.update.aws-fake" messages should contain a field "name" with "elb-1" And message "elb.update.aws-fake" number "0" should contain "web-1" as json field "instance_names.0" And message "elb.update.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/update_rds_clusters.feature b/internal/features/aws/update_rds_clusters.feature index f15fe79..60588bd 100644 --- a/internal/features/aws/update_rds_clusters.feature +++ b/internal/features/aws/update_rds_clusters.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_cluster.update.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_cluster.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_cluster.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_cluster.update.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "rds_cluster.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "rds_cluster.update.aws-fake" messages should contain a field "name" with "aurora" And all "rds_cluster.update.aws-fake" messages should contain a field "engine" with "aurora" And all "rds_cluster.update.aws-fake" messages should contain a field "database_name" with "test" diff --git a/internal/features/aws/update_rds_instances.feature b/internal/features/aws/update_rds_instances.feature index 1808cd5..053590f 100644 --- a/internal/features/aws/update_rds_instances.feature +++ b/internal/features/aws/update_rds_instances.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_instance.update.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_instance.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_instance.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_instance.update.aws-fake" messages should contain a field "datacenter_region" with "fake" + And all "rds_instance.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" And all "rds_instance.update.aws-fake" messages should contain a field "name" with "test-1" And all "rds_instance.update.aws-fake" messages should contain a field "size" with "db.r3.xlarge" And all "rds_instance.update.aws-fake" messages should contain a field "cluster" with "aurora" diff --git a/internal/features/azure/base.feature b/internal/features/azure/base.feature index 324bd7e..7c85f05 100644 --- a/internal/features/azure/base.feature +++ b/internal/features/azure/base.feature @@ -10,9 +10,9 @@ Feature: Applying an azure based environment And I stop recording Then an event "resource_group.create.azure-fake" should be called exactly "1" times And all "resource_group.create.azure-fake" messages should contain a field "_provider" with "azure-fake" - And all "resource_group.create.azure-fake" messages should contain a field "datacenter_region" with "westus" And all "resource_group.create.azure-fake" messages should contain a field "name" with "rg2" And all "resource_group.create.azure-fake" messages should contain a field "location" with "eastus" + And all "resource_group.create.azure-fake" messages should contain an encrypted field "datacenter_region" with "westus" And all "resource_group.create.azure-fake" messages should contain an encrypted field "azure_client_id" with "cliid" And all "resource_group.create.azure-fake" messages should contain an encrypted field "azure_client_secret" with "clisec" And all "resource_group.create.azure-fake" messages should contain an encrypted field "azure_subscription_id" with "subid" diff --git a/internal/features/steps/step_definitions.go b/internal/features/steps/step_definitions.go index 0df1b2a..2723434 100644 --- a/internal/features/steps/step_definitions.go +++ b/internal/features/steps/step_definitions.go @@ -396,33 +396,35 @@ func init() { msg := []byte(`{"name":"` + name + `", "type":"azure"}`) res, _ := n.Request("datacenter.get", msg, time.Second*3) var d struct { - SubscriptionID string `json:"azure_subscription_id"` - ClientID string `json:"azure_client_id"` - ClientSecret string `json:"azure_client_secret"` - TenantID string `json:"azure_tenant_id"` - Environment string `json:"azure_environment"` + Credentials struct { + SubscriptionID string `json:"azure_subscription_id"` + ClientID string `json:"azure_client_id"` + ClientSecret string `json:"azure_client_secret"` + TenantID string `json:"azure_tenant_id"` + Environment string `json:"azure_environment"` + } `json:"credentials"` } key := os.Getenv("ERNEST_CRYPTO_KEY") _ = json.Unmarshal(res.Data, &d) crypto := aes.New() - subscriptionID, err := crypto.Decrypt(d.SubscriptionID, key) + subscriptionID, err := crypto.Decrypt(d.Credentials.SubscriptionID, key) if err != nil { log.Println(err) } - clientID, err := crypto.Decrypt(d.ClientID, key) + clientID, err := crypto.Decrypt(d.Credentials.ClientID, key) if err != nil { log.Println(err) } - clientSecret, err := crypto.Decrypt(d.ClientSecret, key) + clientSecret, err := crypto.Decrypt(d.Credentials.ClientSecret, key) if err != nil { log.Println(err) } - tenantID, err := crypto.Decrypt(d.TenantID, key) + tenantID, err := crypto.Decrypt(d.Credentials.TenantID, key) if err != nil { log.Println(err) } - environment, err := crypto.Decrypt(d.Environment, key) + environment, err := crypto.Decrypt(d.Credentials.Environment, key) if err != nil { log.Println(err) } @@ -448,18 +450,20 @@ func init() { msg := []byte(`{"name":"` + name + `", "type":"aws"}`) res, _ := n.Request("datacenter.get", msg, time.Second*3) var d struct { - Token string `json:"aws_access_key_id"` - Secret string `json:"aws_secret_access_key"` + Credentials struct { + Token string `json:"aws_access_key_id"` + Secret string `json:"aws_secret_access_key"` + } `json:"credentials"` } key := os.Getenv("ERNEST_CRYPTO_KEY") _ = json.Unmarshal(res.Data, &d) crypto := aes.New() - tk, err := crypto.Decrypt(d.Token, key) + tk, err := crypto.Decrypt(d.Credentials.Token, key) if err != nil { log.Println(err) } - se, err := crypto.Decrypt(d.Secret, key) + se, err := crypto.Decrypt(d.Credentials.Secret, key) if err != nil { log.Println(err) } From 6de998b109a1afbe18e3c3965f1cc7d1fb61e229 Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Tue, 29 Aug 2017 18:44:25 +0100 Subject: [PATCH 29/34] fixing vcloud features --- internal/features/vcloud/add_and_attach_network.feature | 4 ++-- internal/features/vcloud/base.feature | 6 +++--- internal/features/vcloud/decrease_instances_count.feature | 2 +- internal/features/vcloud/increase_instances_count.feature | 2 +- internal/features/vcloud/instance_only.feature | 2 +- internal/features/vcloud/remove_and_dettach_network.feature | 4 ++-- internal/features/vcloud/update_firewall_rules.feature | 2 +- internal/features/vcloud/update_instances_resource.feature | 2 +- internal/features/vcloud/update_nat_rules.feature | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/features/vcloud/add_and_attach_network.feature b/internal/features/vcloud/add_and_attach_network.feature index dfb3ba6..2614ee4 100644 --- a/internal/features/vcloud/add_and_attach_network.feature +++ b/internal/features/vcloud/add_and_attach_network.feature @@ -12,13 +12,13 @@ Feature: Environment apply Then an event "network.create.vcloud-fake" should be called exactly "1" times And all "network.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "network.create.vcloud-fake" messages should contain a field "range" with "10.1.0.0/24" - And all "network.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "network.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" + And all "network.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "network.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "network.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" Then an event "instance.create.vcloud-fake" should be called exactly "1" times And all "instance.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" - And all "instance.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" + And all "instance.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "instance.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" diff --git a/internal/features/vcloud/base.feature b/internal/features/vcloud/base.feature index 15354b4..f0681ef 100644 --- a/internal/features/vcloud/base.feature +++ b/internal/features/vcloud/base.feature @@ -11,8 +11,8 @@ Feature: Environment apply Then an event "router.create.vcloud-fake" should be called exactly "1" times And all "router.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "router.create.vcloud-fake" messages should contain a field "name" with "vse2" - And all "router.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "router.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" + And all "router.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "router.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "router.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And message "router.create.vcloud-fake" number "0" should contain "in_in_any" as json field "firewall_rules.0.name" @@ -48,13 +48,13 @@ Feature: Environment apply Then an event "network.create.vcloud-fake" should be called exactly "1" times And all "network.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "network.create.vcloud-fake" messages should contain a field "range" with "10.1.0.0/24" - And all "network.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" + And all "network.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "network.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" And all "network.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "network.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" Then an event "instance.create.vcloud-fake" should be called exactly "1" times And all "instance.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" - And all "instance.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" + And all "instance.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "instance.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" diff --git a/internal/features/vcloud/decrease_instances_count.feature b/internal/features/vcloud/decrease_instances_count.feature index d125879..71e0c43 100644 --- a/internal/features/vcloud/decrease_instances_count.feature +++ b/internal/features/vcloud/decrease_instances_count.feature @@ -11,8 +11,8 @@ Feature: Environment apply And I stop recording Then an event "instance.delete.vcloud-fake" should be called exactly "1" times And all "instance.delete.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" - And all "instance.delete.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.delete.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" + And all "instance.delete.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "instance.delete.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.delete.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And all "instance.delete.vcloud-fake" messages should contain a field "name" with "web-2" diff --git a/internal/features/vcloud/increase_instances_count.feature b/internal/features/vcloud/increase_instances_count.feature index 52d06f7..51f77f0 100644 --- a/internal/features/vcloud/increase_instances_count.feature +++ b/internal/features/vcloud/increase_instances_count.feature @@ -11,8 +11,8 @@ Feature: Environment apply And I stop recording Then an event "instance.create.vcloud-fake" should be called exactly "1" times And all "instance.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" - And all "instance.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" + And all "instance.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And all "instance.create.vcloud-fake" messages should contain a field "name" with "web-2" diff --git a/internal/features/vcloud/instance_only.feature b/internal/features/vcloud/instance_only.feature index 7d46879..a4c8d16 100644 --- a/internal/features/vcloud/instance_only.feature +++ b/internal/features/vcloud/instance_only.feature @@ -10,8 +10,8 @@ Feature: Environment apply And I stop recording Then an event "instance.create.vcloud-fake" should be called exactly "1" times And all "instance.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" - And all "instance.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" + And all "instance.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And all "instance.create.vcloud-fake" messages should contain a field "name" with "web-1" diff --git a/internal/features/vcloud/remove_and_dettach_network.feature b/internal/features/vcloud/remove_and_dettach_network.feature index 62772aa..b9f44dd 100644 --- a/internal/features/vcloud/remove_and_dettach_network.feature +++ b/internal/features/vcloud/remove_and_dettach_network.feature @@ -11,8 +11,8 @@ Feature: Environment apply And I stop recording Then an event "instance.delete.vcloud-fake" should be called exactly "1" times And all "instance.delete.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" - And all "instance.delete.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.delete.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" + And all "instance.delete.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "instance.delete.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.delete.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And all "instance.delete.vcloud-fake" messages should contain a field "name" with "web-1" @@ -26,7 +26,7 @@ Feature: Environment apply Then an event "network.delete.vcloud-fake" should be called exactly "1" times And all "network.delete.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "network.delete.vcloud-fake" messages should contain a field "range" with "10.1.0.0/24" - And all "network.delete.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "network.delete.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" + And all "network.delete.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "network.delete.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "network.delete.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" diff --git a/internal/features/vcloud/update_firewall_rules.feature b/internal/features/vcloud/update_firewall_rules.feature index ad14a82..7fbb8cb 100644 --- a/internal/features/vcloud/update_firewall_rules.feature +++ b/internal/features/vcloud/update_firewall_rules.feature @@ -12,8 +12,8 @@ Feature: Environment apply Then an event "router.update.vcloud-fake" should be called exactly "1" times And all "router.update.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "router.update.vcloud-fake" messages should contain a field "name" with "vse2" - And all "router.update.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "router.update.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" + And all "router.update.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "router.update.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "router.update.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And message "router.update.vcloud-fake" number "0" should contain "in_in_any" as json field "firewall_rules.0.name" diff --git a/internal/features/vcloud/update_instances_resource.feature b/internal/features/vcloud/update_instances_resource.feature index e36ac4a..bb9d1c4 100644 --- a/internal/features/vcloud/update_instances_resource.feature +++ b/internal/features/vcloud/update_instances_resource.feature @@ -11,8 +11,8 @@ Feature: Environment apply And I stop recording Then an event "instance.update.vcloud-fake" should be called exactly "2" times And all "instance.update.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" - And all "instance.update.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.update.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" + And all "instance.update.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "instance.update.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.update.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And message "instance.update.vcloud-fake" number "0" should contain "web-1" as json field "name" diff --git a/internal/features/vcloud/update_nat_rules.feature b/internal/features/vcloud/update_nat_rules.feature index 2272137..9543f00 100644 --- a/internal/features/vcloud/update_nat_rules.feature +++ b/internal/features/vcloud/update_nat_rules.feature @@ -12,8 +12,8 @@ Feature: Environment apply Then an event "router.update.vcloud-fake" should be called exactly "1" times And all "router.update.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "router.update.vcloud-fake" messages should contain a field "name" with "vse2" - And all "router.update.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "router.update.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" + And all "router.update.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" And all "router.update.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "router.update.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And message "router.update.vcloud-fake" number "0" should contain "dnat" as json field "nat_rules.0.type" From 364e623e531c528895b30f4d53f8a21a64a2ed17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Wed, 30 Aug 2017 12:10:01 +0200 Subject: [PATCH 30/34] Check credentials replacement on deletion messages --- .../features/cli/environment_credentials.feature | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/features/cli/environment_credentials.feature b/internal/features/cli/environment_credentials.feature index d7d0fd4..b9fa8df 100644 --- a/internal/features/cli/environment_credentials.feature +++ b/internal/features/cli/environment_credentials.feature @@ -33,3 +33,16 @@ Feature: Environment credentials Then all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars_2" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "tmp_secret_access_key_2" + Scenario: Override environment credentials with update + Given I setup ernest with target "https://ernest.local" + And The environment "tmp_cred_update" does not exist + And I setup a new environment name "tmp_cred_update" + And I'm logged in as "usr" / "secret123" + And I apply the definition "aws8.yml" + When I run ernest with "env update fakeaws tmp_cred_update --secret_access_key tmp_secret_access_key_upd --access_key_id tmp_secret_up_to_16_chars_upd" + And I start recording + And I apply the definition "aws9.yml" + And I stop recording + Then all "network.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars_upd" + And all "network.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "tmp_secret_access_key_upd" + From a2521a68cc63694229bf734858d3965231b448b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cidre?= Date: Wed, 30 Aug 2017 16:46:14 +0200 Subject: [PATCH 31/34] [#ERNEST-658] : Credentials not persisting on environment deletion --- internal/features/cli/environment_credentials.feature | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/features/cli/environment_credentials.feature b/internal/features/cli/environment_credentials.feature index b9fa8df..c9286be 100644 --- a/internal/features/cli/environment_credentials.feature +++ b/internal/features/cli/environment_credentials.feature @@ -45,4 +45,10 @@ Feature: Environment credentials And I stop recording Then all "network.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars_upd" And all "network.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "tmp_secret_access_key_upd" + And I start recording + And I run ernest with "env delete fakeaws tmp_cred_update" + And I stop recording + Then all "instance.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars_upd" + And all "instance.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "tmp_secret_access_key_upd" + From e595ff9cf1090e59340493bb822b36289c794e2f Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Thu, 31 Aug 2017 12:10:19 +0100 Subject: [PATCH 32/34] fixing tests --- internal/features/cli/environment_credentials.feature | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/features/cli/environment_credentials.feature b/internal/features/cli/environment_credentials.feature index c9286be..a2955de 100644 --- a/internal/features/cli/environment_credentials.feature +++ b/internal/features/cli/environment_credentials.feature @@ -46,9 +46,7 @@ Feature: Environment credentials Then all "network.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars_upd" And all "network.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "tmp_secret_access_key_upd" And I start recording - And I run ernest with "env delete fakeaws tmp_cred_update" + And I run ernest with "env delete -y fakeaws tmp_cred_update" And I stop recording - Then all "instance.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars_upd" - And all "instance.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "tmp_secret_access_key_upd" - - + Then all "firewall.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "tmp_secret_up_to_16_chars_upd" + And all "firewall.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "tmp_secret_access_key_upd" From 42ddaded2523a4e5e52b70397af34c6f44e4d97f Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Fri, 1 Sep 2017 12:09:50 +0100 Subject: [PATCH 33/34] corrected azure test --- internal/features/cli/datacenter_create_azure.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/features/cli/datacenter_create_azure.feature b/internal/features/cli/datacenter_create_azure.feature index 19e87e7..ee865ff 100644 --- a/internal/features/cli/datacenter_create_azure.feature +++ b/internal/features/cli/datacenter_create_azure.feature @@ -31,7 +31,7 @@ Feature: Ernest project create Then The output should contain "Project 'tmp_project' successfully created" When I run ernest with "project list" Then The output should contain "tmp_project" - Then The output should contain "tmp_region" + Then The output should contain "westus" Then The output should contain "azure" Scenario: Adding an already existing azure project From c0fe4982839b48dbbe7589bb79c72b4739ae845e Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Mon, 4 Sep 2017 12:22:06 +0100 Subject: [PATCH 34/34] fixes to encrypted values --- internal/features/aws/add_and_attach_network.feature | 4 ++-- internal/features/aws/add_egress_security_group.feature | 2 +- internal/features/aws/add_elb_and_s3.feature | 2 +- internal/features/aws/add_ingress_security_group.feature | 2 +- internal/features/aws/add_nat_and_attach_a_network.feature | 4 ++-- internal/features/aws/add_network.feature | 2 +- internal/features/aws/add_rds_clusters.feature | 2 +- internal/features/aws/add_rds_instances.feature | 2 +- .../features/aws/append_instance_security_group.feature | 2 +- internal/features/aws/base.feature | 6 +++--- internal/features/aws/decrease_instances_count.feature | 2 +- internal/features/aws/delete_rds_clusters.feature | 2 +- internal/features/aws/delete_rds_instances.feature | 2 +- internal/features/aws/increment_instances_count.feature | 2 +- internal/features/aws/remove_and_dettach_network.feature | 4 ++-- internal/features/aws/remove_elb_and_s3.feature | 2 +- internal/features/aws/remove_network.feature | 2 +- internal/features/aws/remove_security_groups.feature | 2 +- internal/features/aws/update_elb_and_s3.feature | 2 +- internal/features/aws/update_rds_clusters.feature | 2 +- internal/features/aws/update_rds_instances.feature | 2 +- internal/features/vcloud/add_and_attach_network.feature | 4 ++-- internal/features/vcloud/base.feature | 6 +++--- internal/features/vcloud/decrease_instances_count.feature | 2 +- internal/features/vcloud/increase_instances_count.feature | 2 +- internal/features/vcloud/instance_only.feature | 2 +- internal/features/vcloud/remove_and_dettach_network.feature | 4 ++-- internal/features/vcloud/update_firewall_rules.feature | 2 +- internal/features/vcloud/update_instances_resource.feature | 2 +- internal/features/vcloud/update_nat_rules.feature | 2 +- 30 files changed, 39 insertions(+), 39 deletions(-) diff --git a/internal/features/aws/add_and_attach_network.feature b/internal/features/aws/add_and_attach_network.feature index e4b8545..eed8053 100644 --- a/internal/features/aws/add_and_attach_network.feature +++ b/internal/features/aws/add_and_attach_network.feature @@ -14,12 +14,12 @@ Feature: Environment apply And all "network.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.create.aws-fake" messages should contain a field "name" with "bknd" And all "network.create.aws-fake" messages should contain a field "range" with "10.2.0.0/24" - And all "network.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "network.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" Then an event "instance.create.aws-fake" should be called exactly "1" times And all "instance.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "instance.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.create.aws-fake" number "0" should contain "null" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/add_egress_security_group.feature b/internal/features/aws/add_egress_security_group.feature index 413afae..fdc824d 100644 --- a/internal/features/aws/add_egress_security_group.feature +++ b/internal/features/aws/add_egress_security_group.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "firewall.update.aws-fake" should be called exactly "1" times And all "firewall.update.aws-fake" messages should contain a field "vpc_id" with "fakeaws" - And all "firewall.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "firewall.update.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And all "firewall.update.aws-fake" messages should contain a field "name" with "web-sg-1" diff --git a/internal/features/aws/add_elb_and_s3.feature b/internal/features/aws/add_elb_and_s3.feature index b0cb1e5..8a5478d 100644 --- a/internal/features/aws/add_elb_and_s3.feature +++ b/internal/features/aws/add_elb_and_s3.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "elb.create.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "elb.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "elb.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "elb.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "elb.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "elb.create.aws-fake" messages should contain a field "name" with "elb-1" And message "elb.create.aws-fake" number "0" should contain "web-1" as json field "instance_names.0" And message "elb.create.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/add_ingress_security_group.feature b/internal/features/aws/add_ingress_security_group.feature index 48e965a..0c51332 100644 --- a/internal/features/aws/add_ingress_security_group.feature +++ b/internal/features/aws/add_ingress_security_group.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "firewall.update.aws-fake" should be called exactly "1" times And all "firewall.update.aws-fake" messages should contain a field "vpc_id" with "fakeaws" - And all "firewall.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "firewall.update.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And all "firewall.update.aws-fake" messages should contain a field "name" with "web-sg-1" diff --git a/internal/features/aws/add_nat_and_attach_a_network.feature b/internal/features/aws/add_nat_and_attach_a_network.feature index 65920e5..12020bf 100644 --- a/internal/features/aws/add_nat_and_attach_a_network.feature +++ b/internal/features/aws/add_nat_and_attach_a_network.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "nat.create.aws-fake" should be called exactly "1" times And all "nat.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "nat.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "nat.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "nat.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "nat.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And all "nat.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" @@ -22,6 +22,6 @@ Feature: Environment apply And all "network.create.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "network.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.create.aws-fake" messages should contain a field "range" with "10.2.0.0/24" - And all "network.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "network.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" diff --git a/internal/features/aws/add_network.feature b/internal/features/aws/add_network.feature index 4abf741..0190446 100644 --- a/internal/features/aws/add_network.feature +++ b/internal/features/aws/add_network.feature @@ -13,6 +13,6 @@ Feature: Environment apply And all "network.create.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "network.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.create.aws-fake" messages should contain a field "range" with "10.2.0.0/24" - And all "network.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "network.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" diff --git a/internal/features/aws/add_rds_clusters.feature b/internal/features/aws/add_rds_clusters.feature index 1d678d0..650044a 100644 --- a/internal/features/aws/add_rds_clusters.feature +++ b/internal/features/aws/add_rds_clusters.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_cluster.create.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_cluster.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_cluster.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_cluster.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "rds_cluster.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "rds_cluster.create.aws-fake" messages should contain a field "name" with "aurora" And all "rds_cluster.create.aws-fake" messages should contain a field "engine" with "aurora" And all "rds_cluster.create.aws-fake" messages should contain a field "database_name" with "test" diff --git a/internal/features/aws/add_rds_instances.feature b/internal/features/aws/add_rds_instances.feature index 398b608..6b6e815 100644 --- a/internal/features/aws/add_rds_instances.feature +++ b/internal/features/aws/add_rds_instances.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_instance.create.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_instance.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "rds_instance.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "rds_instance.create.aws-fake" messages should contain a field "name" with "test-1" And all "rds_instance.create.aws-fake" messages should contain a field "size" with "db.r3.large" And all "rds_instance.create.aws-fake" messages should contain a field "cluster" with "aurora" diff --git a/internal/features/aws/append_instance_security_group.feature b/internal/features/aws/append_instance_security_group.feature index 04a8796..2467b0f 100644 --- a/internal/features/aws/append_instance_security_group.feature +++ b/internal/features/aws/append_instance_security_group.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "instance.update.aws-fake" should be called exactly "1" times And all "instance.update.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "instance.update.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "instance.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.update.aws-fake" number "0" should contain "null" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/base.feature b/internal/features/aws/base.feature index ce39e4b..dc81814 100644 --- a/internal/features/aws/base.feature +++ b/internal/features/aws/base.feature @@ -12,12 +12,12 @@ Feature: Environment apply And all "network.create.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "network.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.create.aws-fake" messages should contain a field "range" with "10.1.0.0/24" - And all "network.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "network.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" Then an event "firewall.create.aws-fake" should be called exactly "1" times And all "firewall.create.aws-fake" messages should contain a field "vpc_id" with "fakeaws" - And all "firewall.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "firewall.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "firewall.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "firewall.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And all "firewall.create.aws-fake" messages should contain a field "name" with "web-sg-1" @@ -28,7 +28,7 @@ Feature: Environment apply And message "firewall.create.aws-fake" number "0" should contain "running" as json field "_state" Then an event "instance.create.aws-fake" should be called exactly "1" times And all "instance.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "instance.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.create.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/decrease_instances_count.feature b/internal/features/aws/decrease_instances_count.feature index e28d6b8..e3c30af 100644 --- a/internal/features/aws/decrease_instances_count.feature +++ b/internal/features/aws/decrease_instances_count.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "instance.delete.aws-fake" should be called exactly "1" times And all "instance.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "instance.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "instance.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.delete.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/delete_rds_clusters.feature b/internal/features/aws/delete_rds_clusters.feature index 1bad0e5..3a67494 100644 --- a/internal/features/aws/delete_rds_clusters.feature +++ b/internal/features/aws/delete_rds_clusters.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_cluster.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_cluster.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_cluster.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_cluster.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "rds_cluster.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "rds_cluster.delete.aws-fake" messages should contain a field "name" with "aurora" And all "rds_cluster.delete.aws-fake" messages should contain a field "engine" with "aurora" And all "rds_cluster.delete.aws-fake" messages should contain a field "database_name" with "test" diff --git a/internal/features/aws/delete_rds_instances.feature b/internal/features/aws/delete_rds_instances.feature index d0f56f6..ebee527 100644 --- a/internal/features/aws/delete_rds_instances.feature +++ b/internal/features/aws/delete_rds_instances.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_instance.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_instance.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_instance.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_instance.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "rds_instance.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "rds_instance.delete.aws-fake" messages should contain a field "name" with "test-1" And all "rds_instance.delete.aws-fake" messages should contain a field "size" with "db.r3.xlarge" And all "rds_instance.delete.aws-fake" messages should contain a field "cluster" with "aurora" diff --git a/internal/features/aws/increment_instances_count.feature b/internal/features/aws/increment_instances_count.feature index e8db121..af30a82 100644 --- a/internal/features/aws/increment_instances_count.feature +++ b/internal/features/aws/increment_instances_count.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "instance.create.aws-fake" should be called exactly "1" times And all "instance.create.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.create.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "instance.create.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.create.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.create.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/remove_and_dettach_network.feature b/internal/features/aws/remove_and_dettach_network.feature index 06e6141..c93d713 100644 --- a/internal/features/aws/remove_and_dettach_network.feature +++ b/internal/features/aws/remove_and_dettach_network.feature @@ -13,12 +13,12 @@ Feature: Environment apply And all "network.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "network.delete.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.delete.aws-fake" messages should contain a field "range" with "10.2.0.0/24" - And all "network.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "network.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" Then an event "instance.delete.aws-fake" should be called exactly "1" times And all "instance.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" - And all "instance.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "instance.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "instance.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "instance.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And message "instance.delete.aws-fake" number "0" should contain "null" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/remove_elb_and_s3.feature b/internal/features/aws/remove_elb_and_s3.feature index a9de608..5bc9af2 100644 --- a/internal/features/aws/remove_elb_and_s3.feature +++ b/internal/features/aws/remove_elb_and_s3.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "elb.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "elb.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "elb.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "elb.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "elb.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "elb.delete.aws-fake" messages should contain a field "name" with "elb-1" And message "elb.delete.aws-fake" number "0" should contain "web-1" as json field "instance_names.0" And message "elb.delete.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/remove_network.feature b/internal/features/aws/remove_network.feature index acfeac2..405673e 100644 --- a/internal/features/aws/remove_network.feature +++ b/internal/features/aws/remove_network.feature @@ -13,6 +13,6 @@ Feature: Environment apply And all "network.delete.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "network.delete.aws-fake" messages should contain a field "vpc_id" with "fakeaws" And all "network.delete.aws-fake" messages should contain a field "range" with "10.2.0.0/24" - And all "network.delete.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "network.delete.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "network.delete.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "network.delete.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" diff --git a/internal/features/aws/remove_security_groups.feature b/internal/features/aws/remove_security_groups.feature index f625df5..6ac7b55 100644 --- a/internal/features/aws/remove_security_groups.feature +++ b/internal/features/aws/remove_security_groups.feature @@ -11,7 +11,7 @@ Feature: Environment apply And I stop recording Then an event "firewall.update.aws-fake" should be called exactly "1" times And all "firewall.update.aws-fake" messages should contain a field "vpc_id" with "fakeaws" - And all "firewall.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "firewall.update.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "firewall.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" And all "firewall.update.aws-fake" messages should contain a field "name" with "web-sg-1" diff --git a/internal/features/aws/update_elb_and_s3.feature b/internal/features/aws/update_elb_and_s3.feature index bc935f7..5db1ebf 100644 --- a/internal/features/aws/update_elb_and_s3.feature +++ b/internal/features/aws/update_elb_and_s3.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "elb.update.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "elb.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "elb.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "elb.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "elb.update.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "elb.update.aws-fake" messages should contain a field "name" with "elb-1" And message "elb.update.aws-fake" number "0" should contain "web-1" as json field "instance_names.0" And message "elb.update.aws-fake" number "0" should contain "foo" as json field "security_group_aws_ids.0" diff --git a/internal/features/aws/update_rds_clusters.feature b/internal/features/aws/update_rds_clusters.feature index 60588bd..f15fe79 100644 --- a/internal/features/aws/update_rds_clusters.feature +++ b/internal/features/aws/update_rds_clusters.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_cluster.update.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_cluster.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_cluster.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_cluster.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "rds_cluster.update.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "rds_cluster.update.aws-fake" messages should contain a field "name" with "aurora" And all "rds_cluster.update.aws-fake" messages should contain a field "engine" with "aurora" And all "rds_cluster.update.aws-fake" messages should contain a field "database_name" with "test" diff --git a/internal/features/aws/update_rds_instances.feature b/internal/features/aws/update_rds_instances.feature index 053590f..1808cd5 100644 --- a/internal/features/aws/update_rds_instances.feature +++ b/internal/features/aws/update_rds_instances.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "rds_instance.update.aws-fake" messages should contain a field "_provider" with "aws-fake" And all "rds_instance.update.aws-fake" messages should contain an encrypted field "aws_access_key_id" with "up_to_16_characters_secret" And all "rds_instance.update.aws-fake" messages should contain an encrypted field "aws_secret_access_key" with "fake_up_to_16_characters" - And all "rds_instance.update.aws-fake" messages should contain an encrypted field "datacenter_region" with "fake" + And all "rds_instance.update.aws-fake" messages should contain a field "datacenter_region" with "fake" And all "rds_instance.update.aws-fake" messages should contain a field "name" with "test-1" And all "rds_instance.update.aws-fake" messages should contain a field "size" with "db.r3.xlarge" And all "rds_instance.update.aws-fake" messages should contain a field "cluster" with "aurora" diff --git a/internal/features/vcloud/add_and_attach_network.feature b/internal/features/vcloud/add_and_attach_network.feature index 2614ee4..aa7123a 100644 --- a/internal/features/vcloud/add_and_attach_network.feature +++ b/internal/features/vcloud/add_and_attach_network.feature @@ -13,12 +13,12 @@ Feature: Environment apply And all "network.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "network.create.vcloud-fake" messages should contain a field "range" with "10.1.0.0/24" And all "network.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" - And all "network.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "network.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "network.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "network.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" Then an event "instance.create.vcloud-fake" should be called exactly "1" times And all "instance.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" - And all "instance.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "instance.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" diff --git a/internal/features/vcloud/base.feature b/internal/features/vcloud/base.feature index f0681ef..99a2f56 100644 --- a/internal/features/vcloud/base.feature +++ b/internal/features/vcloud/base.feature @@ -12,7 +12,7 @@ Feature: Environment apply And all "router.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "router.create.vcloud-fake" messages should contain a field "name" with "vse2" And all "router.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" - And all "router.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "router.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "router.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "router.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And message "router.create.vcloud-fake" number "0" should contain "in_in_any" as json field "firewall_rules.0.name" @@ -48,13 +48,13 @@ Feature: Environment apply Then an event "network.create.vcloud-fake" should be called exactly "1" times And all "network.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "network.create.vcloud-fake" messages should contain a field "range" with "10.1.0.0/24" - And all "network.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "network.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "network.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" And all "network.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "network.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" Then an event "instance.create.vcloud-fake" should be called exactly "1" times And all "instance.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" - And all "instance.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "instance.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" diff --git a/internal/features/vcloud/decrease_instances_count.feature b/internal/features/vcloud/decrease_instances_count.feature index 71e0c43..d2320d1 100644 --- a/internal/features/vcloud/decrease_instances_count.feature +++ b/internal/features/vcloud/decrease_instances_count.feature @@ -12,7 +12,7 @@ Feature: Environment apply Then an event "instance.delete.vcloud-fake" should be called exactly "1" times And all "instance.delete.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "instance.delete.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" - And all "instance.delete.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "instance.delete.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.delete.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.delete.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And all "instance.delete.vcloud-fake" messages should contain a field "name" with "web-2" diff --git a/internal/features/vcloud/increase_instances_count.feature b/internal/features/vcloud/increase_instances_count.feature index 51f77f0..8084578 100644 --- a/internal/features/vcloud/increase_instances_count.feature +++ b/internal/features/vcloud/increase_instances_count.feature @@ -12,7 +12,7 @@ Feature: Environment apply Then an event "instance.create.vcloud-fake" should be called exactly "1" times And all "instance.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "instance.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" - And all "instance.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "instance.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And all "instance.create.vcloud-fake" messages should contain a field "name" with "web-2" diff --git a/internal/features/vcloud/instance_only.feature b/internal/features/vcloud/instance_only.feature index a4c8d16..cf11fda 100644 --- a/internal/features/vcloud/instance_only.feature +++ b/internal/features/vcloud/instance_only.feature @@ -11,7 +11,7 @@ Feature: Environment apply Then an event "instance.create.vcloud-fake" should be called exactly "1" times And all "instance.create.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "instance.create.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" - And all "instance.create.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "instance.create.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.create.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And all "instance.create.vcloud-fake" messages should contain a field "name" with "web-1" diff --git a/internal/features/vcloud/remove_and_dettach_network.feature b/internal/features/vcloud/remove_and_dettach_network.feature index b9f44dd..bdd34c9 100644 --- a/internal/features/vcloud/remove_and_dettach_network.feature +++ b/internal/features/vcloud/remove_and_dettach_network.feature @@ -12,7 +12,7 @@ Feature: Environment apply Then an event "instance.delete.vcloud-fake" should be called exactly "1" times And all "instance.delete.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "instance.delete.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" - And all "instance.delete.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "instance.delete.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.delete.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.delete.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And all "instance.delete.vcloud-fake" messages should contain a field "name" with "web-1" @@ -27,6 +27,6 @@ Feature: Environment apply And all "network.delete.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "network.delete.vcloud-fake" messages should contain a field "range" with "10.1.0.0/24" And all "network.delete.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" - And all "network.delete.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "network.delete.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "network.delete.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "network.delete.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" diff --git a/internal/features/vcloud/update_firewall_rules.feature b/internal/features/vcloud/update_firewall_rules.feature index 7fbb8cb..998791b 100644 --- a/internal/features/vcloud/update_firewall_rules.feature +++ b/internal/features/vcloud/update_firewall_rules.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "router.update.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "router.update.vcloud-fake" messages should contain a field "name" with "vse2" And all "router.update.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" - And all "router.update.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "router.update.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "router.update.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "router.update.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And message "router.update.vcloud-fake" number "0" should contain "in_in_any" as json field "firewall_rules.0.name" diff --git a/internal/features/vcloud/update_instances_resource.feature b/internal/features/vcloud/update_instances_resource.feature index bb9d1c4..ee388e0 100644 --- a/internal/features/vcloud/update_instances_resource.feature +++ b/internal/features/vcloud/update_instances_resource.feature @@ -12,7 +12,7 @@ Feature: Environment apply Then an event "instance.update.vcloud-fake" should be called exactly "2" times And all "instance.update.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "instance.update.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" - And all "instance.update.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "instance.update.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "instance.update.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "instance.update.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And message "instance.update.vcloud-fake" number "0" should contain "web-1" as json field "name" diff --git a/internal/features/vcloud/update_nat_rules.feature b/internal/features/vcloud/update_nat_rules.feature index 9543f00..a5eb305 100644 --- a/internal/features/vcloud/update_nat_rules.feature +++ b/internal/features/vcloud/update_nat_rules.feature @@ -13,7 +13,7 @@ Feature: Environment apply And all "router.update.vcloud-fake" messages should contain a field "_provider" with "vcloud-fake" And all "router.update.vcloud-fake" messages should contain a field "name" with "vse2" And all "router.update.vcloud-fake" messages should contain a field "datacenter_name" with "fakevcloud" - And all "router.update.vcloud-fake" messages should contain an encrypted field "vcloud_url" with "https://vcloud.net" + And all "router.update.vcloud-fake" messages should contain a field "vcloud_url" with "https://vcloud.net" And all "router.update.vcloud-fake" messages should contain an encrypted field "datacenter_username" with "fakeuser@test" And all "router.update.vcloud-fake" messages should contain an encrypted field "datacenter_password" with "test123" And message "router.update.vcloud-fake" number "0" should contain "dnat" as json field "nat_rules.0.type"