summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-06-21 14:22:44 -0700
committerdanielsdeleo <dan@opscode.com>2013-06-21 14:24:11 -0700
commitc11011b8ea5f6aed8a3028885205ca4361d3682c (patch)
tree26f912e3184fc289aa6b667f82882c4758fa29b8
parent3b4c25fd2c619075e0d615af0e843b98db9a1817 (diff)
downloadchef-c11011b8ea5f6aed8a3028885205ca4361d3682c.tar.gz
Skip test for username with quote where unsupported.
Only debian-based platforms appear to support usernames with single quote characters, so skip this test on other platforms.
-rw-r--r--spec/functional/resource/user_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/functional/resource/user_spec.rb b/spec/functional/resource/user_spec.rb
index 5d627e3c77..4544572a6a 100644
--- a/spec/functional/resource/user_spec.rb
+++ b/spec/functional/resource/user_spec.rb
@@ -49,6 +49,9 @@ describe Chef::Resource::User, :unix_only, :requires_root do
File.open("/etc/shadow") {|f| f.read }
end
+ def supports_quote_in_username?
+ OHAI_SYSTEM["platform_family"] == "debian"
+ end
before do
# Silence shell_out live stream
@@ -134,6 +137,14 @@ describe Chef::Resource::User, :unix_only, :requires_root do
# default algorithm for the definition of the user's home directory.
context "and the username contains a single quote" do
+ let(:skip) do
+ if supports_quote_in_username?
+ false
+ else
+ "Platform #{OHAI_SYSTEM["platform"]} not expected to support username w/ quote"
+ end
+ end
+
let(:username) { "t'bilisi" }
it "ensures the user exists" do