Skip to content

Instantly share code, notes, and snippets.

@1tylermitchell
Last active November 18, 2015 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1tylermitchell/3877b5b9f50be29f9430 to your computer and use it in GitHub Desktop.
Save 1tylermitchell/3877b5b9f50be29f9430 to your computer and use it in GitHub Desktop.
Serverspec check Hadoop conf xml file (ruby)
require 'spec_helper'
require 'nokogiri'
describe file('/etc/hadoop/conf/hdfs-site.xml') do
it {should be_file}
it {should contain /dfs.datanode.max.transfer.threads/}
it do
doc = Nokogiri::XML(File.read("/etc/hadoop/conf/hdfs-site.xml"))
val=doc.xpath("//property[name='dfs.datanode.max.transfer.threads']/value").text.to_i
expect(val).to be >= 4096
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment