Sha256: 3aca5126e9136e2bce63af3237f9a949ef7f27dfdbf63a41a50a8ceb45a076e7

Contents?: true

Size: 1.24 KB

Versions: 81

Compression:

Stored size: 1.24 KB

Contents

test_name 'use the init subcommand' do

  SubcommandUtil = Beaker::Subcommands::SubcommandUtil
  def delete_root_folder_contents
    on default, 'rm -rf /root/* /root/.beaker'
  end

  step 'ensure beaker init requires hosts flag' do
    result = on(default, 'beaker init')
    assert_match(/No value(.+)--hosts/, result.raw_output)
  end

  step 'ensure beaker init writes YAML configuration files to disk' do
    delete_root_folder_contents
    on(default, 'beaker init --hosts centos6-64')
    subcommand_options = on(default, "cat #{SubcommandUtil::SUBCOMMAND_OPTIONS}").stdout
    subcommand_state = on(default, "cat #{SubcommandUtil::SUBCOMMAND_STATE}").stdout
    parsed_options = YAML.parse(subcommand_options).to_ruby
    assert(parsed_options["HOSTS"].count == 1)
    assert(parsed_options.class == Hash)
    assert(YAML.parse(subcommand_state).to_ruby.class == Hash)
  end

  step 'ensure beaker init saves beaker-run arguments to the subcommand_options.yaml' do
    delete_root_folder_contents
    on(default, 'beaker init --log-level verbose --hosts centos6-64')
    subcommand_options = on(default, "cat #{SubcommandUtil::SUBCOMMAND_OPTIONS}").stdout
    hash = YAML.parse(subcommand_options).to_ruby
    assert_equal('verbose', hash['log_level'])
  end
end

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
beaker-4.42.0 acceptance/tests/subcommands/init.rb
beaker-4.41.2 acceptance/tests/subcommands/init.rb
beaker-4.41.1 acceptance/tests/subcommands/init.rb
beaker-4.41.0 acceptance/tests/subcommands/init.rb
beaker-4.40.2 acceptance/tests/subcommands/init.rb
beaker-4.40.1 acceptance/tests/subcommands/init.rb
beaker-4.40.0 acceptance/tests/subcommands/init.rb
beaker-4.39.0 acceptance/tests/subcommands/init.rb
beaker-4.38.1 acceptance/tests/subcommands/init.rb
beaker-4.38.0 acceptance/tests/subcommands/init.rb
beaker-4.37.2 acceptance/tests/subcommands/init.rb
beaker-4.37.1 acceptance/tests/subcommands/init.rb
beaker-4.37.0 acceptance/tests/subcommands/init.rb
beaker-4.36.1 acceptance/tests/subcommands/init.rb
beaker-4.36.0 acceptance/tests/subcommands/init.rb
beaker-4.35.0 acceptance/tests/subcommands/init.rb
beaker-4.34.0 acceptance/tests/subcommands/init.rb
beaker-4.33.0 acceptance/tests/subcommands/init.rb
beaker-4.32.0 acceptance/tests/subcommands/init.rb
beaker-4.31.0 acceptance/tests/subcommands/init.rb