Docker测试环境

时间:2014-06-18 08:49:58

标签: beaker

我刚刚在docker的文档中解释了配置。

HOSTS:
  ubuntu-12-10:
    platform: ubuntu-12.10-x64
    image: ubuntu:12.10
    hypervisor: docker
CONFIG: 
  type: foss

但是我在启动烧杯后得到了这个堆栈跟踪:

ubuntu@ip-xxx-xx-xx-xxx:~$ beaker --hosts test-environment.yaml
/var/lib/gems/1.9.1/gems/beaker-1.12.2/lib/beaker/options/options_hash.rb:27:in `[]': undefined method `to_sym' for 0:Fixnum (NoMethodError)
    from /var/lib/gems/1.9.1/gems/beaker-1.12.2/lib/beaker/options/parser.rb:152:in `set_default_host!'
    from /var/lib/gems/1.9.1/gems/beaker-1.12.2/lib/beaker/options/parser.rb:346:in `normalize_args'
    from /var/lib/gems/1.9.1/gems/beaker-1.12.2/lib/beaker/options/parser.rb:211:in `parse_args'
    from /var/lib/gems/1.9.1/gems/beaker-1.12.2/lib/beaker/cli.rb:14:in `initialize'
    from /var/lib/gems/1.9.1/gems/beaker-1.12.2/bin/beaker:6:in `new'
    from /var/lib/gems/1.9.1/gems/beaker-1.12.2/bin/beaker:6:in `<top (required)>'
    from /usr/local/bin/beaker:23:in `load'
    from /usr/local/bin/beaker:23:in `<main>'

1 个答案:

答案 0 :(得分:1)

方法

set_default_host!(主机)

解析器库的

要求您至少在主机中定义了默认角色或主角色。

  

添加&#39;默认&#39;确定为默认主机的角色。如果主机已具有默认角色,则不执行任何操作。如果多个主机具有默认&#39;默认&#39;,则引发错误。默认主机确定为1)单个主机配置中的唯一主机,2)具有角色&#39;主机&#39;的主机。定义

请参阅http://www.rdoc.info/github/puppetlabs/beaker/frames/Beaker/Options/Parser

此外,您可能需要安装gem docker-api,请参阅https://github.com/swipely/docker-api

对于将来的参考,我已记录了http://varmenise.tumblr.com/post/89252765948/beaker-acceptance-tests-on-modules-with-docker-tests

中的步骤