summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantima-gupta <agupta@msystechnologies.com>2020-08-28 18:07:41 +0530
committerantima-gupta <agupta@msystechnologies.com>2020-08-28 18:07:41 +0530
commit4e6234d500475ec772ae2f7d81bfb91067b4a12c (patch)
treece5d60b4011beb0ee4f30d852c73a6feb2da02a8
parentd0764e7849a69f5ce9b0a7bf24a7c0263a9f2c8e (diff)
downloadchef-4e6234d500475ec772ae2f7d81bfb91067b4a12c.tar.gz
removed unnecessary 'ostruct' from linux mount provider spec.
Added permalink for Regex. Renamed the linux_mount recipe file to mount in kitechen-tests. Signed-off-by: antima-gupta <agupta@msystechnologies.com>
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/_mount.rb (renamed from kitchen-tests/cookbooks/end_to_end/recipes/_linux_mount.rb)0
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/linux.rb2
-rw-r--r--lib/chef/provider/mount/linux.rb3
-rw-r--r--spec/unit/provider/mount/linux_spec.rb1
4 files changed, 4 insertions, 2 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_linux_mount.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_mount.rb
index 207ef9d1fb..207ef9d1fb 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/_linux_mount.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/_mount.rb
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb b/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb
index bb94fb88d1..ba1f5e84f7 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb
@@ -122,7 +122,7 @@ include_recipe "::_cron"
include_recipe "::_ohai_hint"
include_recipe "::_openssl"
include_recipe "::_tests"
-include_recipe "::_linux_mount"
+include_recipe "::_mount"
# at the moment these do not run properly in docker
# we need to investigate if this is a snap on docker issue or a chef issue
diff --git a/lib/chef/provider/mount/linux.rb b/lib/chef/provider/mount/linux.rb
index 919ca118bf..3199024f1b 100644
--- a/lib/chef/provider/mount/linux.rb
+++ b/lib/chef/provider/mount/linux.rb
@@ -41,12 +41,15 @@ class Chef
shell_out!("findmnt -rn").stdout.each_line do |line|
case line
+ # Permalink for device already mounted to mount point for : https://rubular.com/r/L0RNnD4gf2DJGl
when /\A#{Regexp.escape(real_mount_point)}\s+#{device_mount_regex}\s/
mounted = true
logger.trace("Special device #{device_logstring} mounted as #{real_mount_point}")
+ # Permalink for multiple devices mounted to the same mount point(i.e. '/proc') https://rubular.com/r/a356yzspU7N9TY
when %r{\A#{Regexp.escape(real_mount_point)}\s+([/\w])+\s}
mounted = false
logger.trace("Special device #{$~[1]} mounted as #{real_mount_point}")
+ # Permalink for bind device mounted to an existing mount point: https://rubular.com/r/QAE0ilL3sm3Ldz
when %r{\A#{Regexp.escape(real_mount_point)}\s+([/\w])+\[#{device_mount_regex}\]\s}
mounted = true
logger.trace("Bind device #{device_logstring} mounted as #{real_mount_point}")
diff --git a/spec/unit/provider/mount/linux_spec.rb b/spec/unit/provider/mount/linux_spec.rb
index e6d903dffc..1141175780 100644
--- a/spec/unit/provider/mount/linux_spec.rb
+++ b/spec/unit/provider/mount/linux_spec.rb
@@ -1,5 +1,4 @@
require "spec_helper"
-require "ostruct"
describe Chef::Provider::Mount::Linux do