Skip to content

Instantly share code, notes, and snippets.

@raphink
Last active December 18, 2015 11:56
Show Gist options
  • Save raphink/4e74929c7926766089c2 to your computer and use it in GitHub Desktop.
Save raphink/4e74929c7926766089c2 to your computer and use it in GitHub Desktop.
Augeas serverspec resource type, using PoC at https://github.com/raphink/serverspec/compare/dev/augeas
describe augeas('/files/etc/fstab/*[file="/"]/vfstype') do
it { should match 1 }
its(:value) { should eq 'ext4' }
it { should have_node('../dump') }
end
Augeas "/files/etc/fstab/*[file="/"]/vfstype"
should match 1
should have node "../dump"
value
should eq "ext4"
@danieldreier
Copy link

this is awesome! I hope this makes it into serverspec.

@devops07
Copy link

Hi,

I tried the below configuration with serverspec test, seems serverspec doesn't support augeas

describe augeas('/files/etc/test.defs/test_value') do
it { should match 90 }
end

But getting below error
/etc/puppetlabs/puppet/modules/testmodule/spec/localhosts/testfile_spec:3:in <top (required)>': undefined methodaugeas' for main:Object (NoMethodError)

@devops07
Copy link

Any update on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment