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

Bugfix/#16981 wakeup chef script status #71

Merged
merged 6 commits into from
Jun 13, 2024
Merged
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ On your workstation, execute the following command in your terminal:
```ssh
bundle install
```
Also make sure to share your public ssh key to target machine:
```
ssh-copy-id root@<target_ip>
```

## Running Tests
To run all tests, use the following command:
Expand Down
18 changes: 18 additions & 0 deletions spec/configuration/chef_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

require 'spec_helper'
set :os, family: 'redhat', release: '9', arch: 'x86_64'

describe file('/usr/lib/redborder/bin/rb_wakeup_chef.sh'), :rb_wakeup_chef do
it { should exist }
it { should be_file }
it { should be_executable.by_user('webui') }
end

describe 'Checking WakeUpClusterJob' do
query_psql = "echo \"SELECT * FROM stored_delayed_jobs WHERE job='RbWakeupChefClusterJob';\" | rb_psql redborder"
describe command(query_psql) do
its(:exit_status) { should eq 0 }
its(:stdout) { should_not match(/Errno::EACCES: Permission denied/) }
end
end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
set :disable_sudo, true

# ssh setup
host = ENV['TARGET_HOST'] || '10.1.209.20'
host = ENV['TARGET_HOST'] || '10.0.209.20'
options = Net::SSH::Config.for(host)
set :host, options[:host_name] || host
options[:user] ||= ENV['LOGIN_USERNAME'] || 'root'
Expand Down
Loading