diff --git a/README.md b/README.md index 8356f1d..ef87428 100644 --- a/README.md +++ b/README.md @@ -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@ ``` @@ -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: ``` diff --git a/spec/users/redborder_ai_spec.rb b/spec/users/redborder_ai_spec.rb new file mode 100644 index 0000000..4dbce7e --- /dev/null +++ b/spec/users/redborder_ai_spec.rb @@ -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 diff --git a/spec/users/users_spec.rb b/spec/users/users_spec.rb index f463521..0782fcf 100644 --- a/spec/users/users_spec.rb +++ b/spec/users/users_spec.rb @@ -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