Skip to content

Commit

Permalink
fixing acceptance tests (#25)
Browse files Browse the repository at this point in the history
* fixing acceptance tests

* fixing syntax in param and adjusting sleep times in acceptance test
  • Loading branch information
davejrt authored and scotty-c committed Nov 28, 2017
1 parent 7ba2da7 commit 0427a74
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 332 deletions.
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
$front_proxy_client_key = undef
$sa_key = undef
$sa_pub = undef
$cni_network_provider = 'https://git.io/weave-kube-1.6'
$cni_network_provider = 'https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d "\n")\&env.IPALLOC_RANGE=100.32.0.0/12'
$install_dashboard = false

}
38 changes: 38 additions & 0 deletions rakelib/acceptance.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
require 'rake'
require 'parallel_tests'

# We clear the Beaker rake tasks from spec_helper as they assume
# rspec-puppet and a certain filesystem layout
Rake::Task[:beaker_nodes].clear
Rake::Task[:beaker].clear

desc "Run acceptance tests"
RSpec::Core::RakeTask.new(:acceptance => [:spec_prep]) do |t|
t.pattern = 'spec/acceptance'
end

namespace :acceptance do
{
:vagrant => [
'centos-72-x64',
'default',
'ubuntu-1604-x64',
],
:pooler => [
'centos7',
'default',
'ubuntu-1604',
]
}.each do |ns, configs|
namespace ns.to_sym do
configs.each do |config|
desc "Run acceptance tests for #{ns}:#{config}"
RSpec::Core::RakeTask.new("#{config}".to_sym => [:spec_prep]) do |t|
ENV['BEAKER_keyfile'] = '~/.ssh/id_rsa-acceptance' if ns == :pooler
ENV['BEAKER_set'] = "#{ns}/#{config}"
t.pattern = 'spec/acceptance'
end
end
end
end
end
4 changes: 2 additions & 2 deletions spec/acceptance/kubernetes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ class {'kubernetes':
context 'appliction deployment' do

it 'can deploy an application into a namespace and expose it' do
shell('sleep 300')
shell('sleep 180')
shell('KUBECONFIG=/root/admin.conf kubectl create -f /tmp/nginx.yml', :acceptable_exit_codes => [0]) do |r|
expect(r.stdout).to match(/namespace "nginx" created\ndeployment "my-nginx" created\nservice "my-nginx" created\n/)
end
end

it 'can access the deployed service' do
shell('sleep 120')
shell('sleep 60')
shell('curl 10.96.188.5', :acceptable_exit_codes => [0]) do |r|
expect(r.stdout).to match (/Welcome to nginx!/)
end
Expand Down
15 changes: 15 additions & 0 deletions spec/acceptance/nodesets/pooler/centos7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
HOSTS:
centos7:
roles:
- default
platform: el7-x86_64
hypervisor: vmpooler
template: Delivery/Quality Assurance/Templates/vCloud/centos-7-x86_64
CONFIG:
nfs_server: none
consoleport: 443
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/
type: foss
15 changes: 15 additions & 0 deletions spec/acceptance/nodesets/pooler/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
HOSTS:
ubuntu-1604-master:
roles:
- default
platform: ubuntu-16.04-amd64
hypervisor: vmpooler
template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1604-x86_64
CONFIG:
nfs_server: none
consoleport: 443
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/
type: foss
15 changes: 15 additions & 0 deletions spec/acceptance/nodesets/pooler/ubuntu-1604.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
HOSTS:
ubuntu-1604-master:
roles:
- default
platform: ubuntu-16.04-amd64
hypervisor: vmpooler
template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1604-x86_64
CONFIG:
nfs_server: none
consoleport: 443
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/
type: foss
Loading

0 comments on commit 0427a74

Please sign in to comment.