terraform-aws-vmseries-modules icon indicating copy to clipboard operation
terraform-aws-vmseries-modules copied to clipboard

Terratest coverage for modules

Open migara opened this issue 3 years ago • 2 comments

Summary

We will create Terratest test code to cover the below modules

VM-Series

  • [x] Initial Deployment
  • [x] Add/remove routes after deployment
  • [ ] Add/remove security group rules
  • [ ] Add/remove interfaces to the firewall
  • [ ] Add/remove public IP from an interface
  • [ ] Change userdata parameters
  • [ ] Add/remove tags
  • [ ] S3 bootstrapping

Autoscaling

  • [ ] Initial deployment
  • [ ] Scale out/in by changing desired/max instances for auto-scaling group
  • [ ] Change userdata parameters
  • [ ] Add/remove tags
  • [ ] Add/remove interfaces
  • [ ] Add/remove public IPs
  • [ ] TBD - End-to-end autoscaling testing based on vmseries published metrics

Panorama

  • [x] Initial Deployment
  • [ ] Add/remove interface to Panorama
  • [ ] Add/remove public IP from the primary interface
  • [ ] Add/remove logging disk
  • [ ] Add new tags

ALB

  • [x] Initial Deployment
  • [ ] Add/remove listener rules
  • [ ] Add/remove members in the target group
  • [ ] Add/remove tags

NLB

  • [x] Initial Deployment
  • [ ] Add/remove listener rules
  • [ ] Add/remove members in the target group
  • [ ] Add/remove tags

VPC

  • [x] Initial Deployment
  • [ ] Brownfield use case with create_vpc set to false
  • [ ] Add/remove VPC endpoints

TGW

  • [x] Initial Deployment
  • [ ] Brownfield use case for using an existing TGW with create set to false
  • [ ] Add/remove TGW route tables
  • [ ] Brownfield use case for using an existing TGW rtb with create set to false

GWLB

  • [x] Initial Deployment
  • [ ] Add/remove GWLB endpoints
  • [ ] Brownfield use case for using an existing GWLB

migara avatar Nov 11 '21 23:11 migara

Tasks:

  • [x] Prepare template of test skeleton
  • [x] Prepare tests for modules
    • [x] alb
    • [x] asg
    • [x] bootstrap
    • [ ] crosszone_failover
    • [ ] gwlb
    • [ ] gwlb_endpoint_set
    • [ ] nat_gateway_set
    • [ ] nlb
    • [x] panorama
    • [x] subnet_set
    • [x] transit_gateway
    • [x] transit_gateway_attachment
    • [x] transit_gateway_peering
    • [ ] vmseries
    • [x] vpc
    • [ ] vpc_endpoint
    • [x] vpc_route

sebastianczech avatar Jan 09 '23 08:01 sebastianczech

Proposition of next steps regarding testing VM-Series modules for AWS:

  • [ ] close all open issues with label tests and stale (besides this issue - #86)
  • [x] after merging PR 2 with samples for Terratest test skeleton:
    • [x] in all Go files in folders examples and tests change import in order to use test skeleton for Terratest - replace github.com/PaloAltoNetworks/terraform-aws-vmseries-modules/go/testskeleton by github.com/PaloAltoNetworks/terraform-modules-vmseries-tests-skeleton/pkg/testskeleton
    • [x] remove Go files with folders from go/testskeleton and go/helpers
  • [ ] in folder tests, which contains integrations tests for modules:
    • [ ] add integration tests for modules, which are working only with terraform plan (this kind of tests are going to be executed for PR CI) - now we don't have such tests for modules at all (only for examples we have it)
    • [ ] simplify existing integration tests for modules, which are deploying every module (this kind of tests are going to be executed for Release CI) - now sometimes for 1 module we have multiple tests e.g. for vmseries module we have tests: TestOutputForModuleVmseriesWithFullVariables, TestOutputForModuleVmseriesWithMinimumVariables, TestOutputForModuleVmseriesWithS3BootstrappingAndFullVariables. In order to shorten time of testing and limits cloud costs, maybe we should have only 2 kind of tests: TestModuleNNNPlan, TestModuleNNNDeployment.
    • [ ] add tests for modules, for which currently we don't have any tests in folder tests e.g. for module nlb
  • [ ] extend GitHub workflows to execute modules tests from folder tests for PR CI (only plan) and for Release CI (with apply) - now we are not executing any Terratest from folder tests, only from folder examples, which for PR CI are only checking the plan, for Release CI are deploying all examples.

After fulfilling all above steps we can start to think how to prepare E2E tests, in which we can configure VM-Series, deploy spokes VPCs and VMs and finally test traffic flows - inbound, outbound or east-west.

sebastianczech avatar Jul 17 '23 07:07 sebastianczech