inspec/lib
Markus Grobelin 221db7e132 mount resource: fix for Device-/Sharenames and Mountpoints including … (#2257)
* mount resource: fix for Device-/Sharenames and Mountpoints including whitespaces

Device-/Sharenames and Mountpoints on Linux may include whitespaces (\040), e.g. /etc/fstab entry like:

```//fileserver.corp.internal/Research\040&\040Development /mnt/Research\040&\040Development cifs OTHER_OPTS```

... results in a mount line like:

```//fileserver.corp.internal/Research & Development on /mnt/Research & Development type cifs (OTHER_OPTS)```

The Linux mount command replaces \040 with whitspace automatically, so this should be tributed.

I used a control like this:

```
    describe mount('/mnt/Research & Development') do
      it { should be_mounted }
      its('device') { should eq  '//fileserver.corp.internal/Research & Development' }
    end
```

Before:

```
  ×  whitespaces-1: Mount with whitespace within sharename and mountpoint. (1 failed)
     ✔  Mount /mnt/Research & Development should be mounted
     ×  Mount /mnt/Research & Development device should eq "//fileserver.corp.internal/Research & Development"

     expected: "//fileserver.corp.internal/Research & Development"
          got: "//fileserver.corp.internal/Research"

     (compared using ==)
```

After:

```
  ✔  whitespaces-01: Mount with whitespace within sharename and mountpoint.
     ✔  Mount /mnt/Research & Development should be mounted
     ✔  Mount /mnt/Research & Development device should eq "//fileserver.corp.internal/Research & Development"
```

Signed-off-by: Markus Grobelin <grobi@koppzu.de>

* mounts_with_whitespaces: make lint happy

Signed-off-by: Markus Grobelin <grobi@koppzu.de>

* mount resource: added parentheses as suggested by https://github.com/chef/inspec/pull/2257/files

Signed-off-by: Markus Grobelin <grobi@koppzu.de>

* mount resource: fix for Device-/Sharenames and Mountpoints including whitespaces
Signed-off-by: Markus Grobelin <grobi@koppzu.de>
2017-11-01 12:01:21 +01:00
..
bundles Force https scheme for inspec compliance login (#2268) 2017-10-27 10:32:52 +02:00
fetchers Don't send HTTP headers that have nil values (#1948) 2017-06-21 19:09:13 -05:00
inspec Bump version to 1.43.6 by Expeditor 2017-10-27 08:33:04 +00:00
matchers Enhance cmp matcher to work with symbols, fix file documentation (#2224) 2017-10-07 12:28:07 +02:00
resources cran resource: check for R module installation (#2255) 2017-10-25 16:14:29 +02:00
source_readers Source reader should not hand back files with nil contents (#2003) 2017-07-11 21:33:55 +02:00
utils mount resource: fix for Device-/Sharenames and Mountpoints including … (#2257) 2017-11-01 12:01:21 +01:00
inspec.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00