Skip to content

Commit

Permalink
Add tests for kubernetes namespace creation and deletion (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: przemyslavic
  • Loading branch information
atsikham authored Oct 21, 2021
1 parent d6d1965 commit 441fb25
Showing 1 changed file with 18 additions and 0 deletions.
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

0 comments on commit 441fb25

Please sign in to comment.