Update integration test for remote management resource

This commit is contained in:
Jared Weyer 2023-03-09 09:36:03 -08:00
Родитель 8805405f21
Коммит 84ea8eb3ca
1 изменённых файлов: 18 добавлений и 26 удалений

Просмотреть файл

@ -1,31 +1,23 @@
title 'remote access'
# user_has_access = 1 << 31
text_messages = 1 << 0
control_observe = 1 << 1
send_files = 1 << 2
delete_files = 1 << 3
generate_reports = 1 << 4
open_quit_apps = 1 << 5
change_settings = 1 << 6
restart_shutdown = 1 << 7
# observe_only = 1 << 8
show_observe = 1 << 30
all_privileges = text_messages | control_observe | send_files |
delete_files | generate_reports | open_quit_apps |
change_settings | restart_shutdown | show_observe
control 'remote-control' do
title 'ensure that remote access and control will function'
desc "ensure that the Remote Management plist grants local users access, that
all privileges are granted based on the mask #{all_privileges}, and that
remote control is enabled"
only_if { os.release < '20' } # remove prior to Big Sur public release
title 'ensure the correct configuration of ARD'
desc 'ensure that the ARD is enabled and configured to grant the correct privileges to the correct users'
describe command('/usr/libexec/PlistBuddy -c Print /Library/Preferences/com.apple.RemoteManagement.plist') do
its('stdout') { should match 'ARD_AllLocalUsers = true' }
its('stdout') { should match /#{all_privileges}/ }
describe command('/usr/bin/defaults read /Library/Preferences/com.apple.RemoteManagement') do
its('stdout') { should match /"ARD_AllLocalUsers" = 1/ }
end
describe command('/usr/bin/defaults read /Library/Preferences/com.apple.RemoteDesktop') do
its('stdout') { should match /Text1 = \w+/ }
its('stdout') { should match /Text2 = \w+/ }
its('stdout') { should match /Text3 = ""/ }
its('stdout') { should match /Text4 = ""/ }
end
if Chef::Version.new(os.release) >= Chef::Version.new('12.0.0')
describe command('sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/tccstate') do
its('stdout') { should match Regexp.new('<key>postEvent<\/key>.\s+<true\/>', Regexp::MULTILINE) }
its('stdout') { should match Regexp.new('<key>screenCapture<\/key>.\s+<true\/>', Regexp::MULTILINE) }
end
end
describe file('/Library/Application Support/Apple/Remote Desktop/RemoteManagement.launchd') do