From fa982c9ba885e3b3ada031dbda1ca910458c6afa Mon Sep 17 00:00:00 2001 From: Saurabh Pandit Date: Thu, 10 Aug 2023 16:25:13 +0530 Subject: [PATCH] Added command to enable SSH for user if SSH is disabled --- acceptance/tests/resource/group/should_query_all.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/acceptance/tests/resource/group/should_query_all.rb b/acceptance/tests/resource/group/should_query_all.rb index 366f8c3f72a..237ef3e8b1a 100644 --- a/acceptance/tests/resource/group/should_query_all.rb +++ b/acceptance/tests/resource/group/should_query_all.rb @@ -1,5 +1,4 @@ test_name "should query all groups" -skip_test if agents.any? {|agent| agent['platform'] =~ /osx-12-arm64/ || agent['platform'] =~ /osx-13-arm64/ } # See PA-4555 tag 'audit:high', 'audit:refactor', # Use block style `test_name` @@ -9,6 +8,15 @@ skip_test('this test fails on windows French due to Cygwin/UTF Issues - PUP-8319,IMAGES-492') if agent['platform'] =~ /windows/ && agent['locale'] == 'fr' step "query natively" + # [PA-4555] Added below code to enable SSH permissions before test starts if they are disabled by default + on(agent, 'dscl . list /Groups | grep com.apple.access_ssh') do + stdout.each_line do |line| + if line =~ /com.apple.access_ssh-disabled/ + on(agent, 'dscl . change /Groups/com.apple.access_ssh-disabled RecordName com.apple.access_ssh-disabled com.apple.access_ssh') + end + end + end + groups = agent.group_list fail_test("No groups found") unless groups