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

#17692 IS_CLUSTER as env param to skip sync interface and number of nodes #90

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions spec/configuration/network_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
sync = command('ip addr show').stdout
it 'Have a network sync' do
interfaces_with_ip = sync.scan(/inet\s+(\d+\.\d+\.\d+\.\d+)/).flatten
expect(interfaces_with_ip.length).to be >= 3
if ENV['IS_CLUSTER']
expect(interfaces_with_ip.length).to be >= 3
else
skip 'One node does not need sync interface'
end
puts "OUTPUT: #{interfaces_with_ip}"
end
end
Expand Down Expand Up @@ -65,6 +69,10 @@
describe 'IPMI' do
ipmi_status = command('rpm -qa | grep ipmi').stdout
it 'Status IPMI' do
expect(ipmi_status).to include('ipmi')
if ENV['IS_CLUSTER']
expect(ipmi_status).to include('ipmi')
else
skip 'One node does not need IPMI'
end
end
end
6 changes: 5 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
set :backend, :ssh
set :disable_sudo, true

# spec/spec_helper.rb

# Check if IS_CLUSTER environment variable is already set
ENV['IS_CLUSTER'] ||= 'true' unless ENV.key?('IS_CLUSTER') && ENV['IS_CLUSTER'] == 'false'

# ssh setup
ENV['TARGET_HOST'] ||= '10.0.209.20'
host = ENV['TARGET_HOST']
Expand All @@ -19,5 +24,4 @@
else
ENV['LOGIN_PASSWORD'] || 'redborder'
end

set :ssh_options, options
Loading