Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for kubernetes namespace creation and deletion #2

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/spec/spec/kubernetes_master/kubernetes_master_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,21 @@
its(:exit_status) { should eq 0 }
end
end

describe 'Check Kubernetes namespace creation and deletion' do
ns_name = 'ns-spectest'
describe command("kubectl create ns #{ns_name}") do
its(:stdout) { should match %r{namespace/#{ns_name} created} }
its(:exit_status) { should eq 0 }
end
describe command("kubectl get ns #{ns_name} -o json") do
its(:stdout_as_json) { should include('metadata' => include('name' => ns_name.to_s)) }
its(:stdout_as_json) { should include('status' => include('phase' => 'Active')) }
its(:exit_status) { should eq 0 }
end
describe command("kubectl delete ns #{ns_name} --timeout=1m") do
its(:stdout) { should match %r{namespace "#{ns_name}" deleted} }
its(:stderr) { should_not match %r{error}i }
its(:exit_status) { should eq 0 }
end
end