<commit_before>require 'spec_helper'

describe user('gerrit') do
    it {
        should exist 
        should belong_to_group 'gerrit'
        should have_home_directory '/home/gerrit'
        should have_login_shell '/bin/bash'
    }
end

describe package('openjdk-7-jre') do
    it { should be_installed }
end

describe file('/home/gerrit/site_path') do
    it {
        should be_directory
        should be_owned_by 'gerrit' 
    }
end

describe file('/home/gerrit/site_path/etc') do
    it {
        should be_directory
        should be_owned_by 'gerrit'
    }
end

describe file('/home/gerrit/site_path/bin') do
    it {
        should be_directory
        should be_owned_by 'gerrit'
    }
end

describe file('/home/gerrit/site_path/static') do
    it {
        should be_directory
        should be_owned_by 'gerrit'
    }
end

describe file('/home/gerrit/site_path/hooks') do
    it {
        should be_directory
        should be_owned_by 'gerrit'
    }
end

describe file('/home/gerrit/site_path/lib') do
    it {
        should be_directory
        should be_owned_by 'gerrit'
    }
end

describe file('/home/gerrit/site_path/etc/gerrit.config') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '644'
    }
end

describe file('/home/gerrit/site_path/etc/secure.config') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '600'
    }
end

describe file('/home/gerrit/site_path/etc/ssh_host_rsa_key') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '600'
    }
end

describe file('/home/gerrit/site_path/etc/ssh_host_rsa_key.pub') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '644'
    }
end

describe file('/root/gerrit-firstuser-init.sql') do
    it {
        should be_file
        should be_mode '644'
    }
end

describe file('/root/gerrit-firstuser-init.sh') do
    it {
        should be_file
        should be_mode '700'
    }
end

describe file('/root/gerrit-set-default-acl.sh') do
     it {
        should be_file
        should be_mode '700'
    }
end

describe file('/root/gerrit-set-jenkins-user.sh') do
    it {
        should be_file
        should be_mode '700'
    }
end


describe file('/home/gerrit/gerrit.war') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '644'
    }
end

describe file('/home/gerrit/site_path/lib/mysql-connector-java-5.1.21.jar') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
    }
end
  
describe file('/home/gerrit/site_path/lib/bcprov-jdk16-144.jar') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
    }
end

describe file('/etc/init.d/gerrit') do
    it {
        should be_linked_to '/home/gerrit/site_path/bin/gerrit.sh'
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
    }
end

describe file('/etc/default/gerritcodereview') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '444'
        should contain 'GERRIT_SITE=/home/gerrit/site_path'
    }
end

describe service('gerrit') do
  it { should be_enabled }
end<commit_msg>Fix serverspec tests<commit_after>require 'spec_helper'

describe user('gerrit') do
    it {
        should exist 
        should belong_to_group 'gerrit'
        should have_home_directory '/home/gerrit'
        should have_login_shell '/bin/bash'
    }
end

describe package('openjdk-7-jre') do
    it { should be_installed }
end

describe file('/home/gerrit/site_path') do
    it {
        should be_directory
        should be_owned_by 'gerrit' 
    }
end

describe file('/home/gerrit/site_path/etc') do
    it {
        should be_directory
        should be_owned_by 'gerrit'
    }
end

describe file('/home/gerrit/site_path/bin') do
    it {
        should be_directory
        should be_owned_by 'gerrit'
    }
end

describe file('/home/gerrit/site_path/static') do
    it {
        should be_directory
        should be_owned_by 'gerrit'
    }
end

describe file('/home/gerrit/site_path/hooks') do
    it {
        should be_directory
        should be_owned_by 'gerrit'
    }
end

describe file('/home/gerrit/site_path/lib') do
    it {
        should be_directory
        should be_owned_by 'gerrit'
    }
end

describe file('/home/gerrit/site_path/etc/gerrit.config') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '644'
    }
end

describe file('/home/gerrit/site_path/etc/secure.config') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '600'
    }
end

describe file('/home/gerrit/site_path/etc/ssh_host_rsa_key') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '600'
    }
end

describe file('/home/gerrit/site_path/etc/ssh_host_rsa_key.pub') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '644'
    }
end

describe file('/root/gerrit-firstuser-init.sql') do
    it {
        should be_file
        should be_mode '644'
    }
end

describe file('/root/gerrit-firstuser-init.sh') do
    it {
        should be_file
        should be_mode '700'
    }
end

describe file('/root/gerrit-set-default-acl.sh') do
     it {
        should be_file
        should be_mode '700'
    }
end

describe file('/root/gerrit-set-jenkins-user.sh') do
    it {
        should be_file
        should be_mode '700'
    }
end


describe file('/home/gerrit/gerrit.war') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '644'
    }
end

describe file('/home/gerrit/site_path/lib/mysql-connector-java-5.1.21.jar') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
    }
end
  
describe file('/home/gerrit/site_path/lib/bcprov-jdk16-144.jar') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
    }
end

describe file('/etc/init.d/gerrit') do
    it {
        should be_linked_to '/home/gerrit/site_path/bin/gerrit.sh'
        should be_mode '777'
    }
end

describe file('/etc/default/gerritcodereview') do
    it {
        should be_file
        should be_owned_by 'gerrit'
        should be_grouped_into 'gerrit'
        should be_mode '444'
        should contain 'GERRIT_SITE=/home/gerrit/site_path'
    }
end

describe service('gerrit') do
  it { should be_enabled }
end
{'fraction_non_alphanumeric': 0.09273395532937517, 'fraction_numerical': 0.011733107152954482, 'mean_word_length': 2.2724329324699353, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4108199', 'n_tokens_mistral': 2624, 'n_tokens_neox': 2411, 'n_words': 540}