Skip to content

Commit

Permalink
add some minimal tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cristifalcas committed Apr 7, 2016
1 parent 35ec66c commit cf78ab8
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/classes/kubernetes_master_apiserver_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'spec_helper'

describe 'kubernetes::master::apiserver' do
context 'with defaults for all parameters on RedHat' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'RedHat',
}
end

let :params do
{
:service_cluster_ip_range => '1.1.1.1',
}
end

it { is_expected.to compile.with_all_deps }
it { should contain_class('kubernetes::master::apiserver') }
it { should contain_package('kubernetes-master').with_ensure('present') }
it { should contain_service('kube-apiserver') }
end
end
16 changes: 16 additions & 0 deletions spec/classes/kubernetes_master_controller_manager_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'spec_helper'

describe 'kubernetes::master::controller_manager' do
context 'with defaults for all parameters on RedHat' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'RedHat',
}
end
it { is_expected.to compile.with_all_deps }
it { should contain_class('kubernetes::master') }
it { should contain_package('kubernetes-master').with_ensure('present') }
it { should contain_service('kube-controller-manager') }
end
end
16 changes: 16 additions & 0 deletions spec/classes/kubernetes_master_scheduler_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'spec_helper'

describe 'kubernetes::master::scheduler' do
context 'with defaults for all parameters on RedHat' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'RedHat',
}
end
it { is_expected.to compile.with_all_deps }
it { should contain_class('kubernetes::master') }
it { should contain_package('kubernetes-master').with_ensure('present') }
it { should contain_service('kube-scheduler') }
end
end
15 changes: 15 additions & 0 deletions spec/classes/kubernetes_master_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'spec_helper'

describe 'kubernetes::master' do
context 'with defaults for all parameters on RedHat' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'RedHat',
}
end
it { is_expected.to compile.with_all_deps }
it { should contain_class('kubernetes::master') }
it { should contain_package('kubernetes-master').with_ensure('present') }
end
end
16 changes: 16 additions & 0 deletions spec/classes/kubernetes_node_kube_proxy_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'spec_helper'

describe 'kubernetes::node::kube_proxy' do
context 'with defaults for all parameters on RedHat' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'RedHat',
}
end
it { is_expected.to compile.with_all_deps }
it { should contain_class('kubernetes::node') }
it { should contain_package('kubernetes-node').with_ensure('present') }
it { should contain_service('kube-proxy') }
end
end
16 changes: 16 additions & 0 deletions spec/classes/kubernetes_node_kubelet_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'spec_helper'

describe 'kubernetes::node::kubelet' do
context 'with defaults for all parameters on RedHat' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'RedHat',
}
end
it { is_expected.to compile.with_all_deps }
it { should contain_class('kubernetes::node') }
it { should contain_package('kubernetes-node').with_ensure('present') }
it { should contain_service('kubelet') }
end
end
15 changes: 15 additions & 0 deletions spec/classes/kubernetes_node_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'spec_helper'

describe 'kubernetes::node' do
context 'with defaults for all parameters on RedHat' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'RedHat',
}
end
it { is_expected.to compile.with_all_deps }
it { should contain_class('kubernetes::node') }
it { should contain_package('kubernetes-node').with_ensure('present') }
end
end
14 changes: 14 additions & 0 deletions spec/classes/kubernetes_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'spec_helper'

describe 'kubernetes' do
context 'with defaults for all parameters on RedHat' do
let :facts do
{
:kernel => 'Linux',
:osfamily => 'RedHat',
}
end
it { is_expected.to compile.with_all_deps }
it { should contain_class('kubernetes') }
end
end

0 comments on commit cf78ab8

Please sign in to comment.