diff --git a/tests/rspec/lib/aws_cluster.rb b/tests/rspec/lib/aws_cluster.rb index 7cdcc1a3fd..e1bce0bc16 100644 --- a/tests/rspec/lib/aws_cluster.rb +++ b/tests/rspec/lib/aws_cluster.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require 'cluster' require 'aws_region' require 'json' require 'jenkins' @@ -11,9 +10,20 @@ require 'tfstate_file' require 'fileutils' require 'with_retries' +require 'cluster_support' +require 'kubectl_helpers' +require 'name_generator' +require 'password_generator' +require 'securerandom' +require 'ssh' +require 'tfvars_file' +require 'config_file' +require 'timeout' +require 'with_retries' +require 'open3' # AWSCluster represents a k8s cluster on AWS cloud provider -class AwsCluster < Cluster +class AwsCluster TIMEOUT_IN_SECONDS = (30 * 60).freeze # 30 minutes attr_reader :config_file, :kubeconfig, :manifest_path, :build_path, @@ -52,8 +62,79 @@ def initialize(config_file) @tfstate['topology'] = TFStateFile.new(@build_path, 'topology.tfstate') end + def start + apply + wait_til_ready + end + + def init + env = env_variables + env['TF_INIT_OPTIONS'] = '-no-color' + + run_tectonic_cli(env, 'init', '--config=config.yaml') + # The config within the build folder is the source of truth after init + @config_file = ConfigFile.new(File.expand_path("#{@name}/config.yaml")) + end + + def update_cluster + start + end + + def stop + if ENV['TF_VAR_tectonic_aws_ssh_key'].include?('rspec-') + AwsSupport.delete_aws_key_pairs(ENV['TF_VAR_tectonic_aws_ssh_key'], @aws_region, @role_credentials) + end + + if ENV.key?('TECTONIC_TESTS_DONT_CLEAN_UP') + puts "*** Cleanup inhibiting flag set. Stopping here. ***\n" + puts '*** Your email/password to use in the tectonic console is:'\ + "#{@tectonic_admin_email} / #{@tectonic_admin_password} ***\n" + return + end + destroy + end + + def check_prerequisites + raise 'AWS credentials not defined' unless credentials_defined? + raise 'TF_VAR_tectonic_aws_ssh_key is not defined' unless ssh_key_defined? + raise 'TF_VAR_tectonic_aws_region is not defined' unless region_defined? + + return if license_and_pull_secret_defined? + raise 'Tectonic license and pull secret are not defined as environment'\ + 'variables.' + end + + def region_defined? + EnvVar.set?(%w[TF_VAR_tectonic_aws_region]) + end + + def credentials_defined? + credential_names = %w[AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY] + profile_name = %w[AWS_PROFILE] + session_token = %w[ + AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY + AWS_SESSION_TOKEN + ] + EnvVar.set?(credential_names) || + EnvVar.set?(profile_name) || + EnvVar.set?(session_token) + end + + def ssh_key_defined? + EnvVar.set?(%w[TF_VAR_tectonic_aws_ssh_key]) + end + + def recover_from_failed_destroy + Grafiti.new(@build_path, ENV['TF_VAR_tectonic_aws_region']).clean + end + def env_variables - variables = super + variables = {} + variables['CLUSTER'] = @name + variables['TF_VAR_tectonic_cluster_name'] = @name + variables['TF_VAR_tectonic_admin_email'] = @tectonic_admin_email + variables['TF_VAR_tectonic_admin_password'] = @tectonic_admin_password variables['PLATFORM'] = 'aws' variables['TF_VAR_tectonic_cluster_name'] = @config_file.cluster_name variables['CLUSTER'] = @config_file.cluster_name @@ -67,12 +148,67 @@ def env_variables variables end - def stop - if ENV['TF_VAR_tectonic_aws_ssh_key'].include?('rspec-') - AwsSupport.delete_aws_key_pairs(ENV['TF_VAR_tectonic_aws_ssh_key'], @aws_region, @role_credentials) + def secret_files(namespace, secret) + cmd = "get secret -n #{namespace} #{secret} -o go-template "\ + "\'--template={{range $key, $value := .data}}{{$key}}\n{{end}}\'" + KubeCTL.run(@kubeconfig, cmd).split("\n") + end + + def api_ip_addresses + nodes = KubeCTL.run( + @kubeconfig, + 'get node -l=node-role.kubernetes.io/master '\ + '-o jsonpath=\'{range .items[*]}'\ + '{@.metadata.name}{"\t"}{@.status.addresses[?(@.type=="ExternalIP")].address}'\ + '{"\n"}{end}\'' + ) + + nodes = nodes.split("\n").map { |node| node.split("\t") }.to_h + + api_pods = KubeCTL.run( + @kubeconfig, + 'get pod -n kube-system -l k8s-app=kube-apiserver '\ + '-o \'jsonpath={range .items[*]}'\ + '{@.metadata.name}{"\t"}{@.spec.nodeName}'\ + '{"\n"}{end}\'' + ) + + api_pods + .split("\n") + .map { |pod| pod.split("\t") } + .map { |pod| [pod[0], nodes[pod[1]]] }.to_h + end + + def forensic(events = true) + outputs_console_logs = machine_boot_console_logs + outputs_console_logs.each do |ip, log| + puts "saving boot logs from master-#{ip}" + save_to_file(@name, 'console_machine', ip, 'console_machine', log) + end + + save_kubernetes_events(@kubeconfig, @name) if events + + master_ip_addresses.each do |master_ip| + save_docker_logs(master_ip, @name) + + ['bootkube', 'tectonic', 'kubelet', 'k8s-node-bootstrap'].each do |service| + print_service_logs(master_ip, service, @name) + end end - super + worker_ip_addresses.each do |worker_ip| + save_docker_logs(worker_ip, @name, master_ip_address) + + ['kubelet'].each do |service| + print_service_logs(worker_ip, service, @name, master_ip_address) + end + end + + etcd_ip_addresses.each do |etcd_ip| + ['etcd-member'].each do |service| + print_service_logs(etcd_ip, service, @name, master_ip_address) + end + end end def machine_boot_console_logs @@ -115,63 +251,13 @@ def etcd_ip_addresses @tfstate['etcd'].output('etcd', 'ip_addresses') end - def check_prerequisites - raise 'AWS credentials not defined' unless credentials_defined? - raise 'TF_VAR_tectonic_aws_ssh_key is not defined' unless ssh_key_defined? - raise 'TF_VAR_tectonic_aws_region is not defined' unless region_defined? - - super - end - - def region_defined? - EnvVar.set?(%w[TF_VAR_tectonic_aws_region]) - end - - def credentials_defined? - credential_names = %w[AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY] - profile_name = %w[AWS_PROFILE] - session_token = %w[ - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY - AWS_SESSION_TOKEN - ] - EnvVar.set?(credential_names) || - EnvVar.set?(profile_name) || - EnvVar.set?(session_token) - end - - def ssh_key_defined? - EnvVar.set?(%w[TF_VAR_tectonic_aws_ssh_key]) - end - - def recover_from_failed_destroy - Grafiti.new(@build_path, ENV['TF_VAR_tectonic_aws_region']).clean - super - end - - def tectonic_console_url - Dir.chdir(@build_path) do - ingress_ext = @tfstate['topology'].output('dns', 'ingress_external_fqdn') - ingress_int = @tfstate['topology'].output('dns', 'ingress_internal_fqdn') - if ingress_ext.empty? - if ingress_int.empty? - raise 'failed to get the console url to use in the UI tests.' - end - return ingress_int - end - ingress_ext - end - end - - # TODO: Remove once other platforms caught up + private - def init - env = env_variables - env['TF_INIT_OPTIONS'] = '-no-color' + def license_and_pull_secret_defined? + license_path = 'TF_VAR_tectonic_license_path' + pull_secret_path = 'TF_VAR_tectonic_pull_secret_path' - run_tectonic_cli(env, 'init', '--config=config.yaml') - # The config within the build folder is the source of truth after init - @config_file = ConfigFile.new(File.expand_path("#{@name}/config.yaml")) + EnvVar.set?([license_path, pull_secret_path]) end def apply @@ -276,18 +362,6 @@ def tf_value(v) end end - private - - # def destroy - # # For debugging purposes (see: https://github.com/terraform-providers/terraform-provider-aws/pull/1051) - # describe_network_interfaces - - # super - - # # For debugging purposes (see: https://github.com/terraform-providers/terraform-provider-aws/pull/1051) - # describe_network_interfaces - # end - def describe_network_interfaces puts 'describing network interfaces for debugging purposes' vpc_id = @tfstate['topology'].value('module.vpc.aws_vpc.cluster_vpc', 'id') @@ -310,4 +384,88 @@ def save_terraform_logs(tectonic_logs, output) save_to_file << output save_to_file.close end + + def wait_til_ready + sleep_wait_for_reboot + wait_for_bootstrapping + + from = Time.now + loop do + begin + KubeCTL.run(@kubeconfig, 'cluster-info') + break + rescue KubeCTL::KubeCTLCmdError + elapsed = Time.now - from + raise 'kubectl cluster-info never returned with successful error code' if elapsed > 1200 # 20 mins timeout + sleep 10 + end + end + + wait_nodes_ready + end + + def wait_for_bootstrapping + ips = master_ip_addresses + raise 'Empty master ips. Aborting...' if ips.empty? + wait_for_service('bootkube', ips) + wait_for_service('tectonic', ips) + puts 'HOORAY! The cluster is up' + end + + # Adding this sleep to wait for some time before we start ssh into the server + # if we ssh during the reboot from torcx this might put the shutdown in a weird state + # and that's might be the reason why we saw several connection timeouts in tests while spinning up a cluster + def sleep_wait_for_reboot + from = Time.now + loop do + elapsed = Time.now - from + puts "Sleeping for 5 minutes. Remaining #{300 - elapsed} seconds. Giving some time to the server reboot." + sleep 30 + break if elapsed > 300 # 5 mins timeout + end + puts 'Done. Lets check the cluster now...' + end + + def wait_for_service(service, ips) + from = Time.now + + ::Timeout.timeout(30 * 60) do # 30 minutes + loop do + return if service_finished_bootstrapping?(ips, service) + + elapsed = Time.now - from + if (elapsed.round % 5).zero? + puts "Waiting for bootstrapping of #{service} service to complete..." + puts "Checked master nodes: #{ips}" + end + sleep 10 + end + end + rescue Timeout::Error + puts 'Trying to collecting the logs...' + forensic(false) # Call forensic to collect logs when service timeout + raise "timeout waiting for #{service} service to bootstrap on any of: #{ips}" + end + + def service_finished_bootstrapping?(ips, service) + command = "systemctl is-active #{service} --quiet && [ $(systemctl show -p SubState --value #{service}) == \"exited\" ]" + ips.each do |ip| + finished = 1 + begin + _, _, finished = ssh_exec(ip, command) + rescue => e + puts "failed to ssh exec on ip #{ip} with: #{e}" + end + + if finished.zero? + puts "#{service} service finished successfully on ip #{ip}" + return true + end + end + false + end + + def describe_nodes + KubeCTL.run_and_parse(@kubeconfig, 'get nodes') + end end diff --git a/tests/rspec/lib/aws_vpc.rb b/tests/rspec/lib/aws_vpc.rb deleted file mode 100644 index 9841afe9ef..0000000000 --- a/tests/rspec/lib/aws_vpc.rb +++ /dev/null @@ -1,168 +0,0 @@ -# frozen_string_literal: true - -require 'json' - -# AWSVPC represents an AWS virtual private cloud -class AWSVPC - attr_reader :vpn_url - attr_reader :ovpn_password - attr_reader :name - attr_reader :vpc_dns - attr_reader :vpc_id - attr_reader :private_zone_id - attr_reader :master_subnet_ids - attr_reader :worker_subnet_ids - attr_reader :vpn_connection - - def initialize(name) - @name = name - @ovpn_password = - `tr -cd '[:alnum:]' < /dev/urandom | head -c 32 ; echo`.chomp - end - - def env_variables - { - 'TF_VAR_vpc_aws_region' => ENV['TF_VAR_tectonic_aws_region'], - 'TF_VAR_vpc_name' => @name, - 'TF_VAR_ovpn_password' => @ovpn_password, - 'TF_VAR_base_domain' => 'tectonic-ci.de', - 'TF_VAR_aws_role' => ENV['TF_VAR_tectonic_aws_installer_role'] - } - end - - def export_tfvars - vars = { - 'TF_VAR_tectonic_aws_external_private_zone' => @private_zone_id, - 'TF_VAR_tectonic_aws_external_vpc_id' => @vpc_id, - 'TF_VAR_tectonic_aws_external_master_subnet_ids' => @master_subnet_ids, - 'TF_VAR_tectonic_aws_external_worker_subnet_ids' => @worker_subnet_ids - } - vars.each do |key, value| - ENV[key] = value - end - end - - def create - Dir.chdir(File.join(ENV['RSPEC_PATH'], '../../contrib/internal-cluster')) do - succeeded = system(env_variables, 'terraform init') - raise 'could not init Terraform to create VPC' unless succeeded - succeeded = system(env_variables, 'terraform apply -auto-approve') - raise 'could not create vpc with Terraform' unless succeeded - - parse_terraform_output - wait_for_vpn_access_server - - @vpn_connection = VPNConnection.new(@ovpn_password, @vpn_url) - @vpn_connection.start - end - - set_nameserver - export_tfvars - end - - def parse_terraform_output - tf_out = JSON.parse(`terraform output -json`) - @vpn_url = tf_out['ovpn_url']['value'] - @vpc_dns = tf_out['vpc_dns']['value'] - @vpc_id = tf_out['vpc_id']['value'] - @private_zone_id = tf_out['private_zone_id']['value'] - parse_subnets(tf_out) - end - - def parse_subnets(tf_out) - subnets = tf_out['subnets']['value'] - @master_subnet_ids = - "[\"#{subnets[0]}\", \"#{subnets[1]}\"]" - @worker_subnet_ids = - "[\"#{subnets[2]}\", \"#{subnets[3]}\"]" - end - - def destroy - @vpn_connection.stop - rescue - raise 'could not disconnect from vpn' - ensure - terraform_destroy - recover_etc_resolv - end - - def terraform_destroy - Dir.chdir(File.join(ENV['RSPEC_PATH'], '../../contrib/internal-cluster')) do - 3.times do - return if system(env_variables, 'terraform destroy -force') - end - end - - raise 'could not destroy vpc with Terraform' - end - - def wait_for_vpn_access_server - 90.times do - succeeded = system("curl -k -L --silent #{@vpn_url} > /dev/null") - return if succeeded - sleep(0.5) - end - raise 'waiting for vpn access server timed out' - end - - def set_nameserver - # Use AWS VPC DNS rather than host's. - FileUtils.cp '/etc/resolv.conf', '/etc/resolv.conf.bak' - IO.write('/etc/resolv.conf', "nameserver #{@vpc_dns}\nnameserver 8.8.8.8\n") - system('cat /etc/resolv.conf') - end - - def recover_etc_resolv - FileUtils.cp '/etc/resolv.conf.bak', '/etc/resolv.conf' - end -end - -# VPNConnection represents a VPN connection via the VPN server in an AWS VPC -class VPNConnection - attr_reader :vpn_url - attr_reader :ovpn_password - attr_reader :vpn_conf - - def initialize(ovpn_password, vpn_url) - @ovpn_password = ovpn_password - @vpn_url = vpn_url - end - - def curl_vpn_config - cmd = 'curl -k -L ' \ - "-u 'openvpn:#{@ovpn_password}' " \ - '--silent ' \ - '--fail ' \ - "#{@vpn_url}/rest/GetUserlogin" - @vpn_conf = `#{cmd}`.chomp - end - - def start - curl_vpn_config - - IO.write('vpn_credentials', "openvpn\n#{@ovpn_password}\n") - @vpn_conf = @vpn_conf.sub( - 'auth-user-pass', - 'auth-user-pass vpn_credentials' - ) - IO.write('vpn.conf', @vpn_conf) - - succeeded = system('openvpn --config vpn.conf --daemon') - raise 'could not start vpn' unless succeeded - - wait_for_network - end - - def stop - system('pkill openvpn || true') - wait_for_network - end - - def wait_for_network - 90.times do - succeeded = system('ping -c 1 8.8.8.8 > /dev/null') - return if succeeded - end - raise 'waiting for network timed out' - end -end diff --git a/tests/rspec/lib/cluster.rb b/tests/rspec/lib/cluster.rb deleted file mode 100644 index d0ec412193..0000000000 --- a/tests/rspec/lib/cluster.rb +++ /dev/null @@ -1,341 +0,0 @@ -# frozen_string_literal: true - -require 'cluster_support' -require 'fileutils' -require 'jenkins' -require 'kubectl_helpers' -require 'name_generator' -require 'password_generator' -require 'securerandom' -require 'ssh' -require 'tfstate_file' -require 'tfvars_file' -require 'config_file' -require 'timeout' -require 'with_retries' -require 'open3' - -# Cluster represents a k8s cluster -class Cluster - attr_reader :config_file, :tfvars_file, :kubeconfig, :manifest_path, :build_path, - :tectonic_admin_email, :tectonic_admin_password, :tfstate - - def initialize(tfvars_file) - @tfvars_file = tfvars_file - - # Enable local testers to specify a static cluster name - # S3 buckets can only handle lower case names - @name = ENV['CLUSTER'] || NameGenerator.generate(@tfvars_file.prefix) - @tectonic_admin_email = ENV['TF_VAR_tectonic_admin_email'] || NameGenerator.generate_fake_email - @tectonic_admin_password = ENV['TF_VAR_tectonic_admin_password'] || PasswordGenerator.generate_password - save_console_creds(@name, @tectonic_admin_email, @tectonic_admin_password) - - @build_path = File.join(File.dirname(ENV['RELEASE_TARBALL_PATH']), "tectonic-dev/#{@name}") - @manifest_path = File.join(@build_path, 'generated') - @kubeconfig = File.join(manifest_path, 'auth/kubeconfig') - - @tfstate = {} - @tfstate['masters'] = TFStateFile.new(@build_path, 'masters.tfstate') - @tfstate['workers'] = TFStateFile.new(@build_path, 'joining_workers.tfstate') - @tfstate['etcd'] = TFStateFile.new(@build_path, 'etcd.tfstate') - @tfstate['topology'] = TFStateFile.new(@build_path, 'topology.tfstate') - - check_prerequisites - end - - def start - apply - wait_til_ready - end - - def update_cluster - start - end - - def init - terraform_init - end - - def stop - if ENV.key?('TECTONIC_TESTS_DONT_CLEAN_UP') - puts "*** Cleanup inhibiting flag set. Stopping here. ***\n" - puts '*** Your email/password to use in the tectonic console is:'\ - "#{@tectonic_admin_email} / #{@tectonic_admin_password} ***\n" - return - end - destroy - end - - def check_prerequisites - return if license_and_pull_secret_defined? - raise 'Tectonic license and pull secret are not defined as environment'\ - 'variables.' - end - - def env_variables - { - 'CLUSTER' => @name, - 'TF_VAR_tectonic_cluster_name' => @name, - 'TF_VAR_tectonic_admin_email' => @tectonic_admin_email, - 'TF_VAR_tectonic_admin_password' => @tectonic_admin_password - } - end - - def tf_var(v) - tf_value "var.#{v}" - end - - def tf_value(v) - Dir.chdir(@build_path) do - `echo '#{v}' | terraform console ../../platforms/#{env_variables['PLATFORM']}`.chomp - end - end - - def secret_files(namespace, secret) - cmd = "get secret -n #{namespace} #{secret} -o go-template "\ - "\'--template={{range $key, $value := .data}}{{$key}}\n{{end}}\'" - KubeCTL.run(@kubeconfig, cmd).split("\n") - end - - def api_ip_addresses - nodes = KubeCTL.run( - @kubeconfig, - 'get node -l=node-role.kubernetes.io/master '\ - '-o jsonpath=\'{range .items[*]}'\ - '{@.metadata.name}{"\t"}{@.status.addresses[?(@.type=="ExternalIP")].address}'\ - '{"\n"}{end}\'' - ) - - nodes = nodes.split("\n").map { |node| node.split("\t") }.to_h - - api_pods = KubeCTL.run( - @kubeconfig, - 'get pod -n kube-system -l k8s-app=kube-apiserver '\ - '-o \'jsonpath={range .items[*]}'\ - '{@.metadata.name}{"\t"}{@.spec.nodeName}'\ - '{"\n"}{end}\'' - ) - - api_pods - .split("\n") - .map { |pod| pod.split("\t") } - .map { |pod| [pod[0], nodes[pod[1]]] }.to_h - end - - def forensic(events = true) - outputs_console_logs = machine_boot_console_logs - outputs_console_logs.each do |ip, log| - puts "saving boot logs from master-#{ip}" - save_to_file(@name, 'console_machine', ip, 'console_machine', log) - end - - save_kubernetes_events(@kubeconfig, @name) if events - - master_ip_addresses.each do |master_ip| - save_docker_logs(master_ip, @name) - - ['bootkube', 'tectonic', 'kubelet', 'k8s-node-bootstrap'].each do |service| - print_service_logs(master_ip, service, @name) - end - end - - worker_ip_addresses.each do |worker_ip| - save_docker_logs(worker_ip, @name, master_ip_address) - - ['kubelet'].each do |service| - print_service_logs(worker_ip, service, @name, master_ip_address) - end - end - - etcd_ip_addresses.each do |etcd_ip| - ['etcd-member'].each do |service| - print_service_logs(etcd_ip, service, @name, master_ip_address) - end - end - end - - def machine_boot_console_logs - { '0.0.0.0' => "not implemented yet for platform #{env_variables['PLATFORM']}" } - end - - private - - def license_and_pull_secret_defined? - license_path = 'TF_VAR_tectonic_license_path' - pull_secret_path = 'TF_VAR_tectonic_pull_secret_path' - - EnvVar.set?([license_path, pull_secret_path]) - end - - def apply - ::Timeout.timeout(30 * 60) do # 30 minutes - Retriable.with_retries(limit: 3) do - env = env_variables - env['TF_APPLY_OPTIONS'] = '-no-color' - env['TF_INIT_OPTIONS'] = '-no-color' - - run_command(env, 'apply', '-auto-approve') - end - end - rescue Timeout::Error - forensic(false) - raise 'Applying cluster failed' - end - - def destroy - ::Timeout.timeout(30 * 60) do # 30 minutes - Retriable.with_retries(limit: 3) do - env = env_variables - env['TF_DESTROY_OPTIONS'] = '-no-color' - env['TF_INIT_OPTIONS'] = '-no-color' - run_command(env, 'destroy', '-force') - end - end - - recover_from_failed_destroy - raise 'Destroying cluster failed' - rescue => e - recover_from_failed_destroy - raise e - end - - def terraform_init - ::Timeout.timeout(30 * 60) do # 30 minutes - env = env_variables - env['TF_INIT_OPTIONS'] = '-no-color' - run_command(env, 'init') - end - rescue Timeout::Error - forensic(false) - raise 'Terraform init failed' - end - - def run_command(env, cmd, flags = '') - command = "terraform #{cmd} #{flags} -var-file=terraform.tfvars ../../platforms/#{env_variables['PLATFORM']} | - tee terraform-#{cmd}.log" - Open3.popen3(env, "bash -coxe pipefail '#{command}'") do |_stdin, stdout, stderr, wait_thr| - while (line = stdout.gets) - puts line - end - while (line = stderr.gets) - puts line - end - - exit_status = wait_thr.value - raise "failed to execute command: #{command}" unless exit_status.success? - end - end - - def recover_from_failed_destroy() end - - def wait_til_ready - sleep_wait_for_reboot - wait_for_bootstrapping - - from = Time.now - loop do - begin - KubeCTL.run(@kubeconfig, 'cluster-info') - break - rescue KubeCTL::KubeCTLCmdError - elapsed = Time.now - from - raise 'kubectl cluster-info never returned with successful error code' if elapsed > 1200 # 20 mins timeout - sleep 10 - end - end - - wait_nodes_ready - end - - def wait_nodes_ready - from = Time.now - loop do - puts 'Waiting for nodes become in ready state after an update' - Retriable.with_retries(KubeCTL::KubeCTLCmdError, limit: 5, sleep: 10) do - nodes = describe_nodes - nodes_ready = Array.new(@tfvars_file.node_count, false) - nodes['items'].each_with_index do |item, index| - item['status']['conditions'].each do |condition| - if condition['type'] == 'Ready' && condition['status'] == 'True' - nodes_ready[index] = true - end - end - end - if nodes_ready.uniq.length == 1 && nodes_ready.uniq.include?(true) - puts '**All nodes are Ready!**' - return true - end - puts "One or more nodes are not ready yet or missing nodes. Waiting...\n" \ - "# of returned nodes #{nodes['items'].size}. Expected #{@tfvars_file.node_count}" - elapsed = Time.now - from - raise 'waiting for all nodes to become ready timed out' if elapsed > 1200 # 20 mins timeout - sleep 20 - end - end - end - - def wait_for_bootstrapping - ips = master_ip_addresses - raise 'Empty master ips. Aborting...' if ips.empty? - wait_for_service('bootkube', ips) - wait_for_service('tectonic', ips) - puts 'HOORAY! The cluster is up' - end - - # Adding this sleep to wait for some time before we start ssh into the server - # if we ssh during the reboot from torcx this might put the shutdown in a weird state - # and that's might be the reason why we saw several connection timeouts in tests while spinning up a cluster - def sleep_wait_for_reboot - from = Time.now - loop do - elapsed = Time.now - from - puts "Sleeping for 5 minutes. Remaining #{300 - elapsed} seconds. Giving some time to the server reboot." - sleep 30 - break if elapsed > 300 # 5 mins timeout - end - puts 'Done. Lets check the cluster now...' - end - - def wait_for_service(service, ips) - from = Time.now - - ::Timeout.timeout(30 * 60) do # 30 minutes - loop do - return if service_finished_bootstrapping?(ips, service) - - elapsed = Time.now - from - if (elapsed.round % 5).zero? - puts "Waiting for bootstrapping of #{service} service to complete..." - puts "Checked master nodes: #{ips}" - end - sleep 10 - end - end - rescue Timeout::Error - puts 'Trying to collecting the logs...' - forensic(false) # Call forensic to collect logs when service timeout - raise "timeout waiting for #{service} service to bootstrap on any of: #{ips}" - end - - def service_finished_bootstrapping?(ips, service) - command = "systemctl is-active #{service} --quiet && [ $(systemctl show -p SubState --value #{service}) == \"exited\" ]" - ips.each do |ip| - finished = 1 - begin - _, _, finished = ssh_exec(ip, command) - rescue => e - puts "failed to ssh exec on ip #{ip} with: #{e}" - end - - if finished.zero? - puts "#{service} service finished successfully on ip #{ip}" - return true - end - end - false - end - - def describe_nodes - KubeCTL.run_and_parse(@kubeconfig, 'get nodes') - end -end diff --git a/tests/rspec/lib/cluster_factory.rb b/tests/rspec/lib/cluster_factory.rb deleted file mode 100644 index 94256252ac..0000000000 --- a/tests/rspec/lib/cluster_factory.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require 'aws_cluster' - -# Creates a platform specific Cluster object based on the provided tfvars file. -# -module ClusterFactory - def self.from_tf_vars(tf_vars_file) - cluster_class = "#{tf_vars_file.platform.downcase.capitalize}Cluster" - Object.const_get(cluster_class).new(tf_vars_file) - end - - def self.from_config_file(config_file) - cluster_class = "#{config_file.platform.downcase.capitalize}Cluster" - Object.const_get(cluster_class).new(config_file) - end - - def self.from_variable(cluster_type, config_file) - Object.const_get("#{cluster_type.downcase.capitalize}Cluster").new(config_file) - end -end diff --git a/tests/rspec/lib/container_linux.rb b/tests/rspec/lib/container_linux.rb deleted file mode 100644 index 441904a50a..0000000000 --- a/tests/rspec/lib/container_linux.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -require 'ssh' - -SSH_CMD_CONTAINER_LINUX_VERSION = 'if sudo [ -f /var/lib/update_engine/prefs/aleph-version ]; then \ - sudo cat /var/lib/update_engine/prefs/aleph-version; \ -else \ - source /usr/share/coreos/release && echo "$COREOS_RELEASE_VERSION"; \ -fi' - -# /etc/coreos/update.conf tells what the update_engine will look for -# /usr/share/coreos/update.conf tells where your current booted OS is coming from -SSH_CMD_CONTAINER_LINUX_CHANNEL = 'for conf in /usr/share/coreos/update.conf /etc/coreos/update.conf; do \ - [ -f "$conf" ] && source "$conf"; \ -done; \ -echo "$GROUP"' - -# ContainerLinux provides helpers to find OS-level properties for a cluster. -module ContainerLinux - def self.version(cluster) - v, err, = ssh_exec(cluster.master_ip_address, SSH_CMD_CONTAINER_LINUX_VERSION) - raise "failed to get Container Linux version for #{cluster.master_ip_address}: #{err}" if err != '' - v.chomp - end - - def self.channel(cluster) - c, err, = ssh_exec(cluster.master_ip_address, SSH_CMD_CONTAINER_LINUX_CHANNEL) - raise "failed to get Container Linux channel for #{cluster.master_ip_address}: #{err}" if err != '' - c.chomp - end -end diff --git a/tests/rspec/lib/operators.rb b/tests/rspec/lib/operators.rb index 2d76398206..de05fb1dd6 100644 --- a/tests/rspec/lib/operators.rb +++ b/tests/rspec/lib/operators.rb @@ -10,8 +10,6 @@ module Operators 'kube-core-operator', 'kube-addon-operator', 'tectonic-channel-operator', - # TODO: temporary disabling this for OpenTonic - # 'tectonic-prometheus-operator', 'tectonic-utility-operator' ].freeze diff --git a/tests/rspec/lib/pages/base_page.rb b/tests/rspec/lib/pages/base_page.rb deleted file mode 100644 index b54046537d..0000000000 --- a/tests/rspec/lib/pages/base_page.rb +++ /dev/null @@ -1,101 +0,0 @@ -# frozen_string_literal: true - -# filename: base_page.rb -require 'selenium-webdriver' - -# Base class to provide basic element interaction -class BasePage - def initialize(driver) - @driver = driver - end - - def visit(url_path) - @driver.get url_path - end - - def current_url - @driver.current_url - end - - def refresh - @driver.navigate.refresh - end - - def find(locator) - retries ||= 0 - wait_for { @driver.find_element locator } - rescue - retry if (retries += 1) < 3 - end - - def finds(locator) - @driver.find_elements locator - end - - def type(text, locator) - find(locator).send_keys text - end - - def clear_text(locator) - find(locator).clear - end - - def submit(locator) - find(locator).submit - end - - def click(locator) - retries ||= 0 - find(locator).click - rescue - retry if (retries += 1) < 3 - end - - def text_of(locator) - find(locator).text - end - - def text_include(locator, message) - retries ||= 0 - find(locator).text.include?(message) - rescue - retry if (retries += 1) < 3 - end - - def get_attibute(locator, attribute) - find(locator).attribute(attribute) - end - - def scroll_to(locator) - retries ||= 0 - find(locator).location_once_scrolled_into_view - rescue - retry if (retries += 1) < 10 - end - - def wait_for(seconds = 15) - Selenium::WebDriver::Wait.new(timeout: seconds).until { yield } - end - - def wait_for_message(locator, message, seconds = 15) - Selenium::WebDriver::Wait.new(timeout: seconds).until do - text_include(locator, message) - end - end - - def displayed?(locator) - retries ||= 0 - find(locator).displayed? - rescue Selenium::WebDriver::Error::NoSuchElementError - false - rescue - retry if (retries += 1) < 10 - end - - def enabled?(locator) - retries ||= 0 - find(locator).enabled? - rescue - retry if (retries += 1) < 10 - end -end diff --git a/tests/rspec/lib/pages/login_page.rb b/tests/rspec/lib/pages/login_page.rb deleted file mode 100644 index 0b0c897764..0000000000 --- a/tests/rspec/lib/pages/login_page.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# filename: login_page.rb - -require_relative 'base_page' -require 'json' - -# Login class to deal with tectonic login page -class Login < BasePage - include RSpec::Matchers - - USERNAME_INPUT = { id: 'login' }.freeze - PASSWORD_INPUT = { id: 'password' }.freeze - SUBMIT_INPUT = { id: 'submit-login' }.freeze - CLUSTER_STATUS_LABEL = { id: 'resource-title' }.freeze - LOGIN_FAIL = { id: 'login-error' }.freeze - ADMIN_SIDE_BAR = { css: '#sidebar > div.navigation-container > div:nth-child(6) > div' }.freeze - LOGOUT = { - css: '#sidebar > div.navigation-container > div:nth-child(6) > ul > li:nth-child(2) > a' - }.freeze - - def initialize(driver) - super - end - - def login_page(console_url) - check_console_health(console_url) - visit(console_url) - expect(displayed?(USERNAME_INPUT)).to be_truthy - end - - def logout - click(ADMIN_SIDE_BAR) - wait_for { displayed?(LOGOUT) } - click(LOGOUT) - expect(displayed?(USERNAME_INPUT)).to be_truthy - end - - def with(username, password) - type username, USERNAME_INPUT - type password, PASSWORD_INPUT - submit SUBMIT_INPUT - end - - def success_login? - wait_for { displayed?(CLUSTER_STATUS_LABEL) } - text_of(CLUSTER_STATUS_LABEL).include? 'Cluster Status' - end - - def fail_to_login? - wait_for { displayed?(LOGIN_FAIL) } - displayed?(LOGIN_FAIL) - end - - def check_console_health(console_url) - from = Time.now - loop do - status_json = nil - begin - status = `curl -k #{console_url}/health` - status_json = JSON.parse(status) - elapsed = Time.now - from - rescue JSON::ParserError => e - puts 'Not able to parse the /health result. waiting...' - sleep 2 - raise "Console was not ready. Not able to get a response from /health. Error #{e}" if elapsed > 1200 - retry - end - break if status_json['status'].eql? 'ok' - puts 'Waiting for Console to be ready...' if (elapsed.round % 5).zero? - raise "Console was not ready. Response from /health = #{status_json}" if elapsed > 1200 # 20 mins timeout - sleep 2 - end - end -end diff --git a/tests/rspec/lib/shared_examples/build_folder_setup.rb b/tests/rspec/lib/shared_examples/build_folder_setup.rb index 5e00b66fdc..a51851794d 100644 --- a/tests/rspec/lib/shared_examples/build_folder_setup.rb +++ b/tests/rspec/lib/shared_examples/build_folder_setup.rb @@ -6,7 +6,6 @@ RSpec.shared_examples 'withBuildFolderSetupWithConfig' do |config_path| before(:all) do Dir.chdir(File.join(File.dirname(ENV['RELEASE_TARBALL_PATH']), 'tectonic-dev')) - # TODO: Only ignore on AWS temp_config_file = ConfigFile.new(config_path) @name = ENV['CLUSTER'] || NameGenerator.generate(temp_config_file.prefix) ENV['CLUSTER'] = @name @@ -16,23 +15,6 @@ 'config.yaml' ) @config_file = ConfigFile.new(File.expand_path('config.yaml')) - end -end - -RSpec.shared_examples 'withBuildFolderSetup' do |tf_vars_path| - before(:all) do - Dir.chdir(File.join(File.dirname(ENV['RELEASE_TARBALL_PATH']), 'tectonic-dev')) - temp_tfvars_file = TFVarsFile.new(tf_vars_path) - @name = ENV['CLUSTER'] || NameGenerator.generate(temp_tfvars_file.prefix) - ENV['CLUSTER'] = @name - file_path = "build/#{@name}" - FileUtils.mkdir_p file_path - Dir.chdir(file_path) - - FileUtils.cp( - tf_vars_path, - 'terraform.tfvars' - ) - @tfvars_file = TFVarsFile.new(File.expand_path('terraform.tfvars')) + @config_file.change_cluster_name(@name) end end diff --git a/tests/rspec/lib/shared_examples/k8s.rb b/tests/rspec/lib/shared_examples/k8s.rb index 668587ea7f..89e503ffdd 100644 --- a/tests/rspec/lib/shared_examples/k8s.rb +++ b/tests/rspec/lib/shared_examples/k8s.rb @@ -1,43 +1,21 @@ # frozen_string_literal: true require 'shared_examples/build_folder_setup' -require 'shared_examples/tls_setup' require 'smoke_test' -require 'cluster_factory' -require 'container_linux' +require 'aws_cluster' require 'operators' -require 'pages/login_page' require 'name_generator' require 'password_generator' -require 'webdriver_helpers' require 'test_container' require 'with_retries' require 'jenkins' -RSpec.shared_examples 'withRunningCluster' do |tf_vars_path, vpn_tunnel = false| - include_examples('withBuildFolderSetup', tf_vars_path) - include_examples('withRunningClusterExistingBuildFolder', vpn_tunnel) -end - -RSpec.shared_examples 'withRunningClusterWithCustomTLS' do |tf_vars_path, domain, vpn_tunnel = false| - include_examples('withBuildFolderSetup', tf_vars_path) - include_examples('withTLSSetup', domain) - include_examples('withRunningClusterExistingBuildFolder', vpn_tunnel) -end - RSpec.shared_examples 'withRunningClusterExistingBuildFolder' do |vpn_tunnel = false, exist_plat = nil, exist_cfg_file = nil| before(:all) do # See https://stackoverflow.com/a/45936219/4011134 @exceptions = [] - @cluster = if exist_plat.nil? && exist_cfg_file.nil? && @config_file.nil? - ClusterFactory.from_tf_vars(@tfvars_file) - elsif @config_file.platform.include?('aws') && @tfvars_file.nil? - ClusterFactory.from_config_file(@config_file) - else - ClusterFactory.hard_coded_aws(exist_plat, exist_cfg_file) - end - + @cluster = AwsCluster.new(@config_file) @cluster.init @cluster.start if exist_plat.nil? && exist_cfg_file.nil? end @@ -100,70 +78,10 @@ end end - # Disabled because we are not idempotent - xit 'terraform plan after a terraform apply is an idempotent operation (does not suggest further changes)' do - # https://www.terraform.io/docs/commands/plan.html#detailed-exitcode - options = '-detailed-exitcode' - stdout, stderr, exit_status = @cluster.plan(options) - puts stdout, stderr unless exit_status.eql?(0) - expect(exit_status).to eq(0) - end - it 'succeeds with the golang test suit', :smoke_tests do expect { SmokeTest.run(@cluster) }.to_not raise_error end - it 'installs the correct Container Linux version' do - version = @cluster.tf_var('tectonic_container_linux_version') - # version = @cluster.tf_value('module.container_linux.version') if version == 'latest' - version = @cluster.tfstate['masters'].output('container_linux', 'version') if version == 'latest' - expect(ContainerLinux.version(@cluster)).to eq(version) - end - - # Disabled until bootstrap node and other nodes CL version gets consolidated - # https://github.com/coreos/tectonic-config/pull/16 - # https://github.com/coreos-inc/tectonic-operators/pull/333 - xit 'installs the correct Container Linux channel' do - expect(ContainerLinux.channel(@cluster)).to eq(@cluster.tf_var('tectonic_container_linux_channel')) - end - - # Disabled because it is causing some invalid results. Need some investigation - xdescribe 'Interact with tectonic console' do - before(:all) do - @driver = WebdriverHelpers.start_webdriver - @login = Login.new(@driver) - @console_url = @cluster.tectonic_console_url - end - - after(:all) do - WebdriverHelpers.stop_webdriver(@driver) if defined? @driver - end - - it 'can login in the tectonic console', :ui, retry: 3, retry_wait: 10 do - @login.login_page "https://#{@console_url}" - @login.with(@cluster.tectonic_admin_email, @cluster.tectonic_admin_password) - expect(@login.success_login?).to be_truthy - @login.logout - end - - it 'fail to login with wrong credentials', :ui, retry: 3, retry_wait: 10 do - @login.login_page "https://#{@console_url}" - @login.with(NameGenerator.generate_fake_email, PasswordGenerator.generate_password) - expect(@login.fail_to_login?).to be_truthy - end - end - - describe 'scale up worker cluster' do - before(:all) do - skip 'Skipping this tests. running locally' unless Jenkins.environment? - end - - it 'can scale up nodes by 1 worker' do - @cluster.config_file.add_worker_node(@cluster.config_file.worker_count + 1) - expect { @cluster.update_cluster }.to_not raise_error - end - end - it 'passes the k8s conformance tests', :conformance_tests do conformance_test = TestContainer.new( ENV['KUBE_CONFORMANCE_IMAGE'], @@ -184,20 +102,3 @@ end end end - -RSpec.shared_examples 'withPlannedCluster' do |tf_vars_path| - before(:all) do - @cluster = ClusterFactory.from_tf_vars(TFVarsFile.new(tf_vars_path)) - end - - it 'terraform plan succeeds' do - stdout, stderr, exit_status = @cluster.plan - puts "Terrform plan stdout:\n#{stdout}" - puts "Terrform plan stderr:\n#{stderr}" - expect(exit_status).to eq(0) - end - - after(:all) do - @cluster.stop - end -end diff --git a/tests/rspec/lib/shared_examples/tls_setup.rb b/tests/rspec/lib/shared_examples/tls_setup.rb deleted file mode 100644 index 475c22c554..0000000000 --- a/tests/rspec/lib/shared_examples/tls_setup.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -require 'fileutils' -require 'tls_certs' - -RSpec.shared_examples 'withTLSSetup' do |domain| - before(:all) do - smoke_platform_dir = if @tfvars_file.platform == 'metal' - 'bare-metal' - else - @tfvars_file.platform - end - test_folder = File.join(ENV['RSPEC_PATH'], '..') - generate_tls("#{test_folder}/smoke/#{smoke_platform_dir}/user_provided_tls/certs/", @name, domain) - - root_folder = File.join(ENV['RSPEC_PATH'], '../..') - custom_tls_tf = "#{test_folder}/smoke/#{smoke_platform_dir}/user_provided_tls/tls.tf" - dest_folder = "#{root_folder}/platforms/#{@tfvars_file.platform}" - original_tls_tf = "#{dest_folder}/tls.tf" - - FileUtils.mv(original_tls_tf, "#{dest_folder}/tls.tf.original") - FileUtils.cp(custom_tls_tf, dest_folder) - end -end diff --git a/tests/rspec/lib/tls_certs.rb b/tests/rspec/lib/tls_certs.rb deleted file mode 100644 index c652188f35..0000000000 --- a/tests/rspec/lib/tls_certs.rb +++ /dev/null @@ -1,117 +0,0 @@ -# frozen_string_literal: true - -require 'certificate_authority' -require 'fileutils' - -# Generates necessary TLS certificates -def generate_tls(path, cluster_name, domain, expiration_date = 365) - root_ca, kube_ca, aggregator_ca, etcd_ca = generate_ca_certs(expiration_date) - server_ingress = generate_ingress_certs(root_ca, cluster_name, domain, expiration_date) - - [ - ['ca/root-ca.crt', root_ca.to_pem], - ['ca/kube-ca.crt', kube_ca.to_pem], - ['ca/kube-ca.key', kube_ca.key_material.private_key], - ['ca/aggregator-ca.crt', aggregator_ca.to_pem], - ['ca/aggregator-ca.key', aggregator_ca.key_material.private_key], - ['ca/etcd-ca.crt', etcd_ca.to_pem], - ['ca/etcd-ca.key', etcd_ca.key_material.private_key], - - ['ingress/ca.crt', root_ca.to_pem], - ['ingress/ingress.key', server_ingress.key_material.private_key], - ['ingress/ingress.crt', server_ingress.to_pem] - ].each do |cert_name, contents| - save_tls_to_file(path, cert_name, contents) - end -end - -def generate_ca_certs(expiration_date = 365) - root_ca = certificate_authority(1, 'root-ca', 'tectonic', expiration_date) - kube_ca = intermediate_certificate_authority(root_ca, 2, 'kube-ca', 'bootkube', expiration_date) - aggregator_ca = intermediate_certificate_authority(root_ca, 3, 'aggregator', 'bootkube', expiration_date) - etcd_ca = intermediate_certificate_authority(root_ca, 4, 'etcd-ca', 'etcd', expiration_date) - - [root_ca, kube_ca, aggregator_ca, etcd_ca] -end - -def generate_ingress_certs(root_ca, cluster_name, domain, expiration_date = 365) - dns_name = if domain.include?('example.com') - "tectonic.#{domain}" - else - "#{cluster_name}.#{domain}" - end - - signing_profile_server = { - 'extensions' => { - 'keyUsage' => { 'usage' => %w[critical keyEncipherment digitalSignature] }, - 'extendedKeyUsage' => { 'usage' => %w[serverAuth clientAuth] }, - 'subjectAltName' => { 'dns_names' => [dns_name] } - } - } - server_ingress = server_certificate(root_ca, dns_name, '', signing_profile_server, expiration_date) - server_ingress -end - -def certificate_authority(serial_number, common_name, organization, expiration_date = 365) - mem_key = CertificateAuthority::MemoryKeyMaterial.new - mem_key.generate_key - - root = CertificateAuthority::Certificate.new - root.subject.common_name = common_name - root.subject.organization = organization - root.serial_number.number = serial_number - root.signing_entity = true - root.not_after = (Time.now + expiration_date * 86_400).utc # default is 365 days - root.key_material = mem_key - - ca_profile = { - 'extensions' => { - 'keyUsage' => { 'usage' => %w[critical keyCertSign digitalSignature keyEncipherment] } - } - } - root.sign!(ca_profile) - root -end - -def intermediate_certificate_authority(root, serial_number, common_name, organization, expiration_date = 365) - mem_key = CertificateAuthority::MemoryKeyMaterial.new - mem_key.generate_key - - inter = CertificateAuthority::Certificate.new - inter.subject.common_name = common_name - inter.subject.organization = organization - inter.serial_number.number = serial_number - inter.signing_entity = true - inter.parent = root - inter.not_after = (Time.now + expiration_date * 86_400).utc # default is 365 days - inter.key_material = mem_key - - ca_profile = { - 'extensions' => { - 'keyUsage' => { 'usage' => %w[critical keyCertSign digitalSignature keyEncipherment] } - } - } - inter.sign!(ca_profile) - inter -end - -def server_certificate(root, common_name, organization, signing_profile, expiration_date = 365) - server = CertificateAuthority::Certificate.new - server.subject.common_name = common_name - server.subject.organization = organization - server.serial_number.number = rand(3..100_000) - server.parent = root - server.not_after = (Time.now + expiration_date * 86_400).utc # + 1 day - server.key_material.generate_key - - server.sign!(signing_profile) - server -end - -def save_tls_to_file(path, cert_name, contents) - path_to_save = File.join(path, cert_name) - - FileUtils.mkdir_p(File.dirname(path_to_save)) - File.write(path_to_save, contents) - File.chmod(0o600, path_to_save) -end diff --git a/tests/rspec/lib/webdriver_helpers.rb b/tests/rspec/lib/webdriver_helpers.rb deleted file mode 100644 index c1431264ca..0000000000 --- a/tests/rspec/lib/webdriver_helpers.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -require 'selenium-webdriver' -require 'headless' - -# WebdriverHelpers contains helper functions to create the browser to use in the UI tests. -module WebdriverHelpers - def self.start_webdriver - @headless = Headless.new - @headless.start - options = Selenium::WebDriver::Chrome::Options.new - options.add_argument('--ignore-certificate-errors') - options.add_argument('--disable-popup-blocking') - options.add_argument('--disable-translate') - options.add_argument('--disable-gpu') - options.add_argument('--no-sandbox') - # options.add_argument('--headless') - driver = Selenium::WebDriver.for :chrome, options: options - target_size = Selenium::WebDriver::Dimension.new(1920, 1080) - driver.manage.window.size = target_size - driver.manage.timeouts.implicit_wait = 20 # seconds - driver.manage.timeouts.page_load = 60 # seconds - driver - end - - def self.stop_webdriver(driver) - driver.quit - @headless.destroy - end -end diff --git a/tests/rspec/spec/aws/basic_spec.rb b/tests/rspec/spec/aws/basic_spec.rb index dcb6210045..ba3defce4d 100644 --- a/tests/rspec/spec/aws/basic_spec.rb +++ b/tests/rspec/spec/aws/basic_spec.rb @@ -5,15 +5,6 @@ RSpec.describe 'aws-standard' do include_examples('withBuildFolderSetupWithConfig', File.join(ENV['RSPEC_PATH'], '../smoke/aws/vars/aws-basic.yaml')) - before(:all) do - # doing this because the example aws.tfvars.json is being used by the UI - # tests and it generates a fix cluster name. Here we just change the - # cluster/dns name all the other content stays the same as generated by the - # UI If we use the same name generated by the UI we can run just one test at - # the time. - @config_file.change_cluster_name(@name) - end - context 'with a cluster' do include_examples('withRunningClusterExistingBuildFolder', true) end diff --git a/tests/rspec/spec/aws/ca_spec.rb b/tests/rspec/spec/aws/ca_spec.rb deleted file mode 100644 index 34317bf5d3..0000000000 --- a/tests/rspec/spec/aws/ca_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -require 'shared_examples/k8s' - -RSpec.describe 'aws-custom-ca' do - include_examples( - 'withRunningCluster', - File.join(ENV['RSPEC_PATH'], '../smoke/aws/vars/aws-ca.tfvars.json') - ) -end diff --git a/tests/rspec/spec/aws/custom_tls_spec.rb b/tests/rspec/spec/aws/custom_tls_spec.rb deleted file mode 100644 index 172d89797c..0000000000 --- a/tests/rspec/spec/aws/custom_tls_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'shared_examples/k8s' - -DOMAIN = 'tectonic-ci.de' - -RSpec.describe 'aws-custom-tls' do - include_examples('withBuildFolderSetup', File.join(ENV['RSPEC_PATH'], '../smoke/aws/vars/aws.tfvars.json')) - include_examples('withTLSSetup', DOMAIN) - - before(:all) do - # doing this because the example aws.tfvars.json is being used by the UI tests - # and it generate a fix cluster name. Here we just change the cluster/dns name - # all the other content stay the same as generated by the UI - # If we use the same name generated by the UI we can run just one test at the time. - @tfvars_file.change_cluster_name(@name) - @tfvars_file.change_dns_name(@name) - end - - context 'with a cluster' do - include_examples('withRunningClusterExistingBuildFolder', true) - end -end diff --git a/tests/rspec/spec/aws/exp_spec.rb b/tests/rspec/spec/aws/exp_spec.rb deleted file mode 100644 index 88bcdaf40d..0000000000 --- a/tests/rspec/spec/aws/exp_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -require 'shared_examples/k8s' - -RSpec.describe 'aws-exp' do - include_examples( - 'withRunningCluster', - File.join(ENV['RSPEC_PATH'], '../smoke/aws/vars/aws-exp.tfvars.json') - ) -end diff --git a/tests/rspec/spec/aws/network_flannel_spec.rb b/tests/rspec/spec/aws/network_flannel_spec.rb deleted file mode 100644 index 679a474a36..0000000000 --- a/tests/rspec/spec/aws/network_flannel_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -require 'shared_examples/k8s' - -RSpec.describe 'aws-network-flannel' do - include_examples( - 'withRunningCluster', - File.join(ENV['RSPEC_PATH'], '../smoke/aws/vars/aws-net-flannel.tfvars.json') - ) -end diff --git a/tests/rspec/spec/aws/vpc_internal_spec.rb b/tests/rspec/spec/aws/vpc_internal_spec.rb deleted file mode 100644 index 9b3fd7b635..0000000000 --- a/tests/rspec/spec/aws/vpc_internal_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -require 'shared_examples/k8s' -require 'aws_vpc' -require 'aws_region' -require 'jenkins' -require 'aws_iam' - -RSpec.describe 'aws-vpc' do - include_examples( - 'withBuildFolderSetup', - File.join(ENV['RSPEC_PATH'], '../smoke/aws/vars/aws-vpc-internal.tfvars.json') - ) - - before(:all) do - export_random_region_if_not_defined - # AWSIAM.assume_role(ENV['TF_VAR_tectonic_aws_region']) if ENV.key?('TECTONIC_INSTALLER_ROLE') - @vpc = AWSVPC.new('test-vpc') - @vpc.create - end - - context 'with a cluster' do - include_examples('withRunningClusterExistingBuildFolder', true) - end - - after(:all) do - @vpc.destroy - end -end diff --git a/tests/rspec/spec/existing_cluster_spec.rb b/tests/rspec/spec/existing_cluster_spec.rb deleted file mode 100644 index 8d860081a2..0000000000 --- a/tests/rspec/spec/existing_cluster_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -require 'shared_examples/k8s' -require 'env_var' - -RSpec.describe 'existing_cluster' do - before(:all) do - raise 'Missing existing platform. Please set PLATFORM environment variable' unless EnvVar.set?(%w[PLATFORM]) - raise 'Missing existing platform. Please set CLUSTER environment variable' unless EnvVar.set?(%w[CLUSTER]) - end - - context 'with a cluster' do - vars_file_path = File.join(ENV['RELEASE_TARBALL_PATH'], "../tectonic/build/#{ENV['CLUSTER']}/terraform.tfvars") - raise 'Missing tfvars. Aborting...' unless File.exist?(vars_file_path) - existing_vars_file = TFVarsFile.new(vars_file_path) - - cred_file = File.join(ENV['RELEASE_TARBALL_PATH'], "../tectonic/build/#{ENV['CLUSTER']}/utils/console_creds.txt") - if File.exist?(cred_file) - creds = File.read(cred_file) - creds_hash = JSON.parse(creds) - tectonic_admin_email = creds_hash['tectonic_admin_email'] - tectonic_admin_password = creds_hash['tectonic_admin_password'] - elsif existing_vars_file.tectonic_admin_email && existing_vars_file.tectonic_admin_password - tectonic_admin_email = existing_vars_file.tectonic_admin_email - tectonic_admin_password = existing_vars_file.tectonic_admin_password - end - - ENV['TF_VAR_tectonic_admin_email'] = tectonic_admin_email - ENV['TF_VAR_tectonic_admin_password'] = tectonic_admin_password - - include_examples('withRunningClusterExistingBuildFolder', - false, - ENV['PLATFORM'], - existing_vars_file) - end -end diff --git a/tests/rspec/spec/meta-tests/aws_vpc_spec.rb b/tests/rspec/spec/meta-tests/aws_vpc_spec.rb deleted file mode 100644 index e53b85efd7..0000000000 --- a/tests/rspec/spec/meta-tests/aws_vpc_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -require 'aws_vpc' -require 'aws_iam' - -describe AWSVPC do - before(:all) do - AWSIAM.assume_role if ENV.key?('TECTONIC_INSTALLER_ROLE') - @vpc = described_class.new('test-vpc') - end - - it '#initialize generated a password' do - expect(@vpc.ovpn_password.nil?).to be_falsey - expect(@vpc.ovpn_password.empty?).to be_falsey - end - - context '#create' do - before(:all) do - @vpc.create - end - - after(:all) do - @vpc.destroy - end - - it 'sets the vpn_url' do - expect(@vpc.vpn_url.nil?).to be_falsey - expect(@vpc.vpn_url.empty?).to be_falsey - end - - it 'sets the vpn_config' do - expect(@vpc.vpn_connection.vpn_conf.nil?).to be_falsey - expect(@vpc.vpn_connection.vpn_conf.empty?).to be_falsey - end - end -end diff --git a/tests/rspec/spec/meta-tests/name_generator_spec.rb b/tests/rspec/spec/meta-tests/name_generator_spec.rb deleted file mode 100644 index 4335c91cab..0000000000 --- a/tests/rspec/spec/meta-tests/name_generator_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -require 'name_generator' - -describe NameGenerator do - before(:all) do - @curent_env = ENV.clone - end - - after(:all) do - ENV.clear - ENV = @curent_env.clone - end - - it 'prefix should not contain more than 10 chars' do - ENV['BUILD_ID'] = '1' - ENV['BRANCH_NAME'] = 'master' - prefix = 'my-long-string-with-prefix' - - expect(NameGenerator.jenkins_env_name(prefix).split('-')[0]).to eq('mylonstrwi') - end -end diff --git a/tests/rspec/spec/meta-tests/tfvars_file_spec.rb b/tests/rspec/spec/meta-tests/tfvars_file_spec.rb deleted file mode 100644 index bfbdb6a4a3..0000000000 --- a/tests/rspec/spec/meta-tests/tfvars_file_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -require 'tfvars_file' - -TFVARS_FILE_PATH = '../smoke/aws/vars/aws.tfvars.json' - -describe TFVarsFile do - subject { described_class.new(TFVARS_FILE_PATH) } - - context 'with wrong file path' do - subject { described_class.new('wrong-file-path') } - it 'throws an exception' do - expect { subject }.to raise_error(RuntimeError) - end - end - - it '#path returns the file path' do - expect(subject.path).to be(TFVARS_FILE_PATH) - end - - it '#node_count returns correct #' do - expect(subject.node_count).to eq(4) - end - - it '#networking? returns empty string if not set' do - expect(subject.networking).to eq('') - end - - it 'returns raw variable values via reflection' do - expect(subject.tectonic_aws_worker_ec2_type).to eq('m4.large') - end -end diff --git a/tests/rspec/utils/20-metal.conf b/tests/rspec/utils/20-metal.conf deleted file mode 100644 index db7312e0a4..0000000000 --- a/tests/rspec/utils/20-metal.conf +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "metal0", - "type": "bridge", - "bridge": "metal0", - "isGateway": true, - "ipMasq": true, - "ipam": { - "type": "host-local", - "subnet": "172.18.0.0/24", - "routes" : [ { "dst" : "0.0.0.0/0" } ] - } -} diff --git a/tests/rspec/utils/rkt-auth.json b/tests/rspec/utils/rkt-auth.json deleted file mode 100644 index 1ed69556de..0000000000 --- a/tests/rspec/utils/rkt-auth.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "rktKind": "dockerAuth", - "rktVersion": "v1", - "registries": ["quay.io"], - "credentials": { - "user": "foo", - "password": "bar" - } -} \ No newline at end of file diff --git a/tests/smoke/aws/vars/aws-basic.tfvars.json b/tests/smoke/aws/vars/aws-basic.tfvars.json deleted file mode 100644 index 4dd3841821..0000000000 --- a/tests/smoke/aws/vars/aws-basic.tfvars.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "tectonic_aws_etcd_ec2_type": "m4.large", - "tectonic_aws_etcd_root_volume_size": 32, - "tectonic_aws_etcd_root_volume_type": "gp2", - "tectonic_aws_master_ec2_type": "m4.large", - "tectonic_aws_master_root_volume_size": 32, - "tectonic_aws_master_root_volume_type": "gp2", - "tectonic_aws_endpoints": "public", - "tectonic_aws_vpc_cidr_block": "10.0.0.0/16", - "tectonic_aws_worker_ec2_type": "m4.large", - "tectonic_aws_worker_root_volume_size": 32, - "tectonic_aws_worker_root_volume_type": "gp2", - "tectonic_base_domain": "tectonic-ci.de", - "tectonic_cluster_name": "aws-basic", - "tectonic_dns_name": "aws-basic", - "tectonic_etcd_count": 3, - "tectonic_master_count": 2, - "tectonic_stats_url": "https://stats-collector-staging.tectonic.com", - "tectonic_worker_count": 2, - "tectonic_container_linux_channel": "beta" -} diff --git a/tests/smoke/aws/vars/aws-ca.tfvars.json b/tests/smoke/aws/vars/aws-ca.tfvars.json deleted file mode 100644 index 19a1a1bfdd..0000000000 --- a/tests/smoke/aws/vars/aws-ca.tfvars.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "tectonic_worker_count": 2, - - "tectonic_master_count": 2, - - "tectonic_etcd_count": 3, - - "tectonic_ca_cert": "-----BEGIN CERTIFICATE-----\nMIIFDTCCAvWgAwIBAgIJAIuXq10k2OFlMA0GCSqGSIb3DQEB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z0cnxYmWD\n7CwERVECggEAaFVKalfOAVXwnLrxwbRUUTll3k8AthnraoWGRZC8/qQCvukNI10n\nmsp7M2GpHLnFIgkPXPbqiC0bdz7smf0DT3Yw7/PXQo70mryPObKJlUbZDVnlgoEZ\nPno42Wo4Nv6Ifla5YYfKV3JofcQAlFILckI2OwfPWD1EWy8qRPZnGryfD13LWXWO\nvuzrg7QundoJoP/v9pacOhMOxoWWjDhhH8fxTQzoy1N891oPdCk5O2BoE5W+Q+89\nRMkPJhGGW87tsV7alN5ZiVwdDDdZZvJOa2k+KRhCbX7jrTHo2+SYwD1rk9nPxKfh\nvigSDd0ThaT17D/MC5L5Ag9bYTIPUzLeFQKCAQEAq6RjI5A3Xppq9OFziOjgrUGv\n2/xIH1NH7hdqGk5V+QRYQdD7Vd9wnF4f0CpIYTR55Mcud4amL3mHcR2IdjhJ4wcL\n0VnSghllTdzO9dcDQ3cigIkzdikGoC+xPQRXMpt3sWS3BYyJZmjsUG1+TgPOZZeb\nDInfb96I9euapu9meSrwzYy7R21eFfmVqqIaVkDv4fYfUiJZoSA9JygYul3jMt4p\nrS7cdWaDaR/EX3aTA1S9S331CFwhzRYC5cj6t+Qz5SIH9czmHFH6STfIvYtkxGvC\nGtROM9ZeDkO+/LwKbQlkbjuazbPCSWy5/163bPbK1w7PA2Ae7jMaJYtm3wYzQQ==\n-----END RSA PRIVATE KEY-----", - - "tectonic_ca_key_alg": "RSA", - - "tectonic_aws_master_ec2_type": "m4.large", - - "tectonic_aws_worker_ec2_type": "m4.large", - - "tectonic_aws_etcd_ec2_type": "m4.large", - - "tectonic_aws_vpc_cidr_block": "10.0.0.0/16", - - "tectonic_aws_external_vpc_id": "", - - "tectonic_stats_url": "https://stats-collector-staging.tectonic.com", - - "tectonic_container_linux_channel": "beta" -} diff --git a/tests/smoke/aws/vars/aws-ca.yaml b/tests/smoke/aws/vars/aws-ca.yaml deleted file mode 100644 index 833c28d6ac..0000000000 --- a/tests/smoke/aws/vars/aws-ca.yaml +++ /dev/null @@ -1,112 +0,0 @@ -aws: - etcd: - ec2Type: m4.large - master: - ec2Type: m4.large - vpcCIDRBlock: 10.0.0.0/16 - worker: - ec2Type: m4.large -ca: - cert: | - -----BEGIN CERTIFICATE----- - MIIFDTCCAvWgAwIBAgIJAIuXq10k2OFlMA0GCSqGSIb3DQEBCwUAMBIxEDAOBgNV - BAMMB2Zha2UtY2EwHhcNMTcwMjAxMjIxMzI0WhcNMjcwMTMwMjIxMzI0WjASMRAw - DgYDVQQDDAdmYWtlLWNhMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA - zzHsB56F6oZjsVBKzfpicsG+mVHQ/QzA4jqRCbQ8Zr12NtUZKnPUVwDoFf4WTfmy - Z0u8Uv+6/B/8un3LGsIaJEugPfRboc2oZKJcqfMJSFfLb/wkmT0D/1HJR60ml/M5 - wpHeh4vQ7BhktNsK90EjdlLvr1GDfevXArnye5ksEInOSX9nXVsGPrm0AGSffhmY - uUAjY8f9IspJa1j4vL6NI89GWO4jqME+SUnuI4SYIkuQJoSElofAIX2b5Tk3dFya - VKmAq2L89teCMYsciPbFa/Z2HvDNZ7pC17Ow7zr1f+V5BU18h3cLk610YNPcEBw0 - f94+mePsmMSMjUM0f+NMFyDERF+pys60/3qqVWrJe/FkJM6NDCyWXXXAfTxIwLq0 - CVrlWALdTc+RMAPI2sxAdUp4BqAuek4SjIg3FuoJrBs3EAUPfybclJ7g3HJwyXM2 - 3WIe10BnSk+rGzd4KMVbYw5/nM8Nc/Y20R2an/vVZn6xTxs9o6hhEHF7d5iws6Bi - 7/jv+jdZhLG8b3sG6Tj7a7YdvKWqH/mSPFlc/sevYOjR7NKYRMwGnl0d9qf+Xe5V - xyH1llIXPs6+y1B4tRyL/tulyeVqi25+I4QVAYypxWU8CPyw7tsSdOsSTbeGTmXj - ehelY/BCjAqAcexL7oRV7dy7VZ1Ezg6zQRwMt0Tar90CAwEAAaNmMGQwHQYDVR0O - BBYEFNGPoXTjJnHjG2zMpjSg/9vNO/trMB8GA1UdIwQYMBaAFNGPoXTjJnHjG2zM - pjSg/9vNO/trMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgGGMA0G - CSqGSIb3DQEBCwUAA4ICAQC9V/0iiEZYHz7xbezHpeGHwmecH5oylEvAeCcN10gx - HFvUN+XMyBaPqN7iRtx/rSqyp2iN2AK1Cdn1viOSRc09lwPiuj9V4diSDyPwJWxd - 60gqd5E9F9gQXlenWoIdm7kW8Lo8HLfx8ItYKGpE51JUctTmGY5WURRmBlVKr1LA - hbVsAWBaGQfPyW1CrFcxxc5mCABxWOxjRjLw8A8c5IXD0Q5C5pRd0BckBHKTdl40 - owm893oPEQcu/1C432T4vIddVh1Ktq1pd7O/9BPYOaPryzf7076xSwZ0bSuBUGRq - Vd3STfu5QRqpMv4dIrhqRofmIUzjOHLRX8Lx2pzgYcMgMQ8O+jM+ETrYD6rsDoLQ - uiVSWZK0YFndKzNTA04u57arRumWKqqfS0kkDFayumyv6KaDS6YZdsqSRmaiLAOG - F6jchpUtkDhDY0v/Y7jESUneT0hRnqNMPAKJMNhE4hS+1qkcP/ikQQgZl/OWma1z - HUyBGT4OGP2T3JIfq12Z4vC5FGVD4aD/frTvPMlifV3i8lKlYZs271JPXUo6ASIA - ZSBpV5QilOlE25Q5Lcw0yWmN4KwxqBL9bJ5W9D1I0qhWxaMF78m+8vLIFv+dAylE - Od27a+1We/P5ey7WRlwCfuEcFV7nYS/qMykYdQ9fxHSPgTPlrGrSwKstaaIIqOkE - kA== - -----END CERTIFICATE----- - key: |- - -----BEGIN RSA PRIVATE KEY----- - MIIJKgIBAAKCAgEAzzHsB56F6oZjsVBKzfpicsG+mVHQ/QzA4jqRCbQ8Zr12NtUZ - KnPUVwDoFf4WTfmyZ0u8Uv+6/B/8un3LGsIaJEugPfRboc2oZKJcqfMJSFfLb/wk - mT0D/1HJR60ml/M5wpHeh4vQ7BhktNsK90EjdlLvr1GDfevXArnye5ksEInOSX9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lO - 3ZlJAPfVAu+y8JkrGv8SMFxXH5pkmlFRqmKZ7DzYchRvx6HM+cA3CbCIgujbMG5z - aLWnrybitaLgWVOU+Fy3oq0Lc0yKLnIKfsDFP8i7YSXpkAph3G4Qnhzz0cnxYmWD - 7CwERVECggEAaFVKalfOAVXwnLrxwbRUUTll3k8AthnraoWGRZC8/qQCvukNI10n - msp7M2GpHLnFIgkPXPbqiC0bdz7smf0DT3Yw7/PXQo70mryPObKJlUbZDVnlgoEZ - Pno42Wo4Nv6Ifla5YYfKV3JofcQAlFILckI2OwfPWD1EWy8qRPZnGryfD13LWXWO - vuzrg7QundoJoP/v9pacOhMOxoWWjDhhH8fxTQzoy1N891oPdCk5O2BoE5W+Q+89 - RMkPJhGGW87tsV7alN5ZiVwdDDdZZvJOa2k+KRhCbX7jrTHo2+SYwD1rk9nPxKfh - vigSDd0ThaT17D/MC5L5Ag9bYTIPUzLeFQKCAQEAq6RjI5A3Xppq9OFziOjgrUGv - 2/xIH1NH7hdqGk5V+QRYQdD7Vd9wnF4f0CpIYTR55Mcud4amL3mHcR2IdjhJ4wcL - 0VnSghllTdzO9dcDQ3cigIkzdikGoC+xPQRXMpt3sWS3BYyJZmjsUG1+TgPOZZeb - DInfb96I9euapu9meSrwzYy7R21eFfmVqqIaVkDv4fYfUiJZoSA9JygYul3jMt4p - rS7cdWaDaR/EX3aTA1S9S331CFwhzRYC5cj6t+Qz5SIH9czmHFH6STfIvYtkxGvC - GtROM9ZeDkO+/LwKbQlkbjuazbPCSWy5/163bPbK1w7PA2Ae7jMaJYtm3wYzQQ== - -----END RSA PRIVATE KEY----- - keyAlg: RSA -containerLinux: - channel: beta -etcd: - nodePools: - - etcd -master: - nodePools: - - master -nodePools: - - count: 3 - name: etcd - - count: 2 - name: master - - count: 2 - name: worker -platform: aws -worker: - nodePools: - - worker diff --git a/tests/smoke/aws/vars/aws-exp.tfvars.json b/tests/smoke/aws/vars/aws-exp.tfvars.json deleted file mode 100644 index 298e3f8758..0000000000 --- a/tests/smoke/aws/vars/aws-exp.tfvars.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "tectonic_worker_count": 2, - - "tectonic_master_count": 1, - - "tectonic_ca_cert": "", - - "tectonic_ca_key": "", - - "tectonic_aws_master_ec2_type": "m4.large", - - "tectonic_aws_worker_ec2_type": "m4.large", - - "tectonic_aws_etcd_ec2_type": "m4.large", - - "tectonic_aws_vpc_cidr_block": "10.0.0.0/16", - - "tectonic_aws_external_vpc_id": "", - - "tectonic_experimental": true, - - "tectonic_stats_url": "https://stats-collector-staging.tectonic.com", - - "tectonic_container_linux_channel": "beta" -} diff --git a/tests/smoke/aws/vars/aws-exp.yaml b/tests/smoke/aws/vars/aws-exp.yaml deleted file mode 100644 index fa226883fe..0000000000 --- a/tests/smoke/aws/vars/aws-exp.yaml +++ /dev/null @@ -1,22 +0,0 @@ -aws: - etcd: - ec2Type: m4.large - master: - ec2Type: m4.large - vpcCIDRBlock: 10.0.0.0/16 - worker: - ec2Type: m4.large -containerLinux: - channel: beta -master: - nodepools: - - master -nodePools: - - count: 1 - name: master - - count: 2 - name: worker -platform: aws -worker: - nodePools: - - worker diff --git a/tests/smoke/aws/vars/aws-net-flannel.tfvars.json b/tests/smoke/aws/vars/aws-net-flannel.tfvars.json deleted file mode 100644 index d2ce9bc6ec..0000000000 --- a/tests/smoke/aws/vars/aws-net-flannel.tfvars.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "tectonic_worker_count": 2, - - "tectonic_master_count": 1, - - "tectonic_ca_cert": "", - - "tectonic_ca_key": "", - - "tectonic_aws_master_ec2_type": "m4.large", - - "tectonic_aws_worker_ec2_type": "m4.large", - - "tectonic_aws_etcd_ec2_type": "m4.large", - - "tectonic_aws_vpc_cidr_block": "10.0.0.0/16", - - "tectonic_aws_external_vpc_id": "", - - "tectonic_stats_url": "https://stats-collector-staging.tectonic.com", - - "tectonic_networking": "flannel", - - "tectonic_container_linux_channel": "beta" -} diff --git a/tests/smoke/aws/vars/aws-net-flannel.yaml b/tests/smoke/aws/vars/aws-net-flannel.yaml deleted file mode 100644 index ffa3639444..0000000000 --- a/tests/smoke/aws/vars/aws-net-flannel.yaml +++ /dev/null @@ -1,24 +0,0 @@ -aws: - etcd: - ec2Type: m4.large - master: - ec2Type: m4.large - vpcCIDRBlock: 10.0.0.0/16 - worker: - ec2Type: m4.large -containerLinux: - channel: beta -master: - nodepools: - - master -networking: - type: flannel -nodePools: - - count: 1 - name: master - - count: 2 - name: worker -platform: aws -worker: - nodePools: - - worker diff --git a/tests/smoke/aws/vars/aws-vpc-internal.tfvars.json b/tests/smoke/aws/vars/aws-vpc-internal.tfvars.json deleted file mode 100644 index cdf7816a7e..0000000000 --- a/tests/smoke/aws/vars/aws-vpc-internal.tfvars.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "tectonic_aws_etcd_ec2_type": "m4.large", - "tectonic_aws_endpoints": "private", - "tectonic_aws_master_ec2_type": "m4.large", - "tectonic_aws_vpc_cidr_block": "10.0.0.0/16", - "tectonic_aws_worker_ec2_type": "m4.large", - "tectonic_ca_cert": "", - "tectonic_ca_key": "", - "tectonic_etcd_count": 1, - "tectonic_master_count": 1, - "tectonic_stats_url": "https://stats-collector-staging.tectonic.com", - "tectonic_worker_count": 2, - "tectonic_container_linux_channel": "beta" -} diff --git a/tests/smoke/aws/vars/aws-vpc-internal.yaml b/tests/smoke/aws/vars/aws-vpc-internal.yaml deleted file mode 100644 index d2ee75881d..0000000000 --- a/tests/smoke/aws/vars/aws-vpc-internal.yaml +++ /dev/null @@ -1,27 +0,0 @@ -aws: - etcd: - ec2Type: m4.large - master: - ec2Type: m4.large - vpcCIDRBlock: 10.0.0.0/16 - worker: - ec2Type: m4.large -containerLinux: - channel: beta -etcd: - nodePools: - - etcd -master: - nodepools: - - master -nodePools: - - count: 1 - name: etcd - - count: 1 - name: master - - count: 2 - name: worker -platform: aws -worker: - nodePools: - - worker diff --git a/tests/smoke/cluster_test.go b/tests/smoke/cluster_test.go index 67df371d8c..60a1b009e1 100644 --- a/tests/smoke/cluster_test.go +++ b/tests/smoke/cluster_test.go @@ -77,7 +77,8 @@ func testCluster(t *testing.T) { // t.Run("NetworkPolicy", testNetworkPolicy) //} - t.Run("KillAPIServer", testKillAPIServer) + // TODO: temporary disabling this for OpenTonic + //t.Run("KillAPIServer", testKillAPIServer) } func testAllPodsRunning(t *testing.T) {