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

Feature/#18556 user redborder ai add #103

Merged
merged 3 commits into from
Oct 1, 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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## redborder-serverspec-manager
Infrastructure integration testing for redborder-manager
Infrastructure integration testing for a redborder manager machine. The idea is to run the tests in a machine that is the validator local machine, so the target machine is affected by the tests.

## Installation
On your workstation, execute the following command in your terminal:
First, clone this repository on your workstation. Then install the gemes by executing this:
```ssh
bundle install
```
Also make sure to share your public ssh key to target machine:
Sometimes you need to make sure that you share your public ssh key to target machine:
```
ssh-copy-id root@<target_ip>
```
Expand All @@ -21,6 +21,7 @@ Optional parameters:
* TARGET_HOST: Machine where the tests will run via SSH.
* LOGIN_USERNAME: Username for SSH connection to the test machine.
* LOGIN_PASSWORD: Password for SSH connection to the test machine.
* IS_CLUSTER: Boolean to indicate if the target machine is a cluster.
* -j 10 -m: To run tests in pararell
Example with optional parameters:
```
Expand Down
12 changes: 12 additions & 0 deletions spec/users/redborder_ai_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

require 'spec_helper'
set :os, family: 'redhat', release: '9', arch: 'x86_64'
pkg = usr = 'redborder-ai'
describe user(usr) do
before(:all) do
skip("Package #{pkg} is not installed") unless package(pkg).installed?
end
it { should exist }
it { should have_login_shell('/sbin/nologin') }
end
6 changes: 4 additions & 2 deletions spec/users/users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
allowed_users = Set.new %w[root redborder postgres minio]
not_allowed_users = bash_users - allowed_users

it 'should only allow specified users to have login permissions' do
expect(not_allowed_users.to_a).to be_empty
describe 'users with login permissions' do
it 'should only allow specified users' do
expect(not_allowed_users.to_a).to be_empty, "Unexpected users with login permissions: #{not_allowed_users.to_a}"
end
end
end
Loading