Serverspec new matchers: Part 2
Monday, Aug 18, 2014 17:37 · 244 words · 2 minutes read
Serverspec Series
In my previous blog post I have described the new matchers implemented for the iis_app_pool resource type. In this one I will show examples how to use the new ones for the iis_website and service, together with the two resource types: event_log and perf_counter.
iis_website
IIS Website resource type
have_site_bindings
In order to test the IIS website site bindings, you should use the have_site_bindings matcher.
You can give a protocol and chain them like this.
You could specify an IP Address and chain them like this.
or specify a host header
Note: All of the methods can be used together.
have_virtual_dir
In order to test the IIS website virtual directories, you should use the have_virtual_dir matcher.
You can give a path to the virtual directory name, like this.
have_site_application
In order to test the IIS website applications, you should use the have_site_application matcher.
Additionaly you can specify the application pool name, used by the application, and/or the physical path to it.
service
Service resource type.
have_path_name
In order to test the path to the executable, you should use the have_path_name matcher.
event_log
Windows eveng log resource type.
In order to test whether an event log exists, you should use exist matcher.
perf_counter
Performance counter resource type.
In order to test whether a performance counter category exists, you should use exist matcher.
You can specify counter name, like this.