From a0fd5fe2ace7968e3ab43ebf6559ff9c334a4f6d Mon Sep 17 00:00:00 2001 From: vimesa Date: Tue, 30 Jan 2024 09:29:08 +0000 Subject: [PATCH 1/3] Add motd test --- Rakefile | 9 +-------- spec/configuration/motd_spec.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 spec/configuration/motd_spec.rb diff --git a/Rakefile b/Rakefile index 8fabb29..cfb21bf 100644 --- a/Rakefile +++ b/Rakefile @@ -35,18 +35,11 @@ namespace :spec do t.pattern = 'spec/services/*_spec.rb' t.rspec_opts = '--format documentation' # O "--format progress" end - + desc 'run monitor tests' RSpec::Core::RakeTask.new(:monitor_cluster) do |t| puts "Running Monitor tests on #{host} ..." t.pattern = 'spec/modules/monitor/*_spec.rb' t.rspec_opts = '--format documentation' # O "--format progress" end - - desc 'run configuration tests' - RSpec::Core::RakeTask.new(:configuration) do |t| - puts "Running configuration tests on #{host} ..." - t.pattern = 'spec/configuration/*_spec.rb' - t.rspec_opts = '--format documentation' # O "--format progress" - end end diff --git a/spec/configuration/motd_spec.rb b/spec/configuration/motd_spec.rb new file mode 100644 index 0000000..67ca650 --- /dev/null +++ b/spec/configuration/motd_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'spec_helper' +set :os, family: 'redhat', release: '9', arch: 'x86_64' + +# Verificar que existe un script MOTD en el sistema +describe file('/usr/lib/redborder/bin/motd') do + it { should exist } + it { should be_executable } +end + +# Verificar la existencia del archivo MOTD en /etc/motd y su contenido +describe file('/etc/motd') do + it { should exist } + its('content') { should match(/.*redborder-repo.*/) } +end From 700128fd453727f83b4d05a66316026138472a5d Mon Sep 17 00:00:00 2001 From: Rafael Gomez Date: Wed, 4 Dec 2024 14:13:13 +0000 Subject: [PATCH 2/3] Remove empty line --- Rakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Rakefile b/Rakefile index aff7ca7..412677f 100644 --- a/Rakefile +++ b/Rakefile @@ -36,7 +36,6 @@ namespace :spec do t.rspec_opts = '--format documentation' # O "--format progress" end - desc 'run monitor tests' RSpec::Core::RakeTask.new(:monitor_cluster) do |t| puts "Running Monitor tests on #{host} ..." From db72f30eca61a3db17d3fa1ed2bd07d86c09c9a0 Mon Sep 17 00:00:00 2001 From: Rafael Gomez Date: Wed, 4 Dec 2024 14:20:56 +0000 Subject: [PATCH 3/3] Add user test --- Rakefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Rakefile b/Rakefile index 412677f..fdc75d1 100644 --- a/Rakefile +++ b/Rakefile @@ -42,4 +42,11 @@ namespace :spec do t.pattern = 'spec/modules/monitor/*_spec.rb' t.rspec_opts = '--format documentation' # O "--format progress" end + + desc 'run user tests' + RSpec::Core::RakeTask.new(:users) do |t| + puts "Running user tests on #{host} ..." + t.pattern = 'spec/users/*_spec.rb' + t.rspec_opts = '--format documentation' # O "--format progress" + end end