control 'control_name' do
  title 'Description'
  attribute_file = '/tmp/kitchen/node_attributes.json'
  if file(attribute_file).exist?
    node = json(attribute_file).params
    ## Your code here

    ## To access node attributes you can use now node['default']['attribute_name']

    ## For using data bags
    #data_bag_path = 'chef_repo/data_bags/secrets/jenkins_slave_ssh_private_key.json'
    #data_bag_item = JSON.parse(File.read(data_bag_path)).to_hash

    #private_key = data_bag_item['key']

    #######
    ##example for git repository
    #######
    parsley_url = 'git@github.com:/theorchard/parsley.git'
    describe file("#{fabric_home_dir}/parsley/.git/config") do
      it { should exist }
      its('owner') { should eq fabric_user }
      its('group') { should eq fabric_user }
      its('content') { should match(/url = #{parsley_url}/) }
    end

    #################
    # For template checks
    ################
    require 'erb'
    template = File.read('templates/default/journald.conf.erb')
    node['journald'] = node['default']['journald']
    rendered_content = ERB.new(template).result(binding)
    describe file '/etc/systemd/journald.conf' do
      it { should exist }
      its('content') { should eq rendered_content }
    end

  else
    puts "File #{attribute_file} does not exist, skiping attribute-depending checks"
  end
end
