为团体写了一个inspec-test。这些组在bash上被分配给用户pi,但我从inspec-test获得了一个空数组。
这里是bash输出:
× users-1.0: Ensure users are known (1 failed)
✔ User pi should exist
✔ User pi group should eq "pi"
× User pi groups should eq ["pi", "sudo"]
expected: ["pi", "sudo"]
got: []
(compared using ==)
✔ User pi home should eq "/home/pi"
当我运行我的inspec时,我得到了这个:
users = {
:pi => {
:uname => 'pi',
:gname => 'pi',
:groups => [
'adm',
'dialout',
'sudo',
'www-data',
'video',
'users',
'docker',
'gpio'
],
:home => '/home/pi'
}
}
...
control 'users-1.0' do
impact 1.0
title 'Ensure users are known'
users.each do |key, value|
describe user(value[:uname]) do
it { should exist }
its('group') { should eq "#{value[:gname]}" }
its('groups') { should eq [ 'pi', 'sudo' ] }
its('home') { should eq "#{value[:home]}" }
#its('shell') { should eq '/bin/bash' }
#its('mindays') { should eq 0 }
#its('maxdays') { should eq 90 }
#its('warndays') { should eq 8 }
end
end
end
在我的rb文件中,我写了这个:
$("#tableInput").last().append('<tr><td></td></tr>');
我希望看到来自用户pi的一组群组。
我不知道如何开始搜索。我是一名新手。
由于