beaker-rspec multiple node tests

asked 2017-11-06 17:05:56 -0600

louis gravatar image

I am using multi-node nodeset to simulate a server with two clients.

 HOSTS:
  ossecserver:
    roles:
      - agent
    platform: ubuntu-1404-x86_64
    box: puppetlabs/ubuntu-14.04-64-nocm
    hypervisor: vagrant
    ip: 10.10.11.10
    vagrant_memsize: 2048
  ossecagent-windows:
    roles:
      - default
      - agent
      - windows-ossec
    platform: windows-2012_r2-amd64
    box: opentable/win-2012-standard-amd64-nocm
    hypervisor: vagrant
    user: vagrant
    ip: 10.10.11.11
    vagrant_memsize: 2048
    is_cygwin: false
  ossecagent-ubuntu:
    roles:
      - agent
      - ubuntu-ossec
    platform: ubuntu-1404-x86_64
    box:  puppetlabs/ubuntu-14.04-64-nocm
    hypervisor: vagrant
    ip: 10.10.11.12
    vagrant_memsize: 1024
CONFIG:
  type: foss
  log_level: verbose

I would like to execute a different kind of rspec test based on the role but it seems that the linux test is executed on the windows machine.

ossec-client windows

if hosts.length > 1
  hosts_as('windows-ossec').each do |host|
    ... My tests...
 end

end

ossec-client linux

if hosts.length > 1
  hosts_as('ubuntu-ossec').each do |host|
  end
end
edit retag flag offensive close merge delete

Comments

it seems that if switch the default node to linux then it tries to run serverspec as powershell and viceversa it tries to run windows serverspec as linux. Is there a way to switch the backend in the test itself?

louis gravatar imagelouis ( 2017-11-07 19:14:53 -0600 )edit