Last active
November 18, 2015 00:43
-
-
Save 1tylermitchell/3877b5b9f50be29f9430 to your computer and use it in GitHub Desktop.
Serverspec check Hadoop conf xml file (ruby)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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