Skip to content

Commit 0427a74

Browse files
davejrtscotty-c
authored andcommitted
fixing acceptance tests (#25)
* fixing acceptance tests * fixing syntax in param and adjusting sleep times in acceptance test
1 parent 7ba2da7 commit 0427a74

File tree

7 files changed

+111
-332
lines changed

7 files changed

+111
-332
lines changed

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
$front_proxy_client_key = undef
5757
$sa_key = undef
5858
$sa_pub = undef
59-
$cni_network_provider = 'https://git.io/weave-kube-1.6'
59+
$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'
6060
$install_dashboard = false
6161

6262
}

rakelib/acceptance.rake

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
require 'rake'
2+
require 'parallel_tests'
3+
4+
# We clear the Beaker rake tasks from spec_helper as they assume
5+
# rspec-puppet and a certain filesystem layout
6+
Rake::Task[:beaker_nodes].clear
7+
Rake::Task[:beaker].clear
8+
9+
desc "Run acceptance tests"
10+
RSpec::Core::RakeTask.new(:acceptance => [:spec_prep]) do |t|
11+
t.pattern = 'spec/acceptance'
12+
end
13+
14+
namespace :acceptance do
15+
{
16+
:vagrant => [
17+
'centos-72-x64',
18+
'default',
19+
'ubuntu-1604-x64',
20+
],
21+
:pooler => [
22+
'centos7',
23+
'default',
24+
'ubuntu-1604',
25+
]
26+
}.each do |ns, configs|
27+
namespace ns.to_sym do
28+
configs.each do |config|
29+
desc "Run acceptance tests for #{ns}:#{config}"
30+
RSpec::Core::RakeTask.new("#{config}".to_sym => [:spec_prep]) do |t|
31+
ENV['BEAKER_keyfile'] = '~/.ssh/id_rsa-acceptance' if ns == :pooler
32+
ENV['BEAKER_set'] = "#{ns}/#{config}"
33+
t.pattern = 'spec/acceptance'
34+
end
35+
end
36+
end
37+
end
38+
end

spec/acceptance/kubernetes_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ class {'kubernetes':
3131
context 'appliction deployment' do
3232

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

4040
it 'can access the deployed service' do
41-
shell('sleep 120')
41+
shell('sleep 60')
4242
shell('curl 10.96.188.5', :acceptable_exit_codes => [0]) do |r|
4343
expect(r.stdout).to match (/Welcome to nginx!/)
4444
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
HOSTS:
2+
centos7:
3+
roles:
4+
- default
5+
platform: el7-x86_64
6+
hypervisor: vmpooler
7+
template: Delivery/Quality Assurance/Templates/vCloud/centos-7-x86_64
8+
CONFIG:
9+
nfs_server: none
10+
consoleport: 443
11+
datastore: instance0
12+
folder: Delivery/Quality Assurance/Enterprise/Dynamic
13+
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
14+
pooling_api: http://vcloud.delivery.puppetlabs.net/
15+
type: foss
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
HOSTS:
2+
ubuntu-1604-master:
3+
roles:
4+
- default
5+
platform: ubuntu-16.04-amd64
6+
hypervisor: vmpooler
7+
template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1604-x86_64
8+
CONFIG:
9+
nfs_server: none
10+
consoleport: 443
11+
datastore: instance0
12+
folder: Delivery/Quality Assurance/Enterprise/Dynamic
13+
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
14+
pooling_api: http://vcloud.delivery.puppetlabs.net/
15+
type: foss
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
HOSTS:
2+
ubuntu-1604-master:
3+
roles:
4+
- default
5+
platform: ubuntu-16.04-amd64
6+
hypervisor: vmpooler
7+
template: Delivery/Quality Assurance/Templates/vCloud/ubuntu-1604-x86_64
8+
CONFIG:
9+
nfs_server: none
10+
consoleport: 443
11+
datastore: instance0
12+
folder: Delivery/Quality Assurance/Enterprise/Dynamic
13+
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
14+
pooling_api: http://vcloud.delivery.puppetlabs.net/
15+
type: foss

0 commit comments

Comments
 (0)