summaryrefslogtreecommitdiff
path: root/spec/unit/provider/zone/solaris_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2014-01-06(PUP-716) Fix up tests after FileSystem API change (unit/provider)Henrik Lindberg1-1/+1
Still one test failing on expectation
2013-11-08(#19447) Puppet::FileSystem::File.exist?Ethan J. Brown1-1/+1
- All previous File and FileTest calls to exist? or exists? go through the new FileSystem::File abstraction so that the implementation can later be swapped for a Windows specific one to support symlinks
2012-09-26(Maint) Remove rspec from shebang lineJeff McCune1-1/+1
Without this patch Ruby 1.9 is still complaining loudly about trying to parse the spec files. The previous attempt to clean up this problem in edc3ddf works for Ruby 1.8 but not 1.9. I'd prefer to remove the shebang lines entirely, but doing so will cause encoding errors in Ruby 1.9. This patch strives for a happy middle ground of convincing Ruby it is actually working with Ruby while not confusing it to think it should exec() to rspec. This patch is the result of the following command run against the source tree: find spec -type f -print0 | \ xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
2012-09-19(maint) use described_class.new for getting the provider instance.rahul1-1/+1
Earlier, the provider was instanciated with resource.provider but the correct style of instanciation is described_class.new(resource)
2012-08-29(#15886) commit the complete commands at the end.rahul1-6/+36
Previously, the provider was applying the setconfig commands as soon as it was called. This caused problems when the commands that were being called needed to be called in a transactional manner (i.e eth,exclusive -> eth:ip,shared). This uses flush to pass the required commands at once through a pipe to zonecfg rather than do it one at a time.
2012-08-29(#15886) remove ZoneConfig and ZoneMultiConfigrahul1-1/+27
Remove the zone specific properties from types, and move their handling to the provider. This is done so that we can avoid stepping on the toes of puppet core and override methods that have default behaviors except when necessary. The zone type is also more cleaned up so that it can serve as a base for other container implementations. Type: the properties that earlier relied on ZoneMultiConfigProperty are now moved to Puppet::Property::List. The methods should and insync? are added to override the behaviors in the parent methods. The should method in parent joins the array values together before comparison. However, we do not want this behavior, and instead want it to remain as an array. Hence we override should. We also override insync? which uses should in parent for the same reason. Provider: the def_prop and def_multiprop now handles the definition of properties. They add the methods prop(), prop=(), and prop_conf() to each properties that the provider provides. The prop_conf() method is needed for getting the text to send to zonecfg on configure.
2012-08-29(Maint) simplify line2hash, ensure iptype exclusive property is correctrahul1-0/+14
Updated line2hash so that the method is succinct and simple, and added test cases for it.
2012-08-29(Maint) Type Zone : fix formatting, commentsrahul1-0/+33
Add comment explaining why ensure:retrieve is necessary, added the output of zone info to explain the regex, Fix format space, refactored global retrieve to make it simple and succinct, simplify autorequire(:zfs), setstatus, updated the regex in getconfig so that it matches the output better. Updated the test case for getconfig
2012-08-29(Maint) dont fail on path unless absolutely required.rahul1-1/+17
Previously, ensure=>running was required to specify the path. However, if the zone is already configured, we dont really need the path. This patch gets rid of that requirement. - adds spec tests for start.
2012-08-22(Maint) : fix the jenkins failure for setconfigrahul1-2/+2
Previously, the spec tests were failing because the exit status and output was not stubbed properly. This commit ensures that the values are stubbed properly.
2012-08-20(Maint) Update the test cases to use the 'let'rahul1-33/+55
Changes: - updated the invocations to use the new let(:xxx) syntax - move each test to method specific contexts - ensure that stubbed commands specify arguments (zoneadm) - add more tests
2012-07-02(maint) Standardize on /usr/bin/env ruby -S rspecJeff McCune1-1/+1
Without this patch some spec files are using `ruby -S rspec` and others are using `rspec`. We should standardize on a single form of the interpreter used for spec files. `ruby -S rspec` is the best choice because it correctly informs editors such as Vim with Syntastic that the file is a Ruby file rather than an Rspec file.
2011-04-13maint: clean up the spec test headers in bulk.Daniel Pittman1-2/+1
We now use a shebang of: #!/usr/bin/env rspec This enables the direct execution of spec tests again, which was lost earlier during the transition to more directly using the rspec2 runtime environment.
2011-04-08maint: just require 'spec_helper', thanks rspec2Daniel Pittman1-1/+1
rspec2 automatically sets a bunch of load-path stuff we were by hand, so we can just stop. As a side-effect we can now avoid a whole pile of stupid things to try and include the spec_helper.rb file... ...and then we can stop protecting spec_helper from evaluating twice, since we now require it with a consistent name. Yay. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
2010-12-06maint: Use expand_path when requiring spec_helper or puppettestMatt Robinson1-1/+1
Doing a require to a relative path can cause files to be required more than once when they're required from different relative paths. If you expand the path fully, this won't happen. Ruby 1.9 also requires that you use expand_path when doing these requires. Paired-with: Jesse Wolfe
2010-07-09Code smell: Two space indentationMarkus Roberts1-41/+41
Replaced 106806 occurances of ^( +)(.*$) with The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people who learned ruby in the 1900s) uses two-space indentation. 3 Examples: The code: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") becomes: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") The code: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object becomes: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object The code: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end becomes: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end
2010-06-28[#3994-part 3] rename spec tests from *_spec_spec to *_spec.rbMarkus Roberts1-0/+55
Part 2 re-did the change on the spec files, which it shouldn't have.
2010-06-28[#3994-part 2] rename integration tests to *_spec.rbMarkus Roberts1-55/+0
Some spec files like active_record.rb had names that would confuse the load path and get loaded instead of the intended implentation when the spec was run from the same directory as the file. Author: Matt Robinson <matt@puppetlabs.com> Date: Fri Jun 11 15:29:33 2010 -0700
2010-06-23[#3994] rename the specs to have _spec.rb at the endMarkus Roberts1-0/+55
Some spec files like active_record.rb had names that would confuse the load path and get loaded instead of the intended implentation when the spec was run from the same directory as the file. Author: Matt Robinson <matt@puppetlabs.com> Date: Fri Jun 11 15:29:33 2010 -0700