inspec/lib/utils
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
..
command_wrapper.rb Address rubocop violations 2017-02-08 16:49:16 -06:00
convert.rb lint 2016-01-15 04:07:25 +01:00
database_helpers.rb oracle_session and mssql_session improvement (#1857) 2017-06-29 11:01:32 -04:00
erlang_parser.rb add rabbitmq config resource 2017-04-12 20:51:12 +02:00
filter.rb Address rubocop violations 2017-02-08 16:49:16 -06:00
filter_array.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
find_files.rb Add wildcard support to Utils::FindFiles (#2159) 2017-09-23 09:17:34 +02:00
hash.rb implement be_mounted.with for file resources 2016-01-03 00:03:24 +01:00
json_log.rb optimize json logger for line delimited JSON 2016-02-04 16:38:57 +01:00
latest_version.rb Avoid connection timeout of "inspec version" (#1538) 2017-03-06 09:23:42 -07:00
modulator.rb add author header 2015-10-06 18:55:44 +02:00
nginx_parser.rb add nginx_conf resource (#1889) 2017-06-26 06:37:41 -07:00
object_traversal.rb Support symbol keys in ObjectTraverser (#2221) 2017-10-06 19:24:31 +02:00
parser.rb mount resource: fix for Device-/Sharenames and Mountpoints including … (#2257) 2017-11-01 12:01:21 +01:00
plugin_registry.rb Address rubocop violations 2017-02-08 16:49:16 -06:00
simpleconfig.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
spdx.rb verifies that inspec.yml uses licenses in SPDX format 2017-05-31 00:21:05 -05:00
spdx.txt update unit tests 2017-05-31 00:21:05 -05:00