We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84dff35 commit 5d91f45Copy full SHA for 5d91f45
1 file changed
default/serverspec/os_spec.rb
@@ -1,3 +1,11 @@
1
+# encoding: utf-8
2
+
3
+require 'spec_helper'
4
5
+RSpec.configure do |c|
6
+ c.filter_run_excluding skipOn: backend(Serverspec::Commands::Base).check_os[:family]
7
+end
8
9
# GIS: Req 3.21-4
10
describe command('find / -name \'.rhosts\' | wc -l ') do
11
its(:stdout) { should match(/^0/) }
@@ -93,5 +101,14 @@
93
101
end
94
102
95
103
96
-
97
-# trennen von sysctl und uid's mit einer map suchen
104
+# GIS: Req 3.21-16
105
+describe "Unique uid" do
106
+ it "check for unique uid's" do
107
+ actual = command('cat /etc/passwd | cut -d \':\' -f 3').stdout.split(/\r?\n/)
108
+ hm = actual.each_with_object(Hash.new(0)) { |d,counts| counts[d] += 1 }
109
+ hm.each do |k,v|
110
+ str = "User: UID #{k} instances: "
111
+ ("#{str}#{v}").should eq("#{str}1")
112
+ end
113
114
0 commit comments