Sha256: a702ead21cc3b66881108e08f2948c74d6875789ed8acf8ecf261d7c43d47994

Contents?: true

Size: 1.17 KB

Versions: 56

Compression:

Stored size: 1.17 KB

Contents

require "mixlib/shellout"
require "bundler"

describe "Chef Fips Unit/Functional Specs" do
  def windows?
    if RUBY_PLATFORM =~ /mswin|mingw|windows/
      true
    else
      false
    end
  end

  let(:omnibus_root) do
    if windows?
      "c:/opscode/chef"
    else
      "/opt/chef"
    end
  end

  let(:env) do
    {
      "PATH" => [ "#{omnibus_root}/embedded/bin", ENV["PATH"] ].join(File::PATH_SEPARATOR),
      "BUNDLE_GEMFILE" => "#{omnibus_root}/Gemfile",
      "GEM_PATH" => nil, "GEM_CACHE" => nil, "GEM_HOME" => nil,
      "BUNDLE_IGNORE_CONFIG" => "true",
      "BUNDLE_FROZEN" => "1",
      "CHEF_FIPS" => "1"
    }
  end

  let(:chef_dir) do
    cmd = Mixlib::ShellOut.new("bundle show chef", env: env).run_command
    cmd.error!
    cmd.stdout.chomp
  end

  def run_rspec_test(test)
    Bundler.with_clean_env do
      cmd = Mixlib::ShellOut.new(
        "bundle exec rspec -f documentation -t ~requires_git #{test}",
        env: env, cwd: chef_dir, timeout: 3600
      )
      cmd.run_command.error!
    end
  end

  it "passes the unit specs" do
    run_rspec_test("spec/unit")
  end

  it "passes the functional specs" do
    run_rspec_test("spec/functional")
  end

end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
chef-12.22.5 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.22.5-universal-mingw32 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.22.3 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.22.3-universal-mingw32 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.31 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.31-universal-mingw32 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.26 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.26-universal-mingw32 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.20-universal-mingw32 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.20 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.14-universal-mingw32 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.14 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.12-universal-mingw32 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.12 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.10 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.10-universal-mingw32 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.4 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.4-universal-mingw32 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.1-universal-mingw32 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
chef-12.21.1 acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb