Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beaker tests for multiple nodes acceptance testing #66

Open
petems opened this issue Mar 26, 2015 · 2 comments
Open

Beaker tests for multiple nodes acceptance testing #66

petems opened this issue Mar 26, 2015 · 2 comments

Comments

@petems
Copy link
Member

petems commented Mar 26, 2015

Hi @arioch!

I remember you asking about how to write beaker specs for multiple nodes at the Puppet Contributor Summit, and I just figured out an example of how it could work:

Node set

HOSTS:
  master:
    roles:
      - default
      - master
    platform: el-6-x86_64
    box : centos-64-x64-vbox4210-nocm
    box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
    hypervisor : vagrant
  backup:
    roles:
      - default
      - backup
    platform: el-6-x86_64
    box : centos-64-x64-vbox4210-nocm
    box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
    hypervisor : vagrant
CONFIG:
 type: foss
require 'spec_helper_acceptance'

if hosts.length > 1
  describe "configuring multi-node keepalived" do
    let(:ipaddresses) do
      hosts_as('backup').inject({}) do |memo,host|
        memo[host] = fact_on host, "ipaddress_eth1"
        memo
      end
    end

    hosts_as('backup').each do |host|
      it "should be able to configure a host as backup on #{host}" do
        pp = <<-EOS
          # Puppet code for BACKUP state here
        EOS
        apply_manifest_on(host, pp, :catch_failures => true)
      end
    end

    hosts_as('master').each do |host|
      it "should be able to configure a host as backup on #{host}" do
        pp = <<-EOS
          # Puppet code for MASTER state here
        EOS
        apply_manifest_on(host, pp, :catch_failures => true)
      end
    end

    # Some sort of text to destroy host here and check that IP goes back to master?

  end
end
@arioch
Copy link
Contributor

arioch commented Mar 26, 2015

Ohh excellent, thanks! 👍
Will have a closer look at it over the weekend.

@petems
Copy link
Member Author

petems commented Mar 26, 2015

No prob! 😄 I adapted this from @hunner's HAProxy multi-node testing code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants