0

How do I write a test on Linux system meets minimum kernel version of 2.6.20 or greater inside the following file?

spec/unit.recipes/default_spec.rb

shalamus
  • 2,192
  • 1
  • 12
  • 8

2 Answers2

1

ChefSpec isn't used for things like this, it doesn't know anything about actual systems. It just runs your recipe code in an abstract no-op-y kind of way. Most Chef users neither need nor should use ChefSpec, it's for stupidly complex cookbooks mostly, like the kind released to the community.

coderanger
  • 52,400
  • 4
  • 52
  • 75
0

You should use an integration testing tool like test kitchen for that since chefspec doesn't run on a actual machine where as kitchen tests does. You can use either serverspec or inspec as your testing framework. Refer https://docs.chef.io/kitchen.html

slashpai
  • 1,141
  • 7
  • 12