1
Feature: Check file mode
3
In order to ensure that file and directory permissions are applied correctly
5
I want to identify where the mode may not be interpreted as expected
7
Scenario Outline: Specifying file mode
8
Given a <resource> resource declared with the mode <mode>
9
When I check the cookbook
10
Then the warning 006 should be <shown_where_invalid>
13
| resource | mode | shown_where_invalid |
14
| cookbook_file | "644" | valid |
15
| cookbook_file | 644 | invalid |
16
| cookbook_file | 00644 | valid |
17
| directory | 755 | invalid |
18
| directory | "755" | valid |
19
| directory | 0644 | valid |
20
| directory | "0644" | valid |
21
| directory | 400 | invalid |
22
| directory | 00400 | valid |
23
| file | "755" | valid |
24
| file | 755 | invalid |
25
| file | 644 | invalid |
26
| file | 044 | invalid |
27
| file | "0644" | valid |
28
| template | 00400 | valid |
29
| template | 400 | invalid |
30
| template | "400" | valid |
32
Scenario: Unspecified mode
33
Given a file resource declared without a mode
34
When I check the cookbook
35
Then the warning 006 should not be displayed