diff --git a/CHANGELOG-0.4.md b/CHANGELOG-0.4.md index cab1692c3b..82ade67ce3 100644 --- a/CHANGELOG-0.4.md +++ b/CHANGELOG-0.4.md @@ -1,6 +1,6 @@ # Changelog 0.4 -## [0.4.4] 2020-04-xx +## [0.4.4] 2020-04-16 ### Fixed diff --git a/core/src/epicli/cli/version.txt.py b/core/src/epicli/cli/version.txt.py index 70d5b25fa8..b300caa32a 100644 --- a/core/src/epicli/cli/version.txt.py +++ b/core/src/epicli/cli/version.txt.py @@ -1 +1 @@ -0.4.3 \ No newline at end of file +0.4.4 \ No newline at end of file diff --git a/core/src/epicli/tests/serverspec-cli/spec/applications/applications_spec.rb b/core/src/epicli/tests/serverspec-cli/spec/applications/applications_spec.rb index d2a0864e05..fc143a25a3 100644 --- a/core/src/epicli/tests/serverspec-cli/spec/applications/applications_spec.rb +++ b/core/src/epicli/tests/serverspec-cli/spec/applications/applications_spec.rb @@ -4,10 +4,10 @@ require 'applications/auth-service/auth-service' -if !readDataYaml("configuration/applications")["specification"]["applications"].select {|i| i["name"] == 'rabbitmq' }.nil? +if !readDataYaml("configuration/applications")["specification"]["applications"].select {|i| i["name"] == 'rabbitmq' }.empty? callRabbitMQDeploymentTests end -if !readDataYaml("configuration/applications")["specification"]["applications"].select {|i| i["name"] == 'auth-service' }.nil? +if !readDataYaml("configuration/applications")["specification"]["applications"].select {|i| i["name"] == 'auth-service' }.empty? callAuthServiceDeploymentTests end diff --git a/core/src/epicli/tests/serverspec-cli/spec/filebeat/filebeat_spec.rb b/core/src/epicli/tests/serverspec-cli/spec/filebeat/filebeat_spec.rb index 84bbee8d38..d46b067208 100644 --- a/core/src/epicli/tests/serverspec-cli/spec/filebeat/filebeat_spec.rb +++ b/core/src/epicli/tests/serverspec-cli/spec/filebeat/filebeat_spec.rb @@ -35,7 +35,7 @@ end end -if count_inventory_roles("elasticsearch") > 0 +if countInventoryHosts("elasticsearch") > 0 describe 'Checking the connection to the Elasticsearch host' do let(:disable_sudo) { false } describe command("curl -o /dev/null -s -w '%{http_code}' $(awk '/- Elasticsearch output -/,/- Logstash output -/' /etc/filebeat/filebeat.yml \ @@ -47,7 +47,7 @@ end end -if count_inventory_roles("kibana") > 0 +if countInventoryHosts("kibana") > 0 describe 'Checking the connection to the Kibana endpoint' do let(:disable_sudo) { false } describe command("curl -o /dev/null -s -w '%{http_code}' $(awk '/= Kibana =/,/= Elastic Cloud =/' /etc/filebeat/filebeat.yml \ diff --git a/core/src/epicli/tests/serverspec-cli/spec/jmx_exporter/jmx_exporter_spec.rb b/core/src/epicli/tests/serverspec-cli/spec/jmx_exporter/jmx_exporter_spec.rb index 86efcd8689..ac8f441311 100644 --- a/core/src/epicli/tests/serverspec-cli/spec/jmx_exporter/jmx_exporter_spec.rb +++ b/core/src/epicli/tests/serverspec-cli/spec/jmx_exporter/jmx_exporter_spec.rb @@ -38,13 +38,13 @@ end end -if count_inventory_roles("kafka") == 1 +if countInventoryHosts("kafka") == 1 describe 'Checking if it is possible to collect any jvm metrics' do describe command("curl -s #{jmx_exporter_host}:#{jmx_exporter_port_for_zookeeper} | grep -i ^jvm_memory") do its(:exit_status) { should eq 0 } end end -elsif count_inventory_roles("kafka") > 1 +elsif countInventoryHosts("kafka") > 1 describe 'Checking if it is possible to collect the metrics from ZooKeeper' do describe command("curl -s #{jmx_exporter_host}:#{jmx_exporter_port_for_zookeeper} | grep -i ^zookeeper") do its(:stdout) { should match /zookeeper/ } diff --git a/core/src/epicli/tests/serverspec-cli/spec/kafka/kafka_spec.rb b/core/src/epicli/tests/serverspec-cli/spec/kafka/kafka_spec.rb index 031711001e..00bb79f39c 100644 --- a/core/src/epicli/tests/serverspec-cli/spec/kafka/kafka_spec.rb +++ b/core/src/epicli/tests/serverspec-cli/spec/kafka/kafka_spec.rb @@ -42,14 +42,14 @@ describe 'Checking if the number of Kafka brokers is the same as indicated in the inventory file' do describe command("echo 'dump' | curl -s telnet://#{zookeeper_host}:#{zookeeper_client_port} | grep -c brokers") do it "is expected to be equal" do - expect(subject.stdout.to_i).to eq count_inventory_roles("kafka") + expect(subject.stdout.to_i).to eq countInventoryHosts("kafka") end end end describe 'Checking the possibility of creating a topic, producing and consuming messages' do - kafka_brokers_count = count_inventory_roles("kafka") + kafka_brokers_count = countInventoryHosts("kafka") timestamp = DateTime.now.to_time.to_i.to_s topic_name = 'topic' + timestamp partitions = kafka_brokers_count*3 diff --git a/core/src/epicli/tests/serverspec-cli/spec/kibana/kibana_spec.rb b/core/src/epicli/tests/serverspec-cli/spec/kibana/kibana_spec.rb index 736213f9ee..2c3acebec2 100644 --- a/core/src/epicli/tests/serverspec-cli/spec/kibana/kibana_spec.rb +++ b/core/src/epicli/tests/serverspec-cli/spec/kibana/kibana_spec.rb @@ -48,7 +48,7 @@ end end -if count_inventory_roles("elasticsearch") > 0 +if countInventoryHosts("elasticsearch") > 0 describe 'Checking the connection to the Elasticsearch host' do let(:disable_sudo) { false } describe command("curl -o /dev/null -s -w '%{http_code}' $(grep -oP '(?<=elasticsearch.url: \\\").*(?=\\\")' /etc/kibana/kibana.yml)") do diff --git a/core/src/epicli/tests/serverspec-cli/spec/kubernetes_master/kubernetes_master_spec.rb b/core/src/epicli/tests/serverspec-cli/spec/kubernetes_master/kubernetes_master_spec.rb index 33d8d6f3ca..d98bf71005 100644 --- a/core/src/epicli/tests/serverspec-cli/spec/kubernetes_master/kubernetes_master_spec.rb +++ b/core/src/epicli/tests/serverspec-cli/spec/kubernetes_master/kubernetes_master_spec.rb @@ -39,14 +39,14 @@ describe 'Checking if there are any pods that have status other than Running' do describe command('kubectl get pods --all-namespaces --field-selector=status.phase!=Running') do its(:stdout) { should match /^$/ } - its(:stderr) { should match /No resources found./ } + its(:stderr) { should match /No resources found/ } end end describe 'Checking if the number of master nodes is the same as indicated in the inventory file' do describe command('kubectl get nodes --selector=node-role.kubernetes.io/master --no-headers | wc -l | tr -d "\n"') do it "is expected to be equal" do - expect(subject.stdout.to_i).to eq count_inventory_roles("kubernetes_master") + expect(subject.stdout.to_i).to eq countInventoryHosts("kubernetes_master") end end end @@ -54,7 +54,7 @@ describe 'Checking if the number of worker nodes is the same as indicated in the inventory file' do describe command('kubectl get nodes --no-headers | grep -v master | wc -l | tr -d "\n"') do it "is expected to be equal" do - expect(subject.stdout.to_i).to eq count_inventory_roles("kubernetes_node") + expect(subject.stdout.to_i).to eq countInventoryHosts("kubernetes_node") end end end @@ -174,3 +174,18 @@ end end end + +if countInventoryHosts("kubernetes_node") == 0 + + describe 'Checking taints on Kubernetes master' do + describe command('kubectl get nodes -o jsonpath="{.items[*].spec.taints}"') do + its(:stdout) { should match /^$/ } + its(:exit_status) { should eq 0 } + end + describe command('kubectl describe nodes | grep -i taints') do + its(:stdout) { should match // } + its(:exit_status) { should eq 0 } + end + end + +end \ No newline at end of file diff --git a/core/src/epicli/tests/serverspec-cli/spec/postgresql/postgresql_spec.rb b/core/src/epicli/tests/serverspec-cli/spec/postgresql/postgresql_spec.rb index 05ee6524ef..0bb92edf34 100644 --- a/core/src/epicli/tests/serverspec-cli/spec/postgresql/postgresql_spec.rb +++ b/core/src/epicli/tests/serverspec-cli/spec/postgresql/postgresql_spec.rb @@ -63,6 +63,16 @@ def queryForDropping end end +# Running the 'systemctl is-active' command returns the result 'unknown'. +# https://bugzilla.redhat.com/show_bug.cgi?id=1073481 +# Must first run the 'systemctl status' command to be able to view the service status withe the 'is-active' command. + +describe 'Checking PostgreSQL service status' do + describe command("systemctl status postgresql > /dev/null") do + its(:exit_status) { should eq 0 } + end +end + describe 'Checking if PostgreSQL service is running' do describe service('postgresql') do it { should be_enabled } diff --git a/core/src/epicli/tests/serverspec-cli/spec/spec_helper.rb b/core/src/epicli/tests/serverspec-cli/spec/spec_helper.rb index 03c841071b..95cd5f0587 100644 --- a/core/src/epicli/tests/serverspec-cli/spec/spec_helper.rb +++ b/core/src/epicli/tests/serverspec-cli/spec/spec_helper.rb @@ -39,7 +39,7 @@ # Set PATH # set :path, '/sbin:/usr/local/sbin:$PATH' - def count_inventory_roles(role) + def countInventoryHosts(role) file = File.open(ENV['inventory'], "rb") input = file.read file.close