require 'spec_helper_system'

describe "param based tests:" do
  def pp(params)
    pm = <<-EOS
firewall { '100 test':
    EOS

    params.each do |k,v| 
      pm += <<-EOS
  #{k} => #{v},
      EOS
    end

    pm += <<-EOS
}
    EOS
    pm
  end

  [
    {
      'table' => "'raw'",
      'socket' => 'true',
      'chain' => "'PREROUTING'",
    },
  ].each do |param|
    it 'test param' do
      iptables_flush_all_tables

      ppm = pp(param)
      puppet_apply(ppm) do |r|
        r[:stderr].should == ''
        r[:exit_code].should == 2
      end

      # check idempotency
      puppet_apply(ppm) do |r|
        r[:stderr].should == ''
        r[:exit_code].should == 0
      end
    end
  end

end

require 'spec_helper_system'

describe "param based tests:" do
  def pp(params)
    pm = <<-EOS
firewall { '100 test':
    EOS

    params.each do |k,v| 
      pm += <<-EOS
  #{k} => #{v},
      EOS
    end

    pm += <<-EOS
}
    EOS
    pm
  end

  [
    {
      'table' => "'raw'",
      'socket' => 'true',
      'chain' => "'PREROUTING'",
    },
  ].each do |param|
    pending 'test param' do
      iptables_flush_all_tables

      ppm = pp(param)
      puppet_apply(ppm) do |r|
        r[:stderr].should == ''
        r[:exit_code].should == 2
      end

      # check idempotency
      puppet_apply(ppm) do |r|
        r[:stderr].should == ''
        r[:exit_code].should == 0
      end
    end
  end

end

Make param test pending due to rhel5 failures
Make param test pending due to rhel5 failures

Signed-off-by: Ken Barber <470bc578162732ac7f9d387d34c4af4ca6e1b6f7@bob.sh>
