diff --git a/.kitchen.yml b/.kitchen.yml deleted file mode 100644 index 4ce67f0..0000000 --- a/.kitchen.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- - provisioner: - name: terraform - - verifier: - name: terraform - systems: - - name: inspec-gcp - backend: gcp - - platforms: - - name: terraform - - suites: - - name: simple-cluster - driver: - name: terraform - root_module_directory: examples/simple-cluster - command_timeout: 12000 - parallelism: 1 - - name: brown-modules-cluster - driver: - name: terraform - root_module_directory: examples/brown-modules-cluster - command_timeout: 12000 - parallelism: 1 - \ No newline at end of file diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index be94e6f..0000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.2.2 diff --git a/.terraform-version b/.terraform-version deleted file mode 100644 index 3e1ad72..0000000 --- a/.terraform-version +++ /dev/null @@ -1 +0,0 @@ -1.5.0 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index dbb2090..0000000 --- a/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM hashicorp/terraform:1.5.0 - -COPY .ruby-version .ruby-version - -# Update and install all of the required packages. -# At the end, remove the apk cache -RUN apk upgrade && \ - apk add --update \ - bash \ - curl-dev \ - curl \ - "ruby-dev=~$(cat .ruby-version)" \ - "ruby-full=~$(cat .ruby-version)" \ - build-base \ - python3 && \ - rm -rf /var/cache/apk/* - -RUN mkdir /usr/app -WORKDIR /usr/app - -COPY Gemfile* ./ -RUN gem install bundler && \ - bundle config set system 'true' && \ - bundle install - - -ENTRYPOINT ["/bin/bash"] - diff --git a/Gemfile b/Gemfile deleted file mode 100644 index b0cd946..0000000 --- a/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org/" do - gem "kitchen-terraform", "~> 7.0.0" - end \ No newline at end of file diff --git a/chefignore b/chefignore deleted file mode 100644 index 77924ab..0000000 --- a/chefignore +++ /dev/null @@ -1,2 +0,0 @@ -.kitchen -kitchen*.yml \ No newline at end of file diff --git a/test/integration/brown-modules-cluster/controls/brown-modules-cluster.rb b/test/integration/brown-modules-cluster/controls/brown-modules-cluster.rb deleted file mode 100644 index d3d6f4e..0000000 --- a/test/integration/brown-modules-cluster/controls/brown-modules-cluster.rb +++ /dev/null @@ -1,63 +0,0 @@ -# copyright: 2018, The Authors - -title "Cluster Section" - -project_id = attribute('project_id') -project_name= attribute('project_name') -location = attribute('location') -service_account = attribute('service_account') -cluster_name = attribute('cluster_name') -network_name = attribute('network_name') -subnet_name = attribute('subnet_name') - -# Project Tests -describe google_project(project: project_id) do - it { should exist } - its('project_id') { should eq project_id } -end - -describe google_project(project: project_id) do - its('lifecycle_state') { should eq "ACTIVE" } -end - -describe google_project(project: project_id) do - its('name') { should eq project_name } -end - -# K8s Cluster Test -describe google_container_cluster(project: project_id, location: location, name: cluster_name) do - # It's up and running - it { should exist } - its('status') { should eq 'RUNNING' } - its('locations.sort'){ should cmp ["us-east1-b"] } - - - # Has correct network and subnet names - its('network'){should eq network_name} - its('subnetwork'){should eq subnet_name} - - # Has correct node pool configuration - its('node_config.disk_size_gb'){should eq 100} - its('node_config.image_type'){should be_in ["COS", "COS_CONTAINERD"]} - its('node_config.machine_type'){should be_in ["n1-standard-1", "e2-medium"]} - its('node_pools.count'){should eq 3} - its('node_config.oauth_scopes'){should eq ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/cloud-platform"]} - its('node_config.service_account'){should eq service_account} -end - -# Node Pool Tests -describe google_container_node_pools(project: project_id, location: location, cluster_name: cluster_name) do - its('node_pool_names') { should include "default-pool" } - its('node_pool_names') { should include "user-pool" } - its('node_pool_names') { should include "core-pool" } - -end - -google_container_node_pools(project: project_id, location: location, cluster_name: cluster_name).where(node_pool_name: /-pool$/).node_pool_names.each do |node_pool_name| - describe google_container_node_pool(project: project_id, location: location, cluster_name: cluster_name, nodepool_name: node_pool_name) do - it { should exist } - its('status') { should eq 'RUNNING' } - end -end - - diff --git a/test/integration/brown-modules-cluster/inspec.yml b/test/integration/brown-modules-cluster/inspec.yml deleted file mode 100644 index 800e0cf..0000000 --- a/test/integration/brown-modules-cluster/inspec.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: brown-modules-cluster -depends: -- name: inspec-gcp - git: https://github.com/inspec/inspec-gcp.git - tag: v1.11.1 -supports: -- platform: gcp diff --git a/test/integration/simple-cluster/controls/simple-cluster.rb b/test/integration/simple-cluster/controls/simple-cluster.rb deleted file mode 100644 index f9a871f..0000000 --- a/test/integration/simple-cluster/controls/simple-cluster.rb +++ /dev/null @@ -1,62 +0,0 @@ -# copyright: 2018, The Authors - -title "Cluster Section" - -project_id = attribute('project_id') -project_name= attribute('project_name') -location = attribute('location') -service_account = attribute('service_account') -network_name = attribute('network_prefix') + '-' + attribute('random_string') -cluster_name = attribute('cluster_name') - - -# Project Tests -describe google_project(project: project_id) do - it { should exist } - its('project_id') { should eq project_id } -end - -describe google_project(project: project_id) do - its('lifecycle_state') { should eq "ACTIVE" } -end - -describe google_project(project: project_id) do - its('name') { should eq project_name } -end - -# K8s Cluster Test -describe google_container_cluster(project: project_id, location: location, name: cluster_name) do - # It's up and running - it { should exist } - its('status') { should eq 'RUNNING' } - its('locations.sort'){ should cmp ["us-east1-b"] } - - # Has correct network and subnet names - its('network'){should eq network_name} - its('subnetwork'){should eq network_name} - - # Has correct node pool configuration - its('node_config.disk_size_gb'){should eq 100} - its('node_config.image_type'){should be_in ["COS", "COS_CONTAINERD"]} - its('node_config.machine_type'){should be_in ["n1-standard-1", "e2-medium"]} - its('node_pools.count'){should eq 3} - its('node_config.oauth_scopes'){should eq ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/cloud-platform"]} - its('node_config.service_account'){should eq service_account} -end - -# Node Pool Tests -describe google_container_node_pools(project: project_id, location: location, cluster_name: cluster_name) do - its('node_pool_names') { should include "default-pool" } - its('node_pool_names') { should include "user-pool" } - its('node_pool_names') { should include "core-pool" } - -end - -google_container_node_pools(project: project_id, location: location, cluster_name: cluster_name).where(node_pool_name: /-pool$/).node_pool_names.each do |node_pool_name| - describe google_container_node_pool(project: project_id, location: location, cluster_name: cluster_name, nodepool_name: node_pool_name) do - it { should exist } - its('status') { should eq 'RUNNING' } - end -end - - diff --git a/test/integration/simple-cluster/inspec.yml b/test/integration/simple-cluster/inspec.yml deleted file mode 100644 index e6b753d..0000000 --- a/test/integration/simple-cluster/inspec.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: simple-cluster -depends: -- name: inspec-gcp - git: https://github.com/inspec/inspec-gcp.git - tag: v1.11.1 -supports: -- platform: gcp