spinnaker-plugins/aws-account-registration-plugin-spinnaker

Test Incremental Activation for Spinnaker Accounts - EC2

jasoncoffman opened this issue · 1 comments

Name of Tester: Jason Coffman (@jasoncoffman)
Date of Test: 25 August 2020
Title of Test: Test Incremental Activation for Spinnaker Accounts - EC2

Spinnaker Version: 1.21.4
Plugin Version: 0.0.1

Status: PASS

Step 1

Create Spinnaker Account for EC2 by creating a response.json file with the below content to be served via the Golang test server

{
  "SpinnakerAccounts": [
    {
      "AccountId": "111122223333",
      "SpinnakerAccountName": "isengard-2",
      "Regions": [
        "us-west-2"
      ],
      "SpinnakerStatus": "ACTIVE",
      "SpinnakerAssumeRole": "role/spinnakerManaged",
      "SpinnakerProviders": [
        "ec2"
      ],
      "SpinnakerId": "spinnaker1",
      "CreatedAt": "1598026448909989587",
      "UpdatedAt": "1598027546352397694"
    }
  ],
  "Pagination": {
    "NextUrl": ""
  }
}

Step 2

Execute curl http://localhost:7002/credentials to verify account creation

Expected:

There will be a single account with type: aws

Output:
[
  {
    "accountId": "111122223333",
    "accountType": "isengard-2",
    "challengeDestructiveActions": false,
    "cloudProvider": "aws",
    "environment": "isengard-2",
    "name": "isengard-2",
    "permissions": {},
    "primaryAccount": false,
    "providerVersion": "v1",
    "requiredGroupMembership": [],
    "type": "aws"
  }
]

Step 3

Edit Spinnaker Account and add an ECS Spinnaker accounts by editing the response.json file with the below content to be served via the Golang test server

{
  "SpinnakerAccounts": [
    {
      "AccountId": "111122223333",
      "SpinnakerAccountName": "isengard-2",
      "Regions": [
        "us-west-2"
      ],
      "SpinnakerStatus": "ACTIVE",
      "SpinnakerAssumeRole": "role/spinnakerManaged",
      "SpinnakerProviders": [
        "ec2", "ecs"
      ],
      "SpinnakerId": "spinnaker1",
      "CreatedAt": "1598026448909989587",
      "UpdatedAt": "1598027546352397694"
    }
  ],
  "Pagination": {
    "NextUrl": ""
  }
}

Step 4

Execute curl http://localhost:7002/credentials to verify account creation

Expected

Two accounts are created - one with type: aws and another with type: ecs

Output
[
  {
    "accountId": "111122223333",
    "accountType": "ecs",
    "challengeDestructiveActions": false,
    "cloudProvider": "ecs",
    "environment": "isengard-2",
    "name": "isengard-2-ecs",
    "permissions": {},
    "primaryAccount": false,
    "providerVersion": "v1",
    "requiredGroupMembership": [],
    "type": "ecs"
  },
  {
    "accountId": "111122223333",
    "accountType": "isengard-2",
    "challengeDestructiveActions": false,
    "cloudProvider": "aws",
    "environment": "isengard-2",
    "name": "isengard-2",
    "permissions": {},
    "primaryAccount": false,
    "providerVersion": "v1",
    "requiredGroupMembership": [],
    "type": "aws"
  }
]

Name of Tester: Jason Coffman (@jasoncoffman)
Date of Test: 26 August 2020
Title of Test: Test Incremental Activation for Spinnaker Accounts - EC2

Spinnaker Version: 1.21.4
Plugin Version: 0.0.1

Status: PASS

Step 1

Create Spinnaker Account for EC2 by creating a response.json file with the below content to be served via the Golang test server

{
  "SpinnakerAccounts": [
    {
      "AccountId": "111122223333",
      "SpinnakerAccountName": "isengard-2",
      "Regions": [
        "us-west-2"
      ],
      "SpinnakerStatus": "ACTIVE",
      "SpinnakerAssumeRole": "role/spinnakerManaged",
      "SpinnakerProviders": [
        "ec2"
      ],
      "SpinnakerId": "spinnaker1",
      "CreatedAt": "1598026448909989587",
      "UpdatedAt": "1598027546352397694"
    }
  ],
  "Pagination": {
    "NextUrl": ""
  }
}

Step 2

Execute curl http://localhost:7002/credentials to verify account creation

Expected:

There will be a single account with type: aws

Output:
[
  {
    "accountId": "111122223333",
    "accountType": "isengard-2",
    "challengeDestructiveActions": false,
    "cloudProvider": "aws",
    "environment": "isengard-2",
    "name": "isengard-2",
    "permissions": {},
    "primaryAccount": false,
    "providerVersion": "v1",
    "requiredGroupMembership": [],
    "type": "aws"
  }
]

Step 3

Edit Spinnaker Account and add an ECS Spinnaker accounts by editing the response.json file with the below content to be served via the Golang test server

{
  "SpinnakerAccounts": [
    {
      "AccountId": "111122223333",
      "SpinnakerAccountName": "isengard-2",
      "Regions": [
        "us-west-2"
      ],
      "SpinnakerStatus": "ACTIVE",
      "SpinnakerAssumeRole": "role/spinnakerManaged",
      "SpinnakerProviders": [
        "ec2", "ecs"
      ],
      "SpinnakerId": "spinnaker1",
      "CreatedAt": "1598026448909989587",
      "UpdatedAt": "1598027546352397694"
    }
  ],
  "Pagination": {
    "NextUrl": ""
  }
}

Step 4

Execute curl http://localhost:7002/credentials to verify account creation

Expected

Two accounts are created - one with type: aws and another with type: ecs

Output
[
  {
    "accountId": "111122223333",
    "accountType": "ecs",
    "challengeDestructiveActions": false,
    "cloudProvider": "ecs",
    "environment": "isengard-2",
    "name": "isengard-2-ecs",
    "permissions": {},
    "primaryAccount": false,
    "providerVersion": "v1",
    "requiredGroupMembership": [],
    "type": "ecs"
  },
  {
    "accountId": "111122223333",
    "accountType": "isengard-2",
    "challengeDestructiveActions": false,
    "cloudProvider": "aws",
    "environment": "isengard-2",
    "name": "isengard-2",
    "permissions": {},
    "primaryAccount": false,
    "providerVersion": "v1",
    "requiredGroupMembership": [],
    "type": "aws"
  }
]